[asterisk-commits] wedhorn: trunk r405269 - in /trunk: ./ channels/chan_dahdi.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu Jan 9 17:50:09 CST 2014


Author: wedhorn
Date: Thu Jan  9 17:50:07 2014
New Revision: 405269

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=405269
Log:
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

Modified:
    trunk/   (props changed)
    trunk/channels/chan_dahdi.c

Propchange: trunk/
------------------------------------------------------------------------------
Binary property 'branch-12-merged' - no diff available.

Modified: trunk/channels/chan_dahdi.c
URL: http://svnview.digium.com/svn/asterisk/trunk/channels/chan_dahdi.c?view=diff&rev=405269&r1=405268&r2=405269
==============================================================================
--- trunk/channels/chan_dahdi.c (original)
+++ trunk/channels/chan_dahdi.c Thu Jan  9 17:50:07 2014
@@ -10828,7 +10828,6 @@
 	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 @@
 			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];
-
-			if (!channo) {
+	{
+		int i, x;
+		for (x = 0; x < NUM_SPANS; x++) {
+			struct dahdi_pri *pri = pris + x;
+
+			if (!pris[x].pri.pvts[0]) {
 				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;
-			}
-		}
+			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
-	}
 	if (!default_conf.chan.cc_params || !base_conf.chan.cc_params ||
 		!conf.chan.cc_params) {
 		goto out;




More information about the asterisk-commits mailing list