[asterisk-commits] trunk r16652 - /trunk/channels/chan_local.c

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Fri Mar 31 03:13:24 MST 2006


Author: rizzo
Date: Fri Mar 31 04:13:22 2006
New Revision: 16652

URL: http://svn.digium.com/view/asterisk?rev=16652&view=rev
Log:
minor cleanup: localize a variable and replace i++; i++ with i +=2;


Modified:
    trunk/channels/chan_local.c

Modified: trunk/channels/chan_local.c
URL: http://svn.digium.com/view/asterisk/trunk/channels/chan_local.c?rev=16652&r1=16651&r2=16652&view=diff
==============================================================================
--- trunk/channels/chan_local.c (original)
+++ trunk/channels/chan_local.c Fri Mar 31 04:13:22 2006
@@ -382,12 +382,11 @@
 	struct ast_frame f = { AST_FRAME_CONTROL, AST_CONTROL_HANGUP };
 	struct ast_channel *ochan = NULL;
 	int glaredetect;
-	const char *status;
 
 	ast_mutex_lock(&p->lock);
 	isoutbound = IS_OUTBOUND(ast, p);
 	if (isoutbound) {
-		status = pbx_builtin_getvar_helper(p->chan, "DIALSTATUS");
+		const char *status = pbx_builtin_getvar_helper(p->chan, "DIALSTATUS");
 		if ((status) && (p->owner))
 			pbx_builtin_setvar_helper(p->owner, "CHANLOCALSTATUS", status);
 		p->chan = NULL;
@@ -512,8 +511,7 @@
 	p->owner = tmp;
 	p->chan = tmp2;
 	ast_mutex_lock(&usecnt_lock);
-	usecnt++;
-	usecnt++;
+	usecnt += 2;	/* we allocate 2 new channels */
 	ast_mutex_unlock(&usecnt_lock);
 	ast_update_use_count();
 	ast_copy_string(tmp->context, p->context, sizeof(tmp->context));



More information about the asterisk-commits mailing list