[svn-commits] seanbright: trunk r358691 - /trunk/apps/

SVN commits to the Digium repositories svn-commits at lists.digium.com
Thu Mar 8 11:48:21 CST 2012


Author: seanbright
Date: Thu Mar  8 11:48:14 2012
New Revision: 358691

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=358691
Log:
Resolve a few more cases of variable shadowing.

Modified:
    trunk/apps/app_dial.c
    trunk/apps/app_directory.c
    trunk/apps/app_queue.c

Modified: trunk/apps/app_dial.c
URL: http://svnview.digium.com/svn/asterisk/trunk/apps/app_dial.c?view=diff&rev=358691&r1=358690&r2=358691
==============================================================================
--- trunk/apps/app_dial.c (original)
+++ trunk/apps/app_dial.c Thu Mar  8 11:48:14 2012
@@ -2697,11 +2697,11 @@
 				if (gosub_args) {
 					res9 = pbx_exec(peer, theapp, gosub_args);
 					if (!res9) {
-						struct ast_pbx_args args;
+						struct ast_pbx_args pbx_args;
 						/* A struct initializer fails to compile for this case ... */
-						memset(&args, 0, sizeof(args));
-						args.no_hangup_chan = 1;
-						ast_pbx_run_args(peer, &args);
+						memset(&pbx_args, 0, sizeof(pbx_args));
+						pbx_args.no_hangup_chan = 1;
+						ast_pbx_run_args(peer, &pbx_args);
 					}
 					ast_free(gosub_args);
 					ast_debug(1, "Gosub exited with status %d\n", res9);
@@ -2869,9 +2869,9 @@
 				replace_macro_delimiter(opt_args[OPT_ARG_CALLEE_GO_ON]);
 				ast_parseable_goto(peer, opt_args[OPT_ARG_CALLEE_GO_ON]);
 			} else { /* F() */
-				int res;
-				res = ast_goto_if_exists(peer, ast_channel_context(chan), ast_channel_exten(chan), (ast_channel_priority(chan)) + 1); 
-				if (res == AST_PBX_GOTO_FAILED) {
+				int goto_res;
+				goto_res = ast_goto_if_exists(peer, ast_channel_context(chan), ast_channel_exten(chan), (ast_channel_priority(chan)) + 1); 
+				if (goto_res == AST_PBX_GOTO_FAILED) {
 					ast_hangup(peer);
 					goto out;
 				}

Modified: trunk/apps/app_directory.c
URL: http://svnview.digium.com/svn/asterisk/trunk/apps/app_directory.c?view=diff&rev=358691&r1=358690&r2=358691
==============================================================================
--- trunk/apps/app_directory.c (original)
+++ trunk/apps/app_directory.c Thu Mar  8 11:48:14 2012
@@ -472,7 +472,7 @@
 
 	mailbox = NULL;
 	while ( (mailbox = ast_category_browse(rtdata, mailbox)) ) {
-		const char *context = ast_variable_retrieve(rtdata, mailbox, "context");
+		const char *ctx = ast_variable_retrieve(rtdata, mailbox, "context");
 
 		fullname = ast_variable_retrieve(rtdata, mailbox, "fullname");
 		if (ast_true((hidefromdir = ast_variable_retrieve(rtdata, mailbox, "hidefromdir")))) {
@@ -482,8 +482,8 @@
 		snprintf(tmp, sizeof(tmp), "no-password,%s", S_OR(fullname, ""));
 
 		/* Does the context exist within the config file? If not, make one */
-		if (!(cat = ast_category_get(cfg, context))) {
-			if (!(cat = ast_category_new(context, "", 99999))) {
+		if (!(cat = ast_category_get(cfg, ctx))) {
+			if (!(cat = ast_category_new(ctx, "", 99999))) {
 				ast_log(LOG_WARNING, "Out of memory\n");
 				ast_config_destroy(cfg);
 				if (rtdata) {

Modified: trunk/apps/app_queue.c
URL: http://svnview.digium.com/svn/asterisk/trunk/apps/app_queue.c?view=diff&rev=358691&r1=358690&r2=358691
==============================================================================
--- trunk/apps/app_queue.c (original)
+++ trunk/apps/app_queue.c Thu Mar  8 11:48:14 2012
@@ -3567,7 +3567,7 @@
 }
 
 /*! \brief RNA == Ring No Answer. Common code that is executed when we try a queue member and they don't answer. */
-static void rna(int rnatime, struct queue_ent *qe, char *interface, char *membername, int pause)
+static void rna(int rnatime, struct queue_ent *qe, char *interface, char *membername, int autopause)
 {
 	ast_verb(3, "Nobody picked up in %d ms\n", rnatime);
 
@@ -3597,7 +3597,7 @@
 						qe->parent->eventwhencalled == QUEUE_EVENT_VARIABLES ? vars2manager(qe->chan, vars, sizeof(vars)) : "");
 	}
 	ast_queue_log(qe->parent->name, ast_channel_uniqueid(qe->chan), membername, "RINGNOANSWER", "%d", rnatime);
-	if (qe->parent->autopause != QUEUE_AUTOPAUSE_OFF && pause) {
+	if (qe->parent->autopause != QUEUE_AUTOPAUSE_OFF && autopause) {
 		if (qe->parent->autopausedelay > 0) {
 			struct member *mem;
 			ao2_lock(qe->parent);
@@ -5320,18 +5320,15 @@
 
 		if (!ast_check_hangup(peer) && ast_test_flag(&opts, OPT_CALLEE_GO_ON)) {
 			if (!ast_strlen_zero(opt_args[OPT_ARG_CALLEE_GO_ON])) {
-				int res;
 				replace_macro_delimiter(opt_args[OPT_ARG_CALLEE_GO_ON]);
-				res = ast_parseable_goto(peer, opt_args[OPT_ARG_CALLEE_GO_ON]);
-				if (res == AST_PBX_SUCCESS) {
+
+				if (ast_parseable_goto(peer, opt_args[OPT_ARG_CALLEE_GO_ON]) == AST_PBX_SUCCESS) {
 					ast_pbx_start(peer);
 				} else {
 					ast_hangup(peer);
 				}
 			} else { /* F() */
-				int res;
-				res = ast_goto_if_exists(peer, caller_context, caller_extension, caller_priority + 1);
-				if (res == AST_PBX_GOTO_FAILED) {
+				if (ast_goto_if_exists(peer, caller_context, caller_extension, caller_priority + 1) == AST_PBX_GOTO_FAILED) {
 					ast_hangup(peer);
 				} else {
 					ast_pbx_start(peer);
@@ -5674,11 +5671,13 @@
 
 	if (ast_strlen_zero(queuename)) { /* This means we need to iterate through all the queues. */
 		if (ast_check_realtime("queues")) {
-			char *queuename;
+			char *name;
 			queue_config = ast_load_realtime_multientry("queues", "name LIKE", "%", SENTINEL);
 			if (queue_config) {
-				for (queuename = ast_category_browse(queue_config, NULL); !ast_strlen_zero(queuename); queuename = ast_category_browse(queue_config, queuename)) {
-					if ((q = find_load_queue_rt_friendly(queuename))) {
+				for (name = ast_category_browse(queue_config, NULL);
+					 !ast_strlen_zero(name);
+					 name = ast_category_browse(queue_config, name)) {
+					if ((q = find_load_queue_rt_friendly(name))) {
 						foundqueue++;
 						foundinterface += set_member_penalty_help_members(q, interface, penalty);
 					}




More information about the svn-commits mailing list