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

Guido Falsi asteriskteam at digium.com
Sat Sep 14 10:08:48 CDT 2019


Guido Falsi has uploaded this change for review. ( 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(-)



  git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/72/12872/1

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-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20190914/1fa74229/attachment-0001.html>


More information about the asterisk-code-review mailing list