From: Guido Falsi Date: Sat, 14 Sep 2019 15:05:23 +0000 (+0200) Subject: chan_dahdi: Fix build with clang/llvm X-Git-Tag: 17.1.0-rc1~79^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5ff2f7a0169d30952f1ba9c5ff48027e6c950f03;p=thirdparty%2Fasterisk.git 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 --- diff --git a/channels/chan_dahdi.c b/channels/chan_dahdi.c index 2627e0977e..d9293bc22a 100644 --- a/channels/chan_dahdi.c +++ b/channels/chan_dahdi.c @@ -15160,10 +15160,12 @@ static void mfcr2_show_links_of(struct ast_cli_args *a, struct r2links *list_hea 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);