aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNeels Hofmeyr <neels@hofmeyr.de>2018-02-27 12:38:28 +0100
committerNeels Hofmeyr <neels@hofmeyr.de>2018-03-05 00:59:44 +0100
commit302f8659b42a53ab22226d852e7c62a65b9a3038 (patch)
tree012db95c05f705d78ad531cbb3c3f324ae681cd4
parent0bfd8d9d37de5ee5af522214e2b609075b7e1326 (diff)
compiler warning: chan_compat_with_mode(): clearly handle all enum vals
-rw-r--r--src/libbsc/bsc_api.c26
1 files changed, 7 insertions, 19 deletions
diff --git a/src/libbsc/bsc_api.c b/src/libbsc/bsc_api.c
index d5aaf9ba8..d792b5899 100644
--- a/src/libbsc/bsc_api.c
+++ b/src/libbsc/bsc_api.c
@@ -423,8 +423,9 @@ static int chan_compat_with_mode(struct gsm_lchan *lchan, int chan_mode, int ful
case GSM_LCHAN_TCH_H:
case GSM_LCHAN_SDCCH:
return 1;
+ default:
+ return 0;
}
- break;
case GSM48_CMODE_SPEECH_V1:
case GSM48_CMODE_SPEECH_AMR:
case GSM48_CMODE_DATA_3k6:
@@ -433,33 +434,20 @@ static int chan_compat_with_mode(struct gsm_lchan *lchan, int chan_mode, int ful
* an explicit override by the 'full_rate' argument */
switch (lchan->type) {
case GSM_LCHAN_TCH_F:
- if (full_rate)
- return 1;
- else
- return 0;
- break;
+ return full_rate ? 1 : 0;
case GSM_LCHAN_TCH_H:
- if (full_rate)
- return 0;
- else
- return 1;
- break;
+ return full_rate ? 0 : 1;
default:
return 0;
}
- break;
case GSM48_CMODE_DATA_12k0:
case GSM48_CMODE_DATA_14k5:
case GSM48_CMODE_SPEECH_EFR:
/* these services all explicitly require a TCH/F */
- if (lchan->type == GSM_LCHAN_TCH_F)
- return 1;
- else
- return 0;
- break;
+ return (lchan->type == GSM_LCHAN_TCH_F) ? 1 : 0;
+ default:
+ return 0;
}
-
- return 0;
}
/**