]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Fix chan_dahdi copile issue in dev-mode.
authorDamien Wedhorn <voip@facts.com.au>
Thu, 9 Jan 2014 23:50:07 +0000 (23:50 +0000)
committerDamien Wedhorn <voip@facts.com.au>
Thu, 9 Jan 2014 23:50:07 +0000 (23:50 +0000)
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

channels/chan_dahdi.c

index 3cd71edc1d30a1c28235811aa22e36bc5b15d86e..d89fffd758df6cfd810f70a2fb0c47d0197c0adb 100644 (file)
@@ -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;