[asterisk-commits] seanbright: branch seanbright/resolve-shadow-warnings r114302 - /team/seanbri...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Sat Apr 19 11:29:24 CDT 2008


Author: seanbright
Date: Sat Apr 19 11:29:24 2008
New Revision: 114302

URL: http://svn.digium.com/view/asterisk?view=rev&rev=114302
Log:
More channels.  This could be the most masochistic thing I've ever done.

Modified:
    team/seanbright/resolve-shadow-warnings/channels/chan_iax2.c
    team/seanbright/resolve-shadow-warnings/channels/chan_mgcp.c
    team/seanbright/resolve-shadow-warnings/channels/chan_phone.c
    team/seanbright/resolve-shadow-warnings/channels/iax2-parser.c

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=114302&r1=114301&r2=114302
==============================================================================
--- team/seanbright/resolve-shadow-warnings/channels/chan_iax2.c (original)
+++ team/seanbright/resolve-shadow-warnings/channels/chan_iax2.c Sat Apr 19 11:29:24 2008
@@ -138,8 +138,7 @@
 static int global_max_trunk_mtu; 	/*!< Maximum MTU, 0 if not used */
 static int trunk_timed, trunk_untimed, trunk_maxmtu, trunk_nmaxmtu ; 	/*!< Trunk MTU statistics */
 
-
-static char context[80] = "default";
+#define DEFAULT_CONTEXT "default"
 
 static char language[MAX_LANGUAGE] = "";
 static char regcontext[AST_MAX_CONTEXT] = "";
@@ -168,9 +167,10 @@
 
 static int iaxdefaulttimeout = 5;		/* Default to wait no more than 5 seconds for a reply to come back */
 
-static unsigned int tos = 0;
-
-static unsigned int cos = 0;
+static struct {
+	unsigned int tos;
+	unsigned int cos;
+} qos = { 0, 0 };
 
 static int min_reg_expire;
 static int max_reg_expire;
@@ -2592,7 +2592,7 @@
 	struct iax2_dpcache *dp = NULL;
 	char tmp[1024], *pc = NULL;
 	int s, x, y;
-	struct timeval tv = ast_tvnow();
+	struct timeval now = ast_tvnow();
 
 	switch (cmd) {
 	case CLI_INIT:
@@ -2610,7 +2610,7 @@
 	ast_cli(a->fd, "%-20.20s %-12.12s %-9.9s %-8.8s %s\n", "Peer/Context", "Exten", "Exp.", "Wait.", "Flags");
 
 	AST_LIST_TRAVERSE(&dpcache, dp, cache_list) {
-		s = dp->expiry.tv_sec - tv.tv_sec;
+		s = dp->expiry.tv_sec - now.tv_sec;
 		tmp[0] = '\0';
 		if (dp->flags & CACHE_FLAG_EXISTS)
 			strncat(tmp, "EXISTS|", sizeof(tmp) - strlen(tmp) - 1);
@@ -2708,9 +2708,9 @@
 	struct iax_frame *fr;
 	jb_frame frame;
 	int ret;
-	long now;
+	long ms;
 	long next;
-	struct timeval tv = ast_tvnow();
+	struct timeval now = ast_tvnow();
 	
 	/* Make sure we have a valid private structure before going on */
 	ast_mutex_lock(&iaxsl[callno]);
@@ -2726,12 +2726,12 @@
 	/* round up a millisecond since ast_sched_runq does; */
 	/* prevents us from spinning while waiting for our now */
 	/* to catch up with runq's now */
-	tv.tv_usec += 1000;
+	now.tv_usec += 1000;
 	
-	now = ast_tvdiff_ms(tv, pvt->rxcore);
+	ms = ast_tvdiff_ms(now, pvt->rxcore);
 	
-	if(now >= (next = jb_next(pvt->jb))) {
-		ret = jb_get(pvt->jb,&frame,now,ast_codec_interp_len(pvt->voiceformat));
+	if(ms >= (next = jb_next(pvt->jb))) {
+		ret = jb_get(pvt->jb,&frame,ms,ast_codec_interp_len(pvt->voiceformat));
 		switch(ret) {
 		case JB_OK:
 			fr = frame.data;
@@ -3659,7 +3659,7 @@
 	struct ast_frame *f;
 	unsigned short callno0 = PTR_TO_CALLNO(c0->tech_pvt);
 	unsigned short callno1 = PTR_TO_CALLNO(c1->tech_pvt);
-	struct timeval waittimer = {0, 0}, tv;
+	struct timeval waittimer = {0, 0};
 
 	/* We currently do not support native bridging if a timeoutms value has been provided */
 	if (timeoutms)
@@ -3722,10 +3722,10 @@
 		}
 		if ((iaxs[callno0]->transferring == TRANSFER_RELEASED) && (iaxs[callno1]->transferring == TRANSFER_RELEASED)) {
 			/* Call has been transferred.  We're no longer involved */
-			tv = ast_tvnow();
+			struct timeval now = ast_tvnow();
 			if (ast_tvzero(waittimer)) {
-				waittimer = tv;
-			} else if (tv.tv_sec - waittimer.tv_sec > IAX_LINGER_TIMEOUT) {
+				waittimer = now;
+			} else if (now.tv_sec - waittimer.tv_sec > IAX_LINGER_TIMEOUT) {
 				c0->_softhangup |= AST_SOFTHANGUP_DEV;
 				c1->_softhangup |= AST_SOFTHANGUP_DEV;
 				*fo = NULL;
@@ -3961,23 +3961,23 @@
 	return tmp;
 }
 
-static unsigned int calc_txpeerstamp(struct iax2_trunk_peer *tpeer, int sampms, struct timeval *tv)
+static unsigned int calc_txpeerstamp(struct iax2_trunk_peer *tpeer, int sampms, struct timeval *now)
 {
 	unsigned long int mssincetx; /* unsigned to handle overflows */
 	long int ms, pred;
 
-	tpeer->trunkact = *tv;
-	mssincetx = ast_tvdiff_ms(*tv, tpeer->lasttxtime);
+	tpeer->trunkact = *now;
+	mssincetx = ast_tvdiff_ms(*now, tpeer->lasttxtime);
 	if (mssincetx > 5000 || ast_tvzero(tpeer->txtrunktime)) {
 		/* If it's been at least 5 seconds since the last time we transmitted on this trunk, reset our timers */
-		tpeer->txtrunktime = *tv;
+		tpeer->txtrunktime = *now;
 		tpeer->lastsent = 999999;
 	}
 	/* Update last transmit time now */
-	tpeer->lasttxtime = *tv;
+	tpeer->lasttxtime = *now;
 	
 	/* Calculate ms offset */
-	ms = ast_tvdiff_ms(*tv, tpeer->txtrunktime);
+	ms = ast_tvdiff_ms(*now, tpeer->txtrunktime);
 	/* Predict from last value */
 	pred = tpeer->lastsent + sampms;
 	if (abs(ms - pred) < MAX_TIMESTAMP_SKEW)
@@ -3990,7 +3990,7 @@
 	return ms;
 }
 
-static unsigned int fix_peerts(struct timeval *tv, int callno, unsigned int ts)
+static unsigned int fix_peerts(struct timeval *rxtrunktime, int callno, unsigned int ts)
 {
 	long ms;	/* NOT unsigned */
 	if (ast_tvzero(iaxs[callno]->rxcore)) {
@@ -4000,7 +4000,7 @@
 		iaxs[callno]->rxcore.tv_usec -= iaxs[callno]->rxcore.tv_usec % 20000;
 	}
 	/* Calculate difference between trunk and channel */
-	ms = ast_tvdiff_ms(*tv, iaxs[callno]->rxcore);
+	ms = ast_tvdiff_ms(*rxtrunktime, iaxs[callno]->rxcore);
 	/* Return as the sum of trunk time and the difference between trunk and real time */
 	return ms + ts;
 }
@@ -4694,7 +4694,7 @@
 			pstr = ast_test_flag(user,IAX_CODEC_USER_FIRST) ? "Caller" : "Host";
 		
 		ast_cli(a->fd, FORMAT2, user->name, auth, user->authmethods, 
-			user->contexts ? user->contexts->context : context,
+			user->contexts ? user->contexts->context : DEFAULT_CONTEXT,
 			user->ha ? "Yes" : "No", pstr);
 	}
 
@@ -5712,7 +5712,7 @@
 			if (user->contexts)
 				ast_string_field_set(iaxs[callno], context, user->contexts->context);
 			else
-				ast_string_field_set(iaxs[callno], context, context);
+				ast_string_field_set(iaxs[callno], context, DEFAULT_CONTEXT);
 		}
 		/* And any input keys */
 		ast_string_field_set(iaxs[callno], inkeys, user->inkeys);
@@ -8156,10 +8156,10 @@
 					ast_set_flag(iaxs[fr->callno], IAX_QUELCH);
 					if (ies.musiconhold) {
 						if (iaxs[fr->callno]->owner && ast_bridged_channel(iaxs[fr->callno]->owner)) {
-							const char *mohsuggest = iaxs[fr->callno]->mohsuggest;
+							const char *moh_suggest = iaxs[fr->callno]->mohsuggest;
 							iax2_queue_control_data(fr->callno, AST_CONTROL_HOLD, 
-								S_OR(mohsuggest, NULL),
-								!ast_strlen_zero(mohsuggest) ? strlen(mohsuggest) + 1 : 0);
+								S_OR(moh_suggest, NULL),
+								!ast_strlen_zero(moh_suggest) ? strlen(moh_suggest) + 1 : 0);
 							if (!iaxs[fr->callno]) {
 								ast_mutex_unlock(&iaxsl[fr->callno]);
 								return 1;
@@ -9252,7 +9252,7 @@
 static void *iax2_process_thread(void *data)
 {
 	struct iax2_thread *thread = data;
-	struct timeval tv;
+	struct timeval wait;
 	struct timespec ts;
 	int put_into_idle = 0;
 
@@ -9272,9 +9272,9 @@
 		if (thread->type == IAX_THREAD_TYPE_DYNAMIC) {
 			struct iax2_thread *t = NULL;
 			/* Wait to be signalled or time out */
-			tv = ast_tvadd(ast_tvnow(), ast_samp2tv(30000, 1000));
-			ts.tv_sec = tv.tv_sec;
-			ts.tv_nsec = tv.tv_usec * 1000;
+			wait = ast_tvadd(ast_tvnow(), ast_samp2tv(30000, 1000));
+			ts.tv_sec = wait.tv_sec;
+			ts.tv_nsec = wait.tv_usec * 1000;
 			if (ast_cond_timedwait(&thread->cond, &thread->lock, &ts) == ETIMEDOUT) {
 				/* This thread was never put back into the available dynamic
 				 * thread list, so just go away. */
@@ -9742,16 +9742,16 @@
 {
 	int count;
 	int res;
-	struct timeval tv;
+	struct timeval wait;
 	struct timespec ts;
 
 	for (;;) {
 		res = ast_sched_wait(sched);
 		if ((res > 1000) || (res < 0))
 			res = 1000;
-		tv = ast_tvadd(ast_tvnow(), ast_samp2tv(res, 1000));
-		ts.tv_sec = tv.tv_sec;
-		ts.tv_nsec = tv.tv_usec * 1000;
+		wait = ast_tvadd(ast_tvnow(), ast_samp2tv(res, 1000));
+		ts.tv_sec = wait.tv_sec;
+		ts.tv_nsec = wait.tv_usec * 1000;
 
 		pthread_testcancel();
 		ast_mutex_lock(&sched_lock);
@@ -9954,7 +9954,7 @@
 				sin.sin_addr.s_addr = INADDR_ANY;
 				if (ast_netsock_find(netsock, &sin)) {
 					sin.sin_addr.s_addr = orig_saddr;
-					sock = ast_netsock_bind(outsock, io, srcaddr, port, tos, cos, socket_read, NULL);
+					sock = ast_netsock_bind(outsock, io, srcaddr, port, qos.tos, qos.cos, socket_read, NULL);
 					if (sock) {
 						sockfd = ast_netsock_sockfd(sock);
 						ast_netsock_unref(sock);
@@ -10635,13 +10635,13 @@
 	/* Seed initial tos value */
 	tosval = ast_variable_retrieve(cfg, "general", "tos");
 	if (tosval) {
-		if (ast_str2tos(tosval, &tos))
+		if (ast_str2tos(tosval, &qos.tos))
 			ast_log(LOG_WARNING, "Invalid tos value, refer to QoS documentation\n");
 	}
 	/* Seed initial cos value */
 	tosval = ast_variable_retrieve(cfg, "general", "cos");
 	if (tosval) {
-		if (ast_str2cos(tosval, &cos))
+		if (ast_str2cos(tosval, &qos.cos))
 			ast_log(LOG_WARNING, "Invalid cos value, refer to QoS documentation\n");
 	}
 	while(v) {
@@ -10710,7 +10710,7 @@
 			if (reload) {
 				ast_log(LOG_NOTICE, "Ignoring bindaddr on reload\n");
 			} else {
-				if (!(ns = ast_netsock_bind(netsock, io, v->value, portno, tos, cos, socket_read, NULL))) {
+				if (!(ns = ast_netsock_bind(netsock, io, v->value, portno, qos.tos, qos.cos, socket_read, NULL))) {
 					ast_log(LOG_WARNING, "Unable apply binding to '%s' at line %d\n", v->value, v->lineno);
 				} else {
 						if (strchr(v->value, ':'))
@@ -10813,10 +10813,10 @@
 			/* Create context if it doesn't exist already */
 			ast_context_find_or_create(NULL, NULL, regcontext, "IAX2");
 		} else if (!strcasecmp(v->name, "tos")) {
-			if (ast_str2tos(v->value, &tos))
+			if (ast_str2tos(v->value, &qos.tos))
 				ast_log(LOG_WARNING, "Invalid tos value at line %d, refer to QoS documentation\n", v->lineno);
 		} else if (!strcasecmp(v->name, "cos")) {
-			if (ast_str2cos(v->value, &cos))
+			if (ast_str2cos(v->value, &qos.cos))
 				ast_log(LOG_WARNING, "Invalid cos value at line %d, refer to QoS documentation\n", v->lineno);
 		} else if (!strcasecmp(v->name, "accountcode")) {
 			ast_copy_string(accountcode, v->value, sizeof(accountcode));
@@ -10847,7 +10847,7 @@
 	}
 	
 	if (defaultsockfd < 0) {
-		if (!(ns = ast_netsock_bind(netsock, io, "0.0.0.0", portno, tos, cos, socket_read, NULL))) {
+		if (!(ns = ast_netsock_bind(netsock, io, "0.0.0.0", portno, qos.tos, qos.cos, socket_read, NULL))) {
 			ast_log(LOG_ERROR, "Unable to create network socket: %s\n", strerror(errno));
 		} else {
 			ast_verb(2, "Binding IAX2 to default address 0.0.0.0:%d\n", portno);
@@ -11094,13 +11094,13 @@
 static struct iax2_dpcache *find_cache(struct ast_channel *chan, const char *data, const char *context, const char *exten, int priority)
 {
 	struct iax2_dpcache *dp = NULL;
-	struct timeval tv = ast_tvnow();
-	int x, com[2], timeout, old = 0, outfd, abort, callno;
+	struct timeval now = ast_tvnow();
+	int x, com[2], timeout, old = 0, outfd, doabort, callno;
 	struct ast_channel *c = NULL;
 	struct ast_frame *f = NULL;
 
 	AST_LIST_TRAVERSE_SAFE_BEGIN(&dpcache, dp, cache_list) {
-		if (ast_tvcmp(tv, dp->expiry) > 0) {
+		if (ast_tvcmp(now, dp->expiry) > 0) {
 			AST_LIST_REMOVE_CURRENT(cache_list);
 			if ((dp->flags & CACHE_FLAG_PENDING) || dp->callno)
 				ast_log(LOG_WARNING, "DP still has peer field or pending or callno (flags = %d, peer = blah, callno = %d)\n", dp->flags, dp->callno);
@@ -11167,7 +11167,7 @@
 		/* Defer any dtmf */
 		if (chan)
 			old = ast_channel_defer_dtmf(chan);
-		abort = 0;
+		doabort = 0;
 		while(timeout) {
 			c = ast_waitfor_nandfds(&chan, chan ? 1 : 0, &com[0], 1, NULL, &outfd, &timeout);
 			if (outfd > -1)
@@ -11175,7 +11175,7 @@
 			if (!c)
 				continue;
 			if (!(f = ast_read(c))) {
-				abort = 1;
+				doabort = 1;
 				break;
 			}
 			ast_frfree(f);
@@ -11187,7 +11187,7 @@
 		dp->waiters[x] = -1;
 		close(com[1]);
 		close(com[0]);
-		if (abort) {
+		if (doabort) {
 			/* Don't interpret anything, just abort.  Not sure what th epoint
 			  of undeferring dtmf on a hung up channel is but hey whatever */
 			if (!old && chan)
@@ -11384,7 +11384,7 @@
 		ast_getformatname_multiple(buf, len -1, peer->capability);
 	} else  if (!strncasecmp(colname, "codec[", 6)) {
 		char *codecnum, *ptr;
-		int index = 0, codec = 0;
+		int codec = 0;
 		
 		codecnum = strchr(colname, '[');
 		*codecnum = '\0';
@@ -11392,8 +11392,7 @@
 		if ((ptr = strchr(codecnum, ']'))) {
 			*ptr = '\0';
 		}
-		index = atoi(codecnum);
-		if((codec = ast_codec_pref_index(&peer->prefs, index))) {
+		if((codec = ast_codec_pref_index(&peer->prefs, atoi(codecnum)))) {
 			ast_copy_string(buf, ast_getformatname(codec), len);
 		}
 	}

Modified: team/seanbright/resolve-shadow-warnings/channels/chan_mgcp.c
URL: http://svn.digium.com/view/asterisk/team/seanbright/resolve-shadow-warnings/channels/chan_mgcp.c?view=diff&rev=114302&r1=114301&r2=114302
==============================================================================
--- team/seanbright/resolve-shadow-warnings/channels/chan_mgcp.c (original)
+++ team/seanbright/resolve-shadow-warnings/channels/chan_mgcp.c Sat Apr 19 11:29:24 2008
@@ -152,10 +152,12 @@
 static ast_group_t cur_callergroup = 0;
 static ast_group_t cur_pickupgroup = 0;
 
-static unsigned int tos = 0;
-static unsigned int tos_audio = 0;
-static unsigned int cos = 0;
-static unsigned int cos_audio = 0;
+static struct {
+	unsigned int tos;
+	unsigned int tos_audio;
+	unsigned int cos;
+	unsigned int cos_audio;
+} qos = { 0, 0, 0, 0 };
 
 static int immediate = 0;
 
@@ -458,16 +460,16 @@
 {
 	int new_msgs;
 	struct ast_event *event;
-	char *mailbox, *context;
-
-	context = mailbox = ast_strdupa(p->mailbox);
-	strsep(&context, "@");
-	if (ast_strlen_zero(context))
-		context = "default";
+	char *mbox, *cntx;
+
+	cntx = mbox = ast_strdupa(p->mailbox);
+	strsep(&cntx, "@");
+	if (ast_strlen_zero(cntx))
+		cntx = "default";
 
 	event = ast_event_get_cached(AST_EVENT_MWI,
-		AST_EVENT_IE_MAILBOX, AST_EVENT_IE_PLTYPE_STR, mailbox,
-		AST_EVENT_IE_CONTEXT, AST_EVENT_IE_PLTYPE_STR, context,
+		AST_EVENT_IE_MAILBOX, AST_EVENT_IE_PLTYPE_STR, mbox,
+		AST_EVENT_IE_CONTEXT, AST_EVENT_IE_PLTYPE_STR, cntx,
 		AST_EVENT_IE_NEWMSGS, AST_EVENT_IE_PLTYPE_EXISTS,
 		AST_EVENT_IE_END);
 
@@ -696,7 +698,7 @@
 	struct mgcp_message *msg;
 	struct mgcp_message *cur;
 	struct mgcp_gateway *gw;
- 	struct timeval tv;
+ 	struct timeval now;
 
 	msg = ast_malloc(sizeof(*msg) + len);
 	if (!msg) {
@@ -733,8 +735,8 @@
 		gw->msgs = msg;
 	}
 
-	tv = ast_tvnow();
-	msg->expire = tv.tv_sec * 1000 + tv.tv_usec / 1000 + DEFAULT_RETRANS;
+	now = ast_tvnow();
+	msg->expire = now.tv_sec * 1000 + now.tv_usec / 1000 + DEFAULT_RETRANS;
 
 	if (gw->retransid == -1)
 		gw->retransid = ast_sched_add(sched, DEFAULT_RETRANS, retrans_pkt, (void *)gw);
@@ -2169,12 +2171,15 @@
 	char local[256];
 	char tmp[80];
 	int x;
-	int capability;
+	/* int capability; */
 	struct mgcp_endpoint *p = sub->parent;
 
+	/* XXX SHADOW - This value isn't used in this function anymore, should this
+	   be setting the global capability?
 	capability = p->capability;
 	if (codecs)
 		capability = codecs;
+	*/
 	if (ast_strlen_zero(sub->cxident) && rtp) {
 		/* We don't have a CXident yet, store the destination and
 		   wait a bit */
@@ -2650,7 +2655,7 @@
 	if (sub->rtp && sub->owner)
 		ast_channel_set_fd(sub->owner, 0, ast_rtp_fd(sub->rtp));
 	if (sub->rtp) {
-		ast_rtp_setqos(sub->rtp, tos_audio, cos_audio, "MGCP RTP");
+		ast_rtp_setqos(sub->rtp, qos.tos_audio, qos.cos_audio, "MGCP RTP");
 		ast_rtp_setnat(sub->rtp, sub->nat);
 	}
 #if 0
@@ -3749,14 +3754,14 @@
 					ast_copy_string(e->musicclass, musicclass, sizeof(e->musicclass));
 					ast_copy_string(e->mailbox, mailbox, sizeof(e->mailbox));
 					if (!ast_strlen_zero(e->mailbox)) {
-						char *mailbox, *context;
-						context = mailbox = ast_strdupa(e->mailbox);
-						strsep(&context, "@");
-						if (ast_strlen_zero(context))
-							context = "default";
+						char *mbox, *cntx;
+						cntx = mbox = ast_strdupa(e->mailbox);
+						strsep(&cntx, "@");
+						if (ast_strlen_zero(cntx))
+							cntx = "default";
 						e->mwi_event_sub = ast_event_subscribe(AST_EVENT_MWI, mwi_event_cb, NULL,
-							AST_EVENT_IE_MAILBOX, AST_EVENT_IE_PLTYPE_STR, mailbox,
-							AST_EVENT_IE_CONTEXT, AST_EVENT_IE_PLTYPE_STR, context,
+							AST_EVENT_IE_MAILBOX, AST_EVENT_IE_PLTYPE_STR, mbox,
+							AST_EVENT_IE_CONTEXT, AST_EVENT_IE_PLTYPE_STR, cntx,
 							AST_EVENT_IE_NEWMSGS, AST_EVENT_IE_PLTYPE_EXISTS,
 							AST_EVENT_IE_END);
 					}
@@ -4153,16 +4158,16 @@
 			else
 				capability &= ~format;
 		} else if (!strcasecmp(v->name, "tos")) {
-			if (ast_str2tos(v->value, &tos))
+			if (ast_str2tos(v->value, &qos.tos))
 			    ast_log(LOG_WARNING, "Invalid tos value at line %d, refer to QoS documentation\n", v->lineno);
 		} else if (!strcasecmp(v->name, "tos_audio")) {
-			if (ast_str2tos(v->value, &tos_audio))
+			if (ast_str2tos(v->value, &qos.tos_audio))
 			    ast_log(LOG_WARNING, "Invalid tos_audio value at line %d, refer to QoS documentation\n", v->lineno);
 		} else if (!strcasecmp(v->name, "cos")) {				
-			if (ast_str2cos(v->value, &cos))
+			if (ast_str2cos(v->value, &qos.cos))
 			    ast_log(LOG_WARNING, "Invalid cos value at line %d, refer to QoS documentation\n", v->lineno);
 		} else if (!strcasecmp(v->name, "cos_audio")) {				
-			if (ast_str2cos(v->value, &cos_audio))
+			if (ast_str2cos(v->value, &qos.cos_audio))
 			    ast_log(LOG_WARNING, "Invalid cos_audio value at line %d, refer to QoS documentation\n", v->lineno);
 		} else if (!strcasecmp(v->name, "port")) {
 			if (sscanf(v->value, "%d", &ourport) == 1) {
@@ -4247,7 +4252,7 @@
 		} else {
 			ast_verb(2, "MGCP Listening on %s:%d\n",
 					ast_inet_ntoa(bindaddr.sin_addr), ntohs(bindaddr.sin_port));
-			ast_netsock_set_qos(mgcpsock, tos, cos, "MGCP");
+			ast_netsock_set_qos(mgcpsock, qos.tos, qos.cos, "MGCP");
 		}
 	}
 	ast_mutex_unlock(&netlock);

Modified: team/seanbright/resolve-shadow-warnings/channels/chan_phone.c
URL: http://svn.digium.com/view/asterisk/team/seanbright/resolve-shadow-warnings/channels/chan_phone.c?view=diff&rev=114302&r1=114301&r2=114302
==============================================================================
--- team/seanbright/resolve-shadow-warnings/channels/chan_phone.c (original)
+++ team/seanbright/resolve-shadow-warnings/channels/chan_phone.c Sat Apr 19 11:29:24 2008
@@ -844,18 +844,18 @@
 	return 0;
 }
 
-static struct ast_channel *phone_new(struct phone_pvt *i, int state, char *context)
+static struct ast_channel *phone_new(struct phone_pvt *i, int state, char *cntx)
 {
 	struct ast_channel *tmp;
-	struct phone_codec_data codec;
+	struct phone_codec_data new_codec;
 	tmp = ast_channel_alloc(1, state, i->cid_num, i->cid_name, "", i->ext, i->context, 0, "Phone/%s", i->dev + 5);
 	if (tmp) {
 		tmp->tech = cur_tech;
 		ast_channel_set_fd(tmp, 0, i->fd);
 		/* XXX Switching formats silently causes kernel panics XXX */
 		if (i->mode == MODE_FXS &&
-		    ioctl(i->fd, PHONE_QUERY_CODEC, &codec) == 0) {
-			if (codec.type == LINEAR16)
+		    ioctl(i->fd, PHONE_QUERY_CODEC, &new_codec) == 0) {
+			if (new_codec.type == LINEAR16)
 				tmp->nativeformats =
 				tmp->rawreadformat =
 				tmp->rawwriteformat =
@@ -876,7 +876,7 @@
 		if (state == AST_STATE_RING)
 			tmp->rings = 1;
 		tmp->tech_pvt = i;
-		ast_copy_string(tmp->context, context, sizeof(tmp->context));
+		ast_copy_string(tmp->context, cntx, sizeof(tmp->context));
 		if (!ast_strlen_zero(i->ext))
 			ast_copy_string(tmp->exten, i->ext, sizeof(tmp->exten));
 		else
@@ -1017,7 +1017,7 @@
 	struct phone_pvt *i;
 	int tonepos = 0;
 	/* The tone we're playing this round */
-	struct timeval tv = {0,0};
+	struct timeval wait = {0,0};
 	int dotone;
 	/* This thread monitors all the frame relay interfaces which are not yet in use
 	   (and thus do not have a separate thread) indefinitely */
@@ -1048,7 +1048,7 @@
 				if (i->dialtone && i->mode != MODE_SIGMA) {
 					/* Remember we're going to have to come back and play
 					   more dialtones */
-					if (ast_tvzero(tv)) {
+					if (ast_tvzero(wait)) {
 						/* If we're due for a dialtone, play one */
 						if (write(i->fd, DialTone + tonepos, 240) != 240)
 							ast_log(LOG_WARNING, "Dial tone write error\n");
@@ -1068,13 +1068,13 @@
 			tonepos += 240;
 			if (tonepos >= sizeof(DialTone))
 					tonepos = 0;
-			if (ast_tvzero(tv)) {
-				tv = ast_tv(30000, 0);
-			}
-			res = ast_select(n + 1, &rfds, NULL, &efds, &tv);
+			if (ast_tvzero(wait)) {
+				wait = ast_tv(30000, 0);
+			}
+			res = ast_select(n + 1, &rfds, NULL, &efds, &wait);
 		} else {
 			res = ast_select(n + 1, &rfds, NULL, &efds, NULL);
-			tv = ast_tv(0,0);
+			wait = ast_tv(0,0);
 			tonepos = 0;
 		}
 		/* Okay, select has finished.  Let's see what happened.  */

Modified: team/seanbright/resolve-shadow-warnings/channels/iax2-parser.c
URL: http://svn.digium.com/view/asterisk/team/seanbright/resolve-shadow-warnings/channels/iax2-parser.c?view=diff&rev=114302&r1=114301&r2=114302
==============================================================================
--- team/seanbright/resolve-shadow-warnings/channels/iax2-parser.c (original)
+++ team/seanbright/resolve-shadow-warnings/channels/iax2-parser.c Sat Apr 19 11:29:24 2008
@@ -207,7 +207,7 @@
 	int ie;
 	char *name;
 	void (*dump)(char *output, int maxlen, void *value, int len);
-} ies[] = {
+} infoelts[] = {
 	{ IAX_IE_CALLED_NUMBER, "CALLED NUMBER", dump_string },
 	{ IAX_IE_CALLING_NUMBER, "CALLING NUMBER", dump_string },
 	{ IAX_IE_CALLING_ANI, "ANI", dump_string },
@@ -285,9 +285,9 @@
 const char *iax_ie2str(int ie)
 {
 	int x;
-	for (x=0;x<(int)sizeof(ies) / (int)sizeof(ies[0]); x++) {
-		if (ies[x].ie == ie)
-			return ies[x].name;
+	for (x = 0; x < ARRAY_LEN(infoelts); x++) {
+		if (infoelts[x].ie == ie)
+			return infoelts[x].name;
 	}
 	return "Unknown IE";
 }
@@ -364,18 +364,18 @@
 			return;
 		}
 		found = 0;
-		for (x=0;x<(int)sizeof(ies) / (int)sizeof(ies[0]); x++) {
-			if (ies[x].ie == ie) {
-				if (ies[x].dump) {
-					ies[x].dump(interp, (int)sizeof(interp), iedata + 2, ielen);
-					snprintf(tmp, (int)sizeof(tmp), "   %-15.15s : %s\n", ies[x].name, interp);
+		for (x = 0; x < ARRAY_LEN(infoelts); x++) {
+			if (infoelts[x].ie == ie) {
+				if (infoelts[x].dump) {
+					infoelts[x].dump(interp, (int)sizeof(interp), iedata + 2, ielen);
+					snprintf(tmp, (int)sizeof(tmp), "   %-15.15s : %s\n", infoelts[x].name, interp);
 					outputf(tmp);
 				} else {
 					if (ielen)
 						snprintf(interp, (int)sizeof(interp), "%d bytes", ielen);
 					else
 						strcpy(interp, "Present");
-					snprintf(tmp, (int)sizeof(tmp), "   %-15.15s : %s\n", ies[x].name, interp);
+					snprintf(tmp, (int)sizeof(tmp), "   %-15.15s : %s\n", infoelts[x].name, interp);
 					outputf(tmp);
 				}
 				found++;
@@ -393,7 +393,7 @@
 
 void iax_showframe(struct iax_frame *f, struct ast_iax2_full_hdr *fhi, int rx, struct sockaddr_in *sin, int datalen)
 {
-	const char *frames[] = {
+	const char *framelist[] = {
 		"(0?)",
 		"DTMF_E ",
 		"VOICE  ",
@@ -506,11 +506,11 @@
 		/* Don't mess with mini-frames */
 		return;
 	}
-	if (fh->type >= (int)sizeof(frames)/(int)sizeof(frames[0])) {
+	if (fh->type >= ARRAY_LEN(framelist)) {
 		snprintf(class2, sizeof(class2), "(%d?)", fh->type);
 		class = class2;
 	} else {
-		class = frames[(int)fh->type];
+		class = framelist[(int)fh->type];
 	}
 	if (fh->type == AST_FRAME_DTMF_BEGIN || fh->type == AST_FRAME_DTMF_END) {
 		sprintf(subclass2, "%c", fh->csub);
@@ -909,9 +909,9 @@
 			/* Existing variable or new variable? */
 			for (var2 = ies->vars, prev = NULL; var2; prev = var2, var2 = var2->next) {
 				if (strcmp(tmp, var2->name) == 0) {
-					int len = strlen(var2->value) + strlen(tmp2) + 1;
-					char *tmp3 = alloca(len);
-					snprintf(tmp3, len, "%s%s", var2->value, tmp2);
+					int length = strlen(var2->value) + strlen(tmp2) + 1;
+					char *tmp3 = alloca(length);
+					snprintf(tmp3, length, "%s%s", var2->value, tmp2);
 					var = ast_variable_new(tmp, tmp3, var2->file);
 					var->next = var2->next;
 					if (prev)
@@ -1065,13 +1065,13 @@
 #if !defined(LOW_MEMORY)
 static void frame_cache_cleanup(void *data)
 {
-	struct iax_frames *frames = data;
-	struct iax_frame *cur;
-
-	while ((cur = AST_LIST_REMOVE_HEAD(frames, list)))
-		ast_free(cur);
-
-	ast_free(frames);
+	struct iax_frames *framelist = data;
+	struct iax_frame *current;
+
+	while ((current = AST_LIST_REMOVE_HEAD(framelist, list)))
+		ast_free(current);
+
+	ast_free(framelist);
 }
 #endif
 




More information about the asterisk-commits mailing list