[asterisk-commits] wedhorn: branch 12 r405268 - /branches/12/channels/chan_dahdi.c

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


Author: wedhorn
Date: Thu Jan  9 17:45:20 2014
New Revision: 405268

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

Modified:
    branches/12/channels/chan_dahdi.c

Modified: branches/12/channels/chan_dahdi.c
URL: http://svnview.digium.com/svn/asterisk/branches/12/channels/chan_dahdi.c?view=diff&rev=405268&r1=405267&r2=405268
==============================================================================
--- branches/12/channels/chan_dahdi.c (original)
+++ branches/12/channels/chan_dahdi.c Thu Jan  9 17:45:20 2014
@@ -10818,7 +10818,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);
@@ -10831,31 +10830,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