[Asterisk-code-review] chan_dahdi: Fix build with clang/llvm (...asterisk[13])

George Joseph asteriskteam at digium.com
Tue Sep 17 09:29:16 CDT 2019


George Joseph has submitted this change and it was merged. ( https://gerrit.asterisk.org/c/asterisk/+/12872 )

Change subject: chan_dahdi: Fix build with clang/llvm
......................................................................

chan_dahdi: Fix build with clang/llvm

On FreeBSD using the clang/llvm compiler build fails to build due
to the switch statement argument being a non integer type expression.
Switch to an if/else if/else construct to sidestep the issue.

ASTERISK-28536 #close

Change-Id: Idf4a82cc1e94580a2d017fe9e351c226f23e20c8
---
M channels/chan_dahdi.c
1 file changed, 6 insertions(+), 4 deletions(-)

Approvals:
  Joshua Colp: Looks good to me, but someone else must approve
  Sean Bright: Looks good to me, but someone else must approve
  George Joseph: Looks good to me, approved; Approved for Submit



diff --git a/channels/chan_dahdi.c b/channels/chan_dahdi.c
index 5ff12c6..46c71db 100644
--- a/channels/chan_dahdi.c
+++ b/channels/chan_dahdi.c
@@ -15263,10 +15263,12 @@
 			int channo;
 			int prev_channo;
 			x++;
-			switch (mfcr2->r2master) {
-			case 0L: thread_status = "zero"; break;
-			case AST_PTHREADT_NULL: thread_status = "none"; break;
-			default: thread_status = "created"; break;
+			if (mfcr2->r2master == 0L) {
+				thread_status = "zero";
+			} else if (mfcr2->r2master == AST_PTHREADT_NULL) {
+				thread_status = "none";
+			} else {
+				thread_status = "created";
 			}
 			snprintf(index, sizeof(index), "%d", mfcr2->index);
 			snprintf(live_chans_str, sizeof(live_chans_str), "%d", mfcr2->live_chans);

-- 
To view, visit https://gerrit.asterisk.org/c/asterisk/+/12872
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: 13
Gerrit-Change-Id: Idf4a82cc1e94580a2d017fe9e351c226f23e20c8
Gerrit-Change-Number: 12872
Gerrit-PatchSet: 1
Gerrit-Owner: Guido Falsi <madpilot at freebsd.org>
Gerrit-Reviewer: Friendly Automation
Gerrit-Reviewer: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Guido Falsi <madpilot at freebsd.org>
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>
Gerrit-Reviewer: Sean Bright <sean.bright at gmail.com>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20190917/1252e920/attachment.html>


More information about the asterisk-code-review mailing list