[svn-commits] seanbright: branch seanbright/resolve-shadow-warnings r129501 - in /team/sean...

SVN commits to the Digium repositories svn-commits at lists.digium.com
Wed Jul 9 18:43:52 CDT 2008


Author: seanbright
Date: Wed Jul  9 18:43:51 2008
New Revision: 129501

URL: http://svn.digium.com/view/asterisk?view=rev&rev=129501
Log:
Merged revisions 129045,129048,129114,129152,129156,129159,129210,129270,129307,129344,129399,129437 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/trunk

................
r129045 | bbryant | 2008-07-08 12:40:28 -0400 (Tue, 08 Jul 2008) | 7 lines

Janitor project to convert sizeof to ARRAY_LEN macro.

(closes issue #13002)
Reported by: caio1982
Patches:
      janitor_arraylen5.diff uploaded by caio1982 (license 22)

................
r129048 | tilghman | 2008-07-08 12:49:01 -0400 (Tue, 08 Jul 2008) | 15 lines

Merged revisions 129047 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r129047 | tilghman | 2008-07-08 11:45:23 -0500 (Tue, 08 Jul 2008) | 7 lines

Timestamp decoding for video mini-frames is bogus, because the timestamp only
includes 15 bits, unlike voice frames, which contain a 16-bit timestamp.
(closes issue #13013)
 Reported by: jpgrayson
 Patches: 
       chan_iax2_unwrap_ts.patch uploaded by jpgrayson (license 492)

........

................
r129114 | tilghman | 2008-07-08 16:17:08 -0400 (Tue, 08 Jul 2008) | 8 lines

Reduce length of time that 'asterisk -rx' waits.
(closes issue #13001)
 Reported by: eliel
 Patches: 
       20080708__bug13001.diff.txt uploaded by Corydon76 (license 14)
       20080708__bug13001.diff.txt.fixed uploaded by eliel (license 64)
 Tested by: Corydon76, eliel

................
r129152 | tilghman | 2008-07-08 16:30:29 -0400 (Tue, 08 Jul 2008) | 16 lines

Merged revisions 129149 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r129149 | tilghman | 2008-07-08 15:27:47 -0500 (Tue, 08 Jul 2008) | 8 lines

Cause SIP to return a 480 instead of a 404 when a sip peer exists, but is not
registered.
(closes issue #12885)
 Reported by: ibc
 Patches: 
       20080701__bug12885__2.diff.txt uploaded by Corydon76 (license 14)
 Tested by: ibc

........

................
r129156 | bbryant | 2008-07-08 17:00:01 -0400 (Tue, 08 Jul 2008) | 6 lines

Fix a bug in SRV lookups where dnsmgr would discard everything but the 
first SRV result from DNS before processing weights and priorities and 
dns_parse_answer wouldn't report that there were no records in DNS 
unless a failure occured. Also fixed a bug where dnsmgr_refresh would 
report that a entry was being changed when ast_gethostbyname had failed.

................
r129159 | mmichelson | 2008-07-08 17:10:33 -0400 (Tue, 08 Jul 2008) | 21 lines

Blocked revisions 129158 via svnmerge

........
r129158 | mmichelson | 2008-07-08 16:09:10 -0500 (Tue, 08 Jul 2008) | 14 lines

Backport TCP-related timeouts to IMAP voicemail in 1.4
since it should solve bugs people are experiencing. Specifically,
there are times where communication with the IMAP server causes
system calls to block forever. If this should happen when querying
the mailbox so that chan_sip's do_monitor thread can send MWI to
a phone, it means that SIP calls cannot be processed any more.

The timeout options are outlined in doc/imapstorage.txt. Defaults
for the timeouts are sixty seconds.

(closes issue #12987)
Reported by: mthomasslo


........

................
r129210 | mmichelson | 2008-07-08 17:32:09 -0400 (Tue, 08 Jul 2008) | 10 lines

Blocked revisions 129208 via svnmerge

........
r129208 | mmichelson | 2008-07-08 16:31:51 -0500 (Tue, 08 Jul 2008) | 3 lines

Update documentation to have the correct option name


........

................
r129270 | mmichelson | 2008-07-08 18:56:12 -0400 (Tue, 08 Jul 2008) | 3 lines

Fix compilation error when IMAP storage is enabled


................
r129307 | tilghman | 2008-07-08 23:39:59 -0400 (Tue, 08 Jul 2008) | 2 lines

Code wasn't ready to be merged - see -dev list discussion

................
r129344 | seanbright | 2008-07-09 09:44:43 -0400 (Wed, 09 Jul 2008) | 12 lines

Merged revisions 129343 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r129343 | seanbright | 2008-07-09 09:41:21 -0400 (Wed, 09 Jul 2008) | 4 lines

Look for the system installed awk instead of assuming it's at /usr/bin/awk.

Pointed out by jmls via #asterisk-dev.

........

................
r129399 | mattf | 2008-07-09 11:57:06 -0400 (Wed, 09 Jul 2008) | 1 line

Add Proceeding() application (#13025)
................
r129437 | mmichelson | 2008-07-09 15:40:30 -0400 (Wed, 09 Jul 2008) | 21 lines

Merged revisions 129436 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r129436 | mmichelson | 2008-07-09 14:32:20 -0500 (Wed, 09 Jul 2008) | 13 lines

Fix a problem where inbound rfc2833 audio would be sent to the 
core instead of being P2P bridged. When the core regenerated
the rfc2833 packet for the outbound leg, the SSRC would be different
than the RTP audio on the call leg causing DTMF detection issues on
the far end.

(closes issue #12955)
Reported by: tonyredstone
Patches:
      dynamic_rtp.patch uploaded by tsearle (license 373)
Tested by: tonyredstone


........

................

Added:
    team/seanbright/resolve-shadow-warnings/main/editline/makelist.in
      - copied unchanged from r129437, trunk/main/editline/makelist.in
Removed:
    team/seanbright/resolve-shadow-warnings/main/editline/makelist
Modified:
    team/seanbright/resolve-shadow-warnings/   (props changed)
    team/seanbright/resolve-shadow-warnings/apps/app_adsiprog.c
    team/seanbright/resolve-shadow-warnings/apps/app_dial.c
    team/seanbright/resolve-shadow-warnings/apps/app_meetme.c
    team/seanbright/resolve-shadow-warnings/apps/app_parkandannounce.c
    team/seanbright/resolve-shadow-warnings/apps/app_voicemail.c
    team/seanbright/resolve-shadow-warnings/channels/chan_dahdi.c
    team/seanbright/resolve-shadow-warnings/channels/chan_iax2.c
    team/seanbright/resolve-shadow-warnings/channels/chan_sip.c
    team/seanbright/resolve-shadow-warnings/channels/h323/ast_h323.cxx
    team/seanbright/resolve-shadow-warnings/channels/iax2-provision.c
    team/seanbright/resolve-shadow-warnings/include/asterisk/causes.h
    team/seanbright/resolve-shadow-warnings/include/asterisk/channel.h
    team/seanbright/resolve-shadow-warnings/include/asterisk/pbx.h
    team/seanbright/resolve-shadow-warnings/main/acl.c
    team/seanbright/resolve-shadow-warnings/main/asterisk.c
    team/seanbright/resolve-shadow-warnings/main/callerid.c
    team/seanbright/resolve-shadow-warnings/main/channel.c
    team/seanbright/resolve-shadow-warnings/main/cli.c
    team/seanbright/resolve-shadow-warnings/main/dns.c
    team/seanbright/resolve-shadow-warnings/main/dnsmgr.c
    team/seanbright/resolve-shadow-warnings/main/editline/Makefile.in
    team/seanbright/resolve-shadow-warnings/main/editline/configure
    team/seanbright/resolve-shadow-warnings/main/editline/configure.in
    team/seanbright/resolve-shadow-warnings/main/frame.c
    team/seanbright/resolve-shadow-warnings/main/logger.c
    team/seanbright/resolve-shadow-warnings/main/manager.c
    team/seanbright/resolve-shadow-warnings/main/pbx.c
    team/seanbright/resolve-shadow-warnings/main/rtp.c
    team/seanbright/resolve-shadow-warnings/main/srv.c
    team/seanbright/resolve-shadow-warnings/pbx/dundi-parser.c
    team/seanbright/resolve-shadow-warnings/pbx/pbx_realtime.c
    team/seanbright/resolve-shadow-warnings/res/res_agi.c
    team/seanbright/resolve-shadow-warnings/res/res_limit.c

Propchange: team/seanbright/resolve-shadow-warnings/
------------------------------------------------------------------------------
Binary property 'branch-1.4-blocked' - no diff available.

Propchange: team/seanbright/resolve-shadow-warnings/
------------------------------------------------------------------------------
Binary property 'branch-1.4-merged' - no diff available.

Propchange: team/seanbright/resolve-shadow-warnings/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Wed Jul  9 18:43:51 2008
@@ -1,1 +1,1 @@
-/trunk:1-129042
+/trunk:1-129500

Modified: team/seanbright/resolve-shadow-warnings/apps/app_adsiprog.c
URL: http://svn.digium.com/view/asterisk/team/seanbright/resolve-shadow-warnings/apps/app_adsiprog.c?view=diff&rev=129501&r1=129500&r2=129501
==============================================================================
--- team/seanbright/resolve-shadow-warnings/apps/app_adsiprog.c (original)
+++ team/seanbright/resolve-shadow-warnings/apps/app_adsiprog.c Wed Jul  9 18:43:51 2008
@@ -515,7 +515,7 @@
 {
 	int x;
 
-	for (x = 0; x < sizeof(events) / sizeof(events[0]); x++) {
+	for (x = 0; x < ARRAY_LEN(events); x++) {
 		if (!strcasecmp(events[x].name, name))
 			return events[x].id;
 	}
@@ -527,7 +527,7 @@
 {
 	int x;
 
-	for (x = 0; x <sizeof(justify) / sizeof(justify[0]); x++) {
+	for (x = 0; x < ARRAY_LEN(justify); x++) {
 		if (!strcasecmp(justify[x].name, name))
 			return justify[x].id;
 	}
@@ -935,7 +935,7 @@
 	int x, res;
 	char *unused;
 
-	for (x = 0; x < sizeof(kcmds) / sizeof(kcmds[0]); x++) {
+	for (x = 0; x < ARRAY_LEN(kcmds); x++) {
 		if ((kcmds[x].id > -1) && !strcasecmp(kcmds[x].name, code)) {
 			if (kcmds[x].add_args) {
 				res = kcmds[x].add_args(key->retstr + key->retstrlen,
@@ -964,7 +964,7 @@
 	int x, res, max = sub->id ? MAX_SUB_LEN : MAX_MAIN_LEN;
 	char *unused;
 
-	for (x = 0; x < sizeof(opcmds) / sizeof(opcmds[0]); x++) {
+	for (x = 0; x < ARRAY_LEN(opcmds); x++) {
 		if ((opcmds[x].id > -1) && !strcasecmp(opcmds[x].name, code)) {
 			if (opcmds[x].add_args) {
 				res = opcmds[x].add_args(sub->data + sub->datalen,

Modified: team/seanbright/resolve-shadow-warnings/apps/app_dial.c
URL: http://svn.digium.com/view/asterisk/team/seanbright/resolve-shadow-warnings/apps/app_dial.c?view=diff&rev=129501&r1=129500&r2=129501
==============================================================================
--- team/seanbright/resolve-shadow-warnings/apps/app_dial.c (original)
+++ team/seanbright/resolve-shadow-warnings/apps/app_dial.c Wed Jul  9 18:43:51 2008
@@ -387,6 +387,7 @@
 		num->congestion++;
 		break;
 
+	case AST_CAUSE_NO_ROUTE_DESTINATION:
 	case AST_CAUSE_UNREGISTERED:
 		if (cdr)
 			ast_cdr_failed(cdr);

Modified: team/seanbright/resolve-shadow-warnings/apps/app_meetme.c
URL: http://svn.digium.com/view/asterisk/team/seanbright/resolve-shadow-warnings/apps/app_meetme.c?view=diff&rev=129501&r1=129500&r2=129501
==============================================================================
--- team/seanbright/resolve-shadow-warnings/apps/app_meetme.c (original)
+++ team/seanbright/resolve-shadow-warnings/apps/app_meetme.c Wed Jul  9 18:43:51 2008
@@ -3101,7 +3101,7 @@
 			/* Select first conference number not in use */
 			if (ast_strlen_zero(confno) && dynamic) {
 				AST_LIST_LOCK(&confs);
-				for (i = 0; i < sizeof(conf_map) / sizeof(conf_map[0]); i++) {
+				for (i = 0; i < ARRAY_LEN(conf_map); i++) {
 					if (!conf_map[i]) {
 						snprintf(confno, sizeof(confno), "%d", i);
 						conf_map[i] = 1;

Modified: team/seanbright/resolve-shadow-warnings/apps/app_parkandannounce.c
URL: http://svn.digium.com/view/asterisk/team/seanbright/resolve-shadow-warnings/apps/app_parkandannounce.c?view=diff&rev=129501&r1=129500&r2=129501
==============================================================================
--- team/seanbright/resolve-shadow-warnings/apps/app_parkandannounce.c (original)
+++ team/seanbright/resolve-shadow-warnings/apps/app_parkandannounce.c Wed Jul  9 18:43:51 2008
@@ -146,7 +146,7 @@
 
 	ast_verb(4, "Announce Template:%s\n", args.template);
 
-	for (looptemp = 0; looptemp < sizeof(tmp) / sizeof(tmp[0]); looptemp++) {
+	for (looptemp = 0; looptemp < ARRAY_LEN(tmp); looptemp++) {
 		if ((tmp[looptemp] = strsep(&args.template, ":")) != NULL)
 			continue;
 		else

Modified: team/seanbright/resolve-shadow-warnings/apps/app_voicemail.c
URL: http://svn.digium.com/view/asterisk/team/seanbright/resolve-shadow-warnings/apps/app_voicemail.c?view=diff&rev=129501&r1=129500&r2=129501
==============================================================================
--- team/seanbright/resolve-shadow-warnings/apps/app_voicemail.c (original)
+++ team/seanbright/resolve-shadow-warnings/apps/app_voicemail.c Wed Jul  9 18:43:51 2008
@@ -5928,7 +5928,7 @@
 	if (box == NEW_FOLDER) {
 		ast_copy_string(vms->vmbox, "vm-INBOX", sizeof(vms->vmbox));
 	} else {
-		snprintf(vms->vmbox, sizeof(vm->vmbox), "vm-%s", mbox(box));
+		snprintf(vms->vmbox, sizeof(vms->vmbox), "vm-%s", mbox(box));
 	}
 
 	/* Build up server information */

Modified: team/seanbright/resolve-shadow-warnings/channels/chan_dahdi.c
URL: http://svn.digium.com/view/asterisk/team/seanbright/resolve-shadow-warnings/channels/chan_dahdi.c?view=diff&rev=129501&r1=129500&r2=129501
==============================================================================
--- team/seanbright/resolve-shadow-warnings/channels/chan_dahdi.c (original)
+++ team/seanbright/resolve-shadow-warnings/channels/chan_dahdi.c Wed Jul  9 18:43:51 2008
@@ -1344,7 +1344,7 @@
 static char *alarm2str(int alarm)
 {
 	int x;
-	for (x = 0; x < sizeof(alarms) / sizeof(alarms[0]); x++) {
+	for (x = 0; x < ARRAY_LEN(alarms); x++) {
 		if (alarms[x].alarm & alarm)
 			return alarms[x].name;
 	}
@@ -1697,7 +1697,7 @@
 
 	switch (law) {
 	case DAHDI_LAW_ALAW:
-		for (j = 0; j < (sizeof(g->txgain) / sizeof(g->txgain[0])); j++) {
+		for (j = 0; j < ARRAY_LEN(g->txgain); j++) {
 			if (gain) {
 				k = (int) (((float) AST_ALAW(j)) * linear_gain);
 				if (k > 32767) k = 32767;
@@ -1709,7 +1709,7 @@
 		}
 		break;
 	case DAHDI_LAW_MULAW:
-		for (j = 0; j < (sizeof(g->txgain) / sizeof(g->txgain[0])); j++) {
+		for (j = 0; j < ARRAY_LEN(g->txgain); j++) {
 			if (gain) {
 				k = (int) (((float) AST_MULAW(j)) * linear_gain);
 				if (k > 32767) k = 32767;
@@ -1731,7 +1731,7 @@
 
 	switch (law) {
 	case DAHDI_LAW_ALAW:
-		for (j = 0; j < (sizeof(g->rxgain) / sizeof(g->rxgain[0])); j++) {
+		for (j = 0; j < ARRAY_LEN(g->rxgain); j++) {
 			if (gain) {
 				k = (int) (((float) AST_ALAW(j)) * linear_gain);
 				if (k > 32767) k = 32767;
@@ -1743,7 +1743,7 @@
 		}
 		break;
 	case DAHDI_LAW_MULAW:
-		for (j = 0; j < (sizeof(g->rxgain) / sizeof(g->rxgain[0])); j++) {
+		for (j = 0; j < ARRAY_LEN(g->rxgain); j++) {
 			if (gain) {
 				k = (int) (((float) AST_MULAW(j)) * linear_gain);
 				if (k > 32767) k = 32767;
@@ -6891,7 +6891,7 @@
 						len = 0;
 						distMatches = 0;
 						/* Clear the current ring data array so we dont have old data in it. */
-						for (receivedRingT = 0; receivedRingT < (sizeof(curRingData) / sizeof(curRingData[0])); receivedRingT++)
+						for (receivedRingT = 0; receivedRingT < ARRAY_LEN(curRingData); receivedRingT++)
 							curRingData[receivedRingT] = 0;
 						receivedRingT = 0;
 						counter = 0;
@@ -7040,7 +7040,7 @@
 				len = 0;
 				distMatches = 0;
 				/* Clear the current ring data array so we dont have old data in it. */
-				for (receivedRingT = 0; receivedRingT < (sizeof(curRingData) / sizeof(curRingData[0])); receivedRingT++)
+				for (receivedRingT = 0; receivedRingT < ARRAY_LEN(curRingData); receivedRingT++)
 					curRingData[receivedRingT] = 0;
 				receivedRingT = 0;
 				counter = 0;

Modified: team/seanbright/resolve-shadow-warnings/channels/chan_iax2.c
URL: http://svn.digium.com/view/asterisk/team/seanbright/resolve-shadow-warnings/channels/chan_iax2.c?view=diff&rev=129501&r1=129500&r2=129501
==============================================================================
--- team/seanbright/resolve-shadow-warnings/channels/chan_iax2.c (original)
+++ team/seanbright/resolve-shadow-warnings/channels/chan_iax2.c Wed Jul  9 18:43:51 2008
@@ -2790,23 +2790,27 @@
 		if (dp->flags & CACHE_FLAG_UNKNOWN)
 			strncat(tmp, "UNKNOWN|", sizeof(tmp) - strlen(tmp) - 1);
 		/* Trim trailing pipe */
-		if (!ast_strlen_zero(tmp))
+		if (!ast_strlen_zero(tmp)) {
 			tmp[strlen(tmp) - 1] = '\0';
-		else
+		} else {
 			ast_copy_string(tmp, "(none)", sizeof(tmp));
+		}
 		y = 0;
 		pc = strchr(dp->peercontext, '@');
-		if (!pc)
+		if (!pc) {
 			pc = dp->peercontext;
-		else
+		} else {
 			pc++;
-		for (x = 0; x < sizeof(dp->waiters) / sizeof(dp->waiters[0]); x++)
+		}
+		for (x = 0; x < ARRAY_LEN(dp->waiters); x++) {
 			if (dp->waiters[x] > -1)
 				y++;
-		if (s > 0)
+		}
+		if (s > 0) {
 			ast_cli(a->fd, "%-20.20s %-12.12s %-9d %-8d %s\n", pc, dp->exten, s, y, tmp);
-		else
+		} else {
 			ast_cli(a->fd, "%-20.20s %-12.12s %-9.9s %-8d %s\n", pc, dp->exten, "(expired)", y, tmp);
+		}
 	}
 
 	AST_LIST_LOCK(&dpcache);
@@ -2818,25 +2822,31 @@
 
 static void unwrap_timestamp(struct iax_frame *fr)
 {
-	int x;
-
-	if ( (fr->ts & 0xFFFF0000) == (iaxs[fr->callno]->last & 0xFFFF0000) ) {
-		x = fr->ts - iaxs[fr->callno]->last;
-		if (x < -50000) {
+	/* Video mini frames only encode the lower 15 bits of the session
+	 * timestamp, but other frame types (e.g. audio) encode 16 bits. */
+	const int ts_shift = (fr->af.frametype == AST_FRAME_VIDEO) ? 15 : 16;
+	const int lower_mask = (1 << ts_shift) - 1;
+	const int upper_mask = ~lower_mask;
+	const int last_upper = iaxs[fr->callno]->last & upper_mask;
+
+	if ( (fr->ts & upper_mask) == last_upper ) {
+		const int x = fr->ts - iaxs[fr->callno]->last;
+		const int threshold = (ts_shift == 15) ? 25000 : 50000;
+
+		if (x < -threshold) {
 			/* Sudden big jump backwards in timestamp:
 			   What likely happened here is that miniframe timestamp has circled but we haven't
 			   gotten the update from the main packet.  We'll just pretend that we did, and
 			   update the timestamp appropriately. */
-			fr->ts = ( (iaxs[fr->callno]->last & 0xFFFF0000) + 0x10000) | (fr->ts & 0xFFFF);
+			fr->ts = (last_upper + (1 << ts_shift)) | (fr->ts & lower_mask);
 			if (iaxdebug)
 				ast_debug(1, "schedule_delivery: pushed forward timestamp\n");
-		}
-		if (x > 50000) {
+		} else if (x > threshold) {
 			/* Sudden apparent big jump forwards in timestamp:
 			   What's likely happened is this is an old miniframe belonging to the previous
-			   top-16-bit timestamp that has turned up out of order.
+			   top 15 or 16-bit timestamp that has turned up out of order.
 			   Adjust the timestamp appropriately. */
-			fr->ts = ( (iaxs[fr->callno]->last & 0xFFFF0000) - 0x10000) | (fr->ts & 0xFFFF);
+			fr->ts = (last_upper - (1 << ts_shift)) | (fr->ts & lower_mask);
 			if (iaxdebug)
 				ast_debug(1, "schedule_delivery: pushed back timestamp\n");
 		}
@@ -6529,9 +6539,10 @@
 			dp->flags |= matchmore;
 		}
 		/* Wake up waiters */
-		for (x=0;x<sizeof(dp->waiters) / sizeof(dp->waiters[0]); x++)
+		for (x = 0; x < ARRAY_LEN(dp->waiters); x++) {
 			if (dp->waiters[x] > -1)
 				write(dp->waiters[x], "asdf", 4);
+		}
 	}
 	AST_LIST_TRAVERSE_SAFE_END;
 	AST_LIST_UNLOCK(&dpcache);
@@ -11442,7 +11453,7 @@
 		/* Expires in 30 mins by default */
 		dp->expiry.tv_sec += iaxdefaultdpcache;
 		dp->flags = CACHE_FLAG_PENDING;
-		for (x=0;x<sizeof(dp->waiters) / sizeof(dp->waiters[0]); x++)
+		for (x = 0; x < ARRAY_LEN(dp->waiters); x++)
 			dp->waiters[x] = -1;
 		/* Insert into the lists */
 		AST_LIST_INSERT_TAIL(&dpcache, dp, cache_list);
@@ -11457,12 +11468,12 @@
 	if (dp->flags & CACHE_FLAG_PENDING) {
 		/* Okay, here it starts to get nasty.  We need a pipe now to wait
 		   for a reply to come back so long as it's pending */
-		for (x=0;x<sizeof(dp->waiters) / sizeof(dp->waiters[0]); x++) {
+		for (x = 0; x < ARRAY_LEN(dp->waiters); x++) {
 			/* Find an empty slot */
 			if (dp->waiters[x] < 0)
 				break;
 		}
-		if (x >= sizeof(dp->waiters) / sizeof(dp->waiters[0])) {
+		if (x >= ARRAY_LEN(dp->waiters)) {
 			ast_log(LOG_WARNING, "No more waiter positions available\n");
 			return NULL;
 		}
@@ -11515,9 +11526,10 @@
 				/* Expire after only 60 seconds now.  This is designed to help reduce backlog in heavily loaded
 				   systems without leaving it unavailable once the server comes back online */
 				dp->expiry.tv_sec = dp->orig.tv_sec + 60;
-				for (x=0;x<sizeof(dp->waiters) / sizeof(dp->waiters[0]); x++)
+				for (x = 0; x < ARRAY_LEN(dp->waiters); x++) {
 					if (dp->waiters[x] > -1)
 						write(dp->waiters[x], "asdf", 4);
+				}
 			}
 		}
 		/* Our caller will obtain the rest */

Modified: team/seanbright/resolve-shadow-warnings/channels/chan_sip.c
URL: http://svn.digium.com/view/asterisk/team/seanbright/resolve-shadow-warnings/channels/chan_sip.c?view=diff&rev=129501&r1=129500&r2=129501
==============================================================================
--- team/seanbright/resolve-shadow-warnings/channels/chan_sip.c (original)
+++ team/seanbright/resolve-shadow-warnings/channels/chan_sip.c Wed Jul  9 18:43:51 2008
@@ -2630,7 +2630,7 @@
 		next = ast_skip_blanks(next);
 		if (sipdebug)
 			ast_debug(3, "Found SIP option: -%s-\n", next);
-		for (i=0; i < (sizeof(sip_options) / sizeof(sip_options[0])); i++) {
+		for (i = 0; i < ARRAY_LEN(sip_options); i++) {
 			if (!strcasecmp(next, sip_options[i].text)) {
 				profile |= sip_options[i].id;
 				found = TRUE;
@@ -4838,6 +4838,7 @@
 		case AST_CAUSE_NO_USER_RESPONSE:	/* 18 */
 			return "408 Request Timeout";
 		case AST_CAUSE_NO_ANSWER:		/* 19 */
+		case AST_CAUSE_UNREGISTERED:        /* 20 */
 			return "480 Temporarily unavailable";
 		case AST_CAUSE_CALL_REJECTED:		/* 21 */
 			return "403 Forbidden";
@@ -5705,9 +5706,10 @@
 	};
 	int x;
 
-	for (x=0; x<sizeof(aliases) / sizeof(aliases[0]); x++) 
+	for (x = 0; x < ARRAY_LEN(aliases); x++) {
 		if (!strcasecmp(aliases[x].fullname, name))
 			return aliases[x].shortname;
+	}
 
 	return _default;
 }
@@ -13104,7 +13106,7 @@
 		ast_cli(fd, "  SIP Options  : ");
 		if (peer->sipoptions) {
 			int lastoption = -1;
-			for (x=0 ; (x < (sizeof(sip_options) / sizeof(sip_options[0]))); x++) {
+			for (x = 0 ; x < ARRAY_LEN(sip_options); x++) {
 				if (sip_options[x].id != lastoption) {
 					if (peer->sipoptions & sip_options[x].id)
 						ast_cli(fd, "%s ", sip_options[x].text);
@@ -13965,7 +13967,7 @@
 			ast_cli(a->fd, "  SIP Options:            ");
 			if (cur->sipoptions) {
 				int x;
-				for (x=0 ; (x < (sizeof(sip_options) / sizeof(sip_options[0]))); x++) {
+				for (x = 0 ; x < ARRAY_LEN(sip_options); x++) {
 					if (cur->sipoptions & sip_options[x].id)
 						ast_cli(a->fd, "%s ", sip_options[x].text);
 				}

Modified: team/seanbright/resolve-shadow-warnings/channels/h323/ast_h323.cxx
URL: http://svn.digium.com/view/asterisk/team/seanbright/resolve-shadow-warnings/channels/h323/ast_h323.cxx?view=diff&rev=129501&r1=129500&r2=129501
==============================================================================
--- team/seanbright/resolve-shadow-warnings/channels/h323/ast_h323.cxx (original)
+++ team/seanbright/resolve-shadow-warnings/channels/h323/ast_h323.cxx Wed Jul  9 18:43:51 2008
@@ -970,7 +970,7 @@
 	Q931 tmpQ931;
 	Q931 &q931 = pdu.GetQ931();
 
-	for(unsigned i = 0; i < (sizeof(codes) / sizeof(codes[0])); ++i) {
+	for(unsigned i = 0; i < ARRAY_LEN(codes); ++i) {
 		if (q931.HasIE(codes[i].ie)) {
 			tmpQ931.SetIE(codes[i].ie, q931.GetIE(codes[i].ie));
 			if (!codes[i].dontDelete)
@@ -1104,7 +1104,7 @@
 	q931.Encode(message);
 
 	/* Remove non-standard IEs */
-	for(unsigned i = 0; i < (sizeof(codes) / sizeof(codes[0])); ++i) {
+	for(unsigned i = 0; i < ARRAY_LEN(codes); ++i) {
 		if (q931.HasIE(codes[i])) {
 			q931.RemoveIE(codes[i]);
 		}

Modified: team/seanbright/resolve-shadow-warnings/channels/iax2-provision.c
URL: http://svn.digium.com/view/asterisk/team/seanbright/resolve-shadow-warnings/channels/iax2-provision.c?view=diff&rev=129501&r1=129500&r2=129501
==============================================================================
--- team/seanbright/resolve-shadow-warnings/channels/iax2-provision.c (original)
+++ team/seanbright/resolve-shadow-warnings/channels/iax2-provision.c Wed Jul  9 18:43:51 2008
@@ -87,7 +87,7 @@
 	
 	buf[0] = '\0';
 
-	for (x = 0; x < sizeof(iax_flags) / sizeof(iax_flags[0]); x++) {
+	for (x = 0; x < ARRAY_LEN(iax_flags); x++) {
 		if (flags & iax_flags[x].value){
 			strncat(buf, iax_flags[x].name, buflen - strlen(buf) - 1);
 			strncat(buf, ",", buflen - strlen(buf) - 1);
@@ -116,7 +116,7 @@
 		else
 			len = 0;
 		found = 0;
-		for (x=0;x<sizeof(iax_flags) / sizeof(iax_flags[0]); x++) {
+		for (x = 0; x < ARRAY_LEN(iax_flags); x++) {
 			if ((len && !strncasecmp(iax_flags[x].name, buf, len)) ||
 			    (!len && !strcasecmp(iax_flags[x].name, buf))) {
 				flags |= iax_flags[x].value;

Modified: team/seanbright/resolve-shadow-warnings/include/asterisk/causes.h
URL: http://svn.digium.com/view/asterisk/team/seanbright/resolve-shadow-warnings/include/asterisk/causes.h?view=diff&rev=129501&r1=129500&r2=129501
==============================================================================
--- team/seanbright/resolve-shadow-warnings/include/asterisk/causes.h (original)
+++ team/seanbright/resolve-shadow-warnings/include/asterisk/causes.h Wed Jul  9 18:43:51 2008
@@ -99,6 +99,7 @@
 #define AST_CAUSE_USER_BUSY				17
 #define AST_CAUSE_NO_USER_RESPONSE			18
 #define AST_CAUSE_NO_ANSWER				19
+#define AST_CAUSE_SUBSCRIBER_ABSENT			20
 #define AST_CAUSE_CALL_REJECTED				21
 #define AST_CAUSE_NUMBER_CHANGED			22
 #define AST_CAUSE_DESTINATION_OUT_OF_ORDER		27
@@ -141,7 +142,7 @@
 #define AST_CAUSE_NORMAL 				AST_CAUSE_NORMAL_CLEARING
 #define AST_CAUSE_NOANSWER	 			AST_CAUSE_NO_ANSWER
 #define AST_CAUSE_CONGESTION	 			AST_CAUSE_NORMAL_CIRCUIT_CONGESTION
-#define AST_CAUSE_UNREGISTERED				AST_CAUSE_NO_ROUTE_DESTINATION
+#define AST_CAUSE_UNREGISTERED				AST_CAUSE_SUBSCRIBER_ABSENT
 #define AST_CAUSE_NOTDEFINED 				0
 #define AST_CAUSE_NOSUCHDRIVER				AST_CAUSE_CHAN_NOT_IMPLEMENTED
 /*@{ */

Modified: team/seanbright/resolve-shadow-warnings/include/asterisk/channel.h
URL: http://svn.digium.com/view/asterisk/team/seanbright/resolve-shadow-warnings/include/asterisk/channel.h?view=diff&rev=129501&r1=129500&r2=129501
==============================================================================
--- team/seanbright/resolve-shadow-warnings/include/asterisk/channel.h (original)
+++ team/seanbright/resolve-shadow-warnings/include/asterisk/channel.h Wed Jul  9 18:43:51 2008
@@ -582,12 +582,6 @@
 	/*! This flag indicates that on a masquerade, an active stream should not
 	 *  be carried over */
 	AST_FLAG_MASQ_NOSTREAM = (1 << 16),
-	/*! If the flag is controlled by AGI (not FastAGI) */
-	AST_FLAG_AGI =           (1 << 17),
-	/*! If the flag is controlled by FastAGI  */
-	AST_FLAG_FASTAGI =       (1 << 18),
-	/*! If the flag is controlled by AsyncAGI  */
-	AST_FLAG_ASYNCAGI =      (1 << 19),
 };
 
 /*! \brief ast_bridge_config flags */

Modified: team/seanbright/resolve-shadow-warnings/include/asterisk/pbx.h
URL: http://svn.digium.com/view/asterisk/team/seanbright/resolve-shadow-warnings/include/asterisk/pbx.h?view=diff&rev=129501&r1=129500&r2=129501
==============================================================================
--- team/seanbright/resolve-shadow-warnings/include/asterisk/pbx.h (original)
+++ team/seanbright/resolve-shadow-warnings/include/asterisk/pbx.h Wed Jul  9 18:43:51 2008
@@ -998,9 +998,6 @@
 									 const char *context, const char *exten, int priority,
 									 const char *label, const char *callerid, enum ext_match_t action);
 
-/*! \brief Function in pbx.c that propably should be somewhere else, but not in res_agi, since it's a loadable module */
-const char *ast_agi_state(struct ast_channel *chan);
-
 
 /* every time a write lock is obtained for contexts,
    a counter is incremented. You can check this via the

Modified: team/seanbright/resolve-shadow-warnings/main/acl.c
URL: http://svn.digium.com/view/asterisk/team/seanbright/resolve-shadow-warnings/main/acl.c?view=diff&rev=129501&r1=129500&r2=129501
==============================================================================
--- team/seanbright/resolve-shadow-warnings/main/acl.c (original)
+++ team/seanbright/resolve-shadow-warnings/main/acl.c Wed Jul  9 18:43:51 2008
@@ -434,7 +434,7 @@
 		return 0;
 	}
 
-	for (x = 0; x < sizeof(dscp_pool1) / sizeof(dscp_pool1[0]); x++) {
+	for (x = 0; x < ARRAY_LEN(dscp_pool1); x++) {
 		if (!strcasecmp(value, dscp_pool1[x].name)) {
 			*tos = dscp_pool1[x].space << 2;
 			return 0;
@@ -448,7 +448,7 @@
 {
 	unsigned int x;
 
-	for (x = 0; x < sizeof(dscp_pool1) / sizeof(dscp_pool1[0]); x++) {
+	for (x = 0; x < ARRAY_LEN(dscp_pool1); x++) {
 		if (dscp_pool1[x].space == (tos >> 2))
 			return dscp_pool1[x].name;
 	}

Modified: team/seanbright/resolve-shadow-warnings/main/asterisk.c
URL: http://svn.digium.com/view/asterisk/team/seanbright/resolve-shadow-warnings/main/asterisk.c?view=diff&rev=129501&r1=129500&r2=129501
==============================================================================
--- team/seanbright/resolve-shadow-warnings/main/asterisk.c (original)
+++ team/seanbright/resolve-shadow-warnings/main/asterisk.c Wed Jul  9 18:43:51 2008
@@ -1032,6 +1032,10 @@
 				break;
 			}
 			tmp[res] = 0;
+			if (strncmp(tmp, "cli quit after ", 15) == 0) {
+				ast_cli_command_multiple(con->fd, res - 15, tmp + 15);
+				break;
+			}
 			ast_cli_command_multiple(con->fd, res, tmp);
 		}
 		if (fds[1].revents) {
@@ -2432,15 +2436,18 @@
 	char *cpid;
 	char *version;
 	int pid;
-	char tmp[80];
 	char *stringp = NULL;
 
 	char *ebuf;
 	int num = 0;
 
 	read(ast_consock, buf, sizeof(buf));
-	if (data)
-		write(ast_consock, data, strlen(data) + 1);
+	if (data) {
+		char prefix[] = "cli quit after ";
+		char *tmp = alloca(strlen(data) + strlen(prefix) + 1);
+		sprintf(tmp, "%s%s", prefix, data);
+		write(ast_consock, tmp, strlen(tmp) + 1);
+	}
 	stringp = buf;
 	hostname = strsep(&stringp, "/");
 	cpid = strsep(&stringp, "/");
@@ -2454,6 +2461,7 @@
 	else
 		pid = -1;
 	if (!data) {
+		char tmp[80];
 		snprintf(tmp, sizeof(tmp), "core set verbose atleast %d", option_verbose);
 		fdsend(ast_consock, tmp);
 		snprintf(tmp, sizeof(tmp), "core set debug atleast %d", option_debug);

Modified: team/seanbright/resolve-shadow-warnings/main/callerid.c
URL: http://svn.digium.com/view/asterisk/team/seanbright/resolve-shadow-warnings/main/callerid.c?view=diff&rev=129501&r1=129500&r2=129501
==============================================================================
--- team/seanbright/resolve-shadow-warnings/main/callerid.c (original)
+++ team/seanbright/resolve-shadow-warnings/main/callerid.c Wed Jul  9 18:43:51 2008
@@ -1099,7 +1099,7 @@
 {
 	int i;
 
-	for (i = 0; i < ((sizeof(pres_types) / sizeof(pres_types[0]))); i++) {
+	for (i = 0; i < ARRAY_LEN(pres_types); i++) {
 		if (!strcasecmp(pres_types[i].name, data))
 			return pres_types[i].val;
 	}
@@ -1115,7 +1115,7 @@
 {
 	int i;
 
-	for (i = 0; i < ((sizeof(pres_types) / sizeof(pres_types[0]))); i++) {
+	for (i = 0; i < ARRAY_LEN(pres_types); i++) {
 		if (pres_types[i].val == data)
 			return pres_types[i].description;
 	}
@@ -1131,7 +1131,7 @@
 {
 	int i;
 
-	for (i = 0; i < ((sizeof(pres_types) / sizeof(pres_types[0]))); i++) {
+	for (i = 0; i < ARRAY_LEN(pres_types); i++) {
 		if (pres_types[i].val == data)
 			return pres_types[i].name;
 	}

Modified: team/seanbright/resolve-shadow-warnings/main/channel.c
URL: http://svn.digium.com/view/asterisk/team/seanbright/resolve-shadow-warnings/main/channel.c?view=diff&rev=129501&r1=129500&r2=129501
==============================================================================
--- team/seanbright/resolve-shadow-warnings/main/channel.c (original)
+++ team/seanbright/resolve-shadow-warnings/main/channel.c Wed Jul  9 18:43:51 2008
@@ -752,7 +752,7 @@
 	fmts &= AST_FORMAT_AUDIO_MASK;
 	
 	/* Find the first preferred codec in the format given */
-	for (x = 0; x < (sizeof(prefs) / sizeof(prefs[0]) ); x++) {
+	for (x = 0; x < ARRAY_LEN(prefs); x++) {
 		if (fmts & prefs[x])
 			return prefs[x];
 	}

Modified: team/seanbright/resolve-shadow-warnings/main/cli.c
URL: http://svn.digium.com/view/asterisk/team/seanbright/resolve-shadow-warnings/main/cli.c?view=diff&rev=129501&r1=129500&r2=129501
==============================================================================
--- team/seanbright/resolve-shadow-warnings/main/cli.c (original)
+++ team/seanbright/resolve-shadow-warnings/main/cli.c Wed Jul  9 18:43:51 2008
@@ -626,20 +626,6 @@
 	}
 
 	return RESULT_SUCCESS;
-}
-
-/*! \brief Add a marker before the app if the channel is controlled by AGI/FastAGI or AsyncAGI 
-	Used for "show channels"
-*/
-static const char *agi_flag(struct ast_channel *chan)
-{
-	if (ast_test_flag(chan, AST_FLAG_AGI))
-		return "[AGI]  ";
-	if (ast_test_flag(chan, AST_FLAG_FASTAGI))
-		return "[FAGI] ";
-	if (ast_test_flag(chan, AST_FLAG_ASYNCAGI))
-		return "[AAGI] ";
-	return "";
 }
 
 static char *handle_chanlist(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
@@ -737,7 +723,7 @@
 				if (!ast_strlen_zero(c->context) && !ast_strlen_zero(c->exten)) 
 					snprintf(locbuf, sizeof(locbuf), "%s@%s:%d", c->exten, c->context, c->priority);
 				if (c->appl)
-					snprintf(appdata, sizeof(appdata), "%s%s(%s)", agi_flag(c), c->appl, S_OR(c->data, ""));
+					snprintf(appdata, sizeof(appdata), "%s(%s)", c->appl, S_OR(c->data, ""));
 				ast_cli(fd, FORMAT_STRING, c->name, locbuf, ast_state2str(c->_state), appdata);
 			}
 		}

Modified: team/seanbright/resolve-shadow-warnings/main/dns.c
URL: http://svn.digium.com/view/asterisk/team/seanbright/resolve-shadow-warnings/main/dns.c?view=diff&rev=129501&r1=129500&r2=129501
==============================================================================
--- team/seanbright/resolve-shadow-warnings/main/dns.c (original)
+++ team/seanbright/resolve-shadow-warnings/main/dns.c Wed Jul  9 18:43:51 2008
@@ -189,6 +189,7 @@
 	unsigned char *fullanswer = answer;
 	struct dn_answer *ans;
 	dns_HEADER *h;
+	int ret = 0;
 	int res;
 	int x;
 
@@ -234,14 +235,13 @@
 					ast_log(LOG_WARNING, "Failed to parse result\n");
 					return -1;
 				}
-				if (res > 0)
-					return 1;
+				ret = 1;
 			}
 		}
 		answer += ntohs(ans->size);
 		len -= ntohs(ans->size);
 	}
-	return 0;
+	return ret;
 }
 
 #ifndef HAVE_RES_NINIT

Modified: team/seanbright/resolve-shadow-warnings/main/dnsmgr.c
URL: http://svn.digium.com/view/asterisk/team/seanbright/resolve-shadow-warnings/main/dnsmgr.c?view=diff&rev=129501&r1=129500&r2=129501
==============================================================================
--- team/seanbright/resolve-shadow-warnings/main/dnsmgr.c (original)
+++ team/seanbright/resolve-shadow-warnings/main/dnsmgr.c Wed Jul  9 18:43:51 2008
@@ -164,8 +164,7 @@
 	if (verbose)
 		ast_verb(3, "refreshing '%s'\n", entry->name);
 
-	ast_get_ip_or_srv(&tmp, entry->name, entry->service);
-	if (inaddrcmp(&tmp, &entry->last)) {
+	if (!ast_get_ip_or_srv(&tmp, entry->name, entry->service) && inaddrcmp(&tmp, &entry->last)) {
 		ast_copy_string(iabuf, ast_inet_ntoa(entry->last.sin_addr), sizeof(iabuf));
 		ast_copy_string(iabuf2, ast_inet_ntoa(tmp.sin_addr), sizeof(iabuf2));
 		ast_log(LOG_NOTICE, "dnssrv: host '%s' changed from %s:%d to %s:%d\n", 

Modified: team/seanbright/resolve-shadow-warnings/main/editline/Makefile.in
URL: http://svn.digium.com/view/asterisk/team/seanbright/resolve-shadow-warnings/main/editline/Makefile.in?view=diff&rev=129501&r1=129500&r2=129501
==============================================================================
--- team/seanbright/resolve-shadow-warnings/main/editline/Makefile.in (original)
+++ team/seanbright/resolve-shadow-warnings/main/editline/Makefile.in Wed Jul  9 18:43:51 2008
@@ -180,7 +180,7 @@
 	rm -f *.s *.i
 
 distclean : clean
-	rm -f config.cache config.log config.status config.h Makefile
+	rm -f config.cache config.log config.status config.h makelist Makefile
 
 #
 # Internal targets and rules.

Modified: team/seanbright/resolve-shadow-warnings/main/editline/configure.in
URL: http://svn.digium.com/view/asterisk/team/seanbright/resolve-shadow-warnings/main/editline/configure.in?view=diff&rev=129501&r1=129500&r2=129501
==============================================================================
--- team/seanbright/resolve-shadow-warnings/main/editline/configure.in (original)
+++ team/seanbright/resolve-shadow-warnings/main/editline/configure.in Wed Jul  9 18:43:51 2008
@@ -18,6 +18,7 @@
 S_CFLAGS="-fPIC -DPIC"
 AC_SUBST(S_CFLAGS)
 AC_PROG_CPP
+AC_PROG_AWK
 
 dnl Platform-specific settings.  The ABI can probably be determined
 dnl programmatically, but doing so is error-prone, which makes it generally
@@ -271,4 +272,5 @@
 AC_SUBST(TCSRCS)
 
 AC_CONFIG_HEADER(config.h)
-AC_OUTPUT(Makefile)
+AC_OUTPUT([Makefile makelist])
+

Modified: team/seanbright/resolve-shadow-warnings/main/frame.c
URL: http://svn.digium.com/view/asterisk/team/seanbright/resolve-shadow-warnings/main/frame.c?view=diff&rev=129501&r1=129500&r2=129501
==============================================================================
--- team/seanbright/resolve-shadow-warnings/main/frame.c (original)
+++ team/seanbright/resolve-shadow-warnings/main/frame.c Wed Jul  9 18:43:51 2008
@@ -503,7 +503,7 @@
 
 struct ast_format_list *ast_get_format_list(size_t *size) 
 {
-	*size = (sizeof(AST_FORMAT_LIST) / sizeof(AST_FORMAT_LIST[0]));
+	*size = ARRAY_LEN(AST_FORMAT_LIST);
 	return AST_FORMAT_LIST;
 }
 
@@ -511,7 +511,7 @@
 {
 	int x;
 	char *ret = "unknown";
-	for (x = 0; x < sizeof(AST_FORMAT_LIST) / sizeof(AST_FORMAT_LIST[0]); x++) {
+	for (x = 0; x < ARRAY_LEN(AST_FORMAT_LIST); x++) {
 		if (AST_FORMAT_LIST[x].bits == format) {
 			ret = AST_FORMAT_LIST[x].name;
 			break;
@@ -533,7 +533,7 @@
 	end += len;
 	size -= len;
 	start = end;
-	for (x = 0; x < sizeof(AST_FORMAT_LIST) / sizeof(AST_FORMAT_LIST[0]); x++) {
+	for (x = 0; x < ARRAY_LEN(AST_FORMAT_LIST); x++) {
 		if (AST_FORMAT_LIST[x].bits & format) {
 			snprintf(end, size,"%s|",AST_FORMAT_LIST[x].name);
 			len = strlen(end);
@@ -561,7 +561,7 @@
 {
 	int x;
 
-	for (x = 0; x < sizeof(ast_codec_alias_table) / sizeof(ast_codec_alias_table[0]); x++) {
+	for (x = 0; x < ARRAY_LEN(ast_codec_alias_table); x++) {
 		if (!strcmp(in,ast_codec_alias_table[x].alias))
 			return ast_codec_alias_table[x].realname;
 	}
@@ -573,7 +573,7 @@
 	int x, all, format = 0;
 
 	all = strcasecmp(name, "all") ? 0 : 1;
-	for (x = 0; x < sizeof(AST_FORMAT_LIST) / sizeof(AST_FORMAT_LIST[0]); x++) {
+	for (x = 0; x < ARRAY_LEN(AST_FORMAT_LIST); x++) {
 		if (all || 
 			  !strcasecmp(AST_FORMAT_LIST[x].name,name) ||
 			  !strcasecmp(AST_FORMAT_LIST[x].name, ast_expand_codec_alias(name))) {
@@ -590,7 +590,7 @@
 {
 	int x;
 	char *ret = "unknown";
-	for (x = 0; x < sizeof(AST_FORMAT_LIST) / sizeof(AST_FORMAT_LIST[0]); x++) {
+	for (x = 0; x < ARRAY_LEN(AST_FORMAT_LIST); x++) {
 		if (AST_FORMAT_LIST[x].bits == codec) {
 			ret = AST_FORMAT_LIST[x].desc;
 			break;
@@ -1022,7 +1022,7 @@
 	memcpy(&oldorder, pref, sizeof(oldorder));
 	memset(pref, 0, sizeof(*pref));
 
-	for (x = 0; x < sizeof(AST_FORMAT_LIST) / sizeof(AST_FORMAT_LIST[0]); x++) {
+	for (x = 0; x < ARRAY_LEN(AST_FORMAT_LIST); x++) {
 		slot = oldorder.order[x];
 		size = oldorder.framing[x];
 		if (! slot)
@@ -1042,7 +1042,7 @@
 
 	ast_codec_pref_remove(pref, format);
 
-	for (x = 0; x < sizeof(AST_FORMAT_LIST) / sizeof(AST_FORMAT_LIST[0]); x++) {
+	for (x = 0; x < ARRAY_LEN(AST_FORMAT_LIST); x++) {
 		if (AST_FORMAT_LIST[x].bits == format) {
 			newindex = x + 1;
 			break;
@@ -1050,7 +1050,7 @@
 	}
 
 	if (newindex) {
-		for (x = 0; x < sizeof(AST_FORMAT_LIST) / sizeof(AST_FORMAT_LIST[0]); x++) {
+		for (x = 0; x < ARRAY_LEN(AST_FORMAT_LIST); x++) {
 			if (!pref->order[x]) {
 				pref->order[x] = newindex;
 				break;
@@ -1103,7 +1103,7 @@
 {
 	int x, idx = -1;
 
-	for (x = 0; x < sizeof(AST_FORMAT_LIST) / sizeof(AST_FORMAT_LIST[0]); x++) {
+	for (x = 0; x < ARRAY_LEN(AST_FORMAT_LIST); x++) {
 		if (AST_FORMAT_LIST[x].bits == format) {
 			idx = x;
 			break;
@@ -1127,7 +1127,7 @@
 		framems = AST_FORMAT_LIST[idx].max_ms;
 
 
-	for (x = 0; x < sizeof(AST_FORMAT_LIST) / sizeof(AST_FORMAT_LIST[0]); x++) {

[... 401 lines stripped ...]



More information about the svn-commits mailing list