]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Resolve a few more cases of variable shadowing.
authorSean Bright <sean@malleable.com>
Thu, 8 Mar 2012 17:48:14 +0000 (17:48 +0000)
committerSean Bright <sean@malleable.com>
Thu, 8 Mar 2012 17:48:14 +0000 (17:48 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@358691 65c4cc65-6c06-0410-ace0-fbb531ad65f3

apps/app_dial.c
apps/app_directory.c
apps/app_queue.c

index d2e9e6f3d16f6ffaef41a55bb10778597d4a10cf..46330fc650559552f4c1d94fab2e61794ab7354c 100644 (file)
@@ -2697,11 +2697,11 @@ static int dial_exec_full(struct ast_channel *chan, const char *data, struct ast
                                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 @@ static int dial_exec_full(struct ast_channel *chan, const char *data, struct ast
                                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;
                                }
index 52e8722c2fc475bae82e7d3c0b212b982617480c..bbca1bf62fd128162f5ddd6591d8c74bcd4b14e3 100644 (file)
@@ -472,7 +472,7 @@ static struct ast_config *realtime_directory(char *context)
 
        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 @@ static struct ast_config *realtime_directory(char *context)
                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) {
index ec04a2d525829e688b0e5ab18e430d7e5b6ffd95..7871a3d12e48f01bb9a697a8e34adbae4b16b69e 100644 (file)
@@ -3567,7 +3567,7 @@ static void record_abandoned(struct queue_ent *qe)
 }
 
 /*! \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 @@ static void rna(int rnatime, struct queue_ent *qe, char *interface, char *member
                                                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 @@ static int try_calling(struct queue_ent *qe, const struct ast_flags opts, char *
 
                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 @@ static int set_member_penalty(const char *queuename, const char *interface, int
 
        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);
                                        }