summaryrefslogtreecommitdiff
path: root/channels
diff options
context:
space:
mode:
authorDamien Wedhorn <voip@facts.com.au>2014-01-09 23:50:07 +0000
committerDamien Wedhorn <voip@facts.com.au>2014-01-09 23:50:07 +0000
commitde6563c618e2b50631619d79adcc8ab1ee262e64 (patch)
treed25b7c81932148212f32a5b560fd6bc67c32da6d /channels
parent04c5c39d56cc3fab31139ffba785421560073700 (diff)
Fix chan_dahdi copile issue in dev-mode.
Error "unused variable i in dahdi_create_channel_range" when compiling in dev-mode. Small restructure to dahdi_create_channel_range to move the for(x) loop and int i,x to a block within the IFDEF. ........ Merged revisions 405268 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@405269 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'channels')
-rw-r--r--channels/chan_dahdi.c40
1 files changed, 21 insertions, 19 deletions
diff --git a/channels/chan_dahdi.c b/channels/chan_dahdi.c
index 3cd71edc1..d89fffd75 100644
--- a/channels/chan_dahdi.c
+++ b/channels/chan_dahdi.c
@@ -10828,7 +10828,6 @@ static int dahdi_create_channel_range(int start, int end)
struct dahdi_chan_conf default_conf = dahdi_chan_conf_default();
struct dahdi_chan_conf base_conf = dahdi_chan_conf_default();
struct dahdi_chan_conf conf = dahdi_chan_conf_default();
- int i, x;
int ret = RESULT_FAILURE; /* be pessimistic */
ast_debug(1, "channel range caps: %d - %d\n", start, end);
@@ -10841,31 +10840,34 @@ static int dahdi_create_channel_range(int start, int end)
goto out;
}
}
- for (x = 0; x < NUM_SPANS; x++) {
#ifdef HAVE_PRI
- struct dahdi_pri *pri = pris + x;
-
- if (!pris[x].pri.pvts[0]) {
- break;
- }
- for (i = 0; i < SIG_PRI_NUM_DCHANS; i++) {
- int channo = pri->dchannels[i];
+ {
+ int i, x;
+ for (x = 0; x < NUM_SPANS; x++) {
+ struct dahdi_pri *pri = pris + x;
- if (!channo) {
- break;
- }
- if (!pri->pri.fds[i]) {
+ if (!pris[x].pri.pvts[0]) {
break;
}
- if (channo >= start && channo <= end) {
- ast_log(LOG_ERROR,
- "channel range %d-%d is occupied by span %d\n",
- start, end, x + 1);
- goto out;
+ for (i = 0; i < SIG_PRI_NUM_DCHANS; i++) {
+ int channo = pri->dchannels[i];
+
+ if (!channo) {
+ break;
+ }
+ if (!pri->pri.fds[i]) {
+ break;
+ }
+ if (channo >= start && channo <= end) {
+ ast_log(LOG_ERROR,
+ "channel range %d-%d is occupied by span %d\n",
+ start, end, x + 1);
+ goto out;
+ }
}
}
-#endif
}
+#endif
if (!default_conf.chan.cc_params || !base_conf.chan.cc_params ||
!conf.chan.cc_params) {
goto out;