Eliminate a bunch of shadow warnings.
authorSean Bright <sean@malleable.com>
Thu, 8 Mar 2012 17:02:52 +0000 (17:02 +0000)
committerSean Bright <sean@malleable.com>
Thu, 8 Mar 2012 17:02:52 +0000 (17:02 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@358647 65c4cc65-6c06-0410-ace0-fbb531ad65f3

apps/confbridge/conf_config_parser.c
channels/chan_agent.c
channels/chan_gtalk.c
channels/chan_oss.c
channels/chan_phone.c
channels/chan_skinny.c
pbx/pbx_config.c
pbx/pbx_dundi.c
pbx/pbx_lua.c

index 9bb8b2a..a73c658 100644 (file)
@@ -711,9 +711,9 @@ static int add_menu_entry(struct conf_menu *menu, const char *dtmf, const char *
 
        /* if adding any of the actions failed, bail */
        if (res) {
-               struct conf_menu_action *action;
-               while ((action = AST_LIST_REMOVE_HEAD(&menu_entry->actions, action))) {
-                       ast_free(action);
+               struct conf_menu_action *menu_action;
+               while ((menu_action = AST_LIST_REMOVE_HEAD(&menu_entry->actions, action))) {
+                       ast_free(menu_action);
                }
                ast_free(menu_entry);
                return -1;
index 4ce43a5..8361540 100644 (file)
@@ -778,7 +778,6 @@ static int agent_indicate(struct ast_channel *ast, int condition, const void *da
        ast_mutex_lock(&p->lock);
        if (p->chan && !ast_check_hangup(p->chan)) {
                while (ast_channel_trylock(p->chan)) {
-                       int res;
                        if ((res = ast_channel_unlock(ast))) {
                                ast_log(LOG_ERROR, "chan_agent bug! Channel was not locked upon entry to agent_indicate: %s\n", strerror(res));
                                ast_mutex_unlock(&p->lock);
index 9e84256..c13cbfc 100644 (file)
@@ -958,9 +958,9 @@ static int gtalk_create_candidates(struct gtalk *client, struct gtalk_pvt *p, ch
                /* put the initiator attribute to lower case if we receive the call
                 * otherwise GoogleTalk won't establish the session */
                if (!p->initiator) {
-                       char c;
+                       char cur;
                        char *t = lowerfrom = ast_strdupa(from);
-                       while (((c = *t) != '/') && (*t++ = tolower(c)));
+                       while (((cur = *t) != '/') && (*t++ = tolower(cur)));
                }
                iks_insert_attrib(gtalk, "initiator", (p->initiator) ? to : lowerfrom);
                iks_insert_attrib(gtalk, "xmlns", GOOGLE_NS);
index ddd559a..ca26e79 100644 (file)
@@ -1099,16 +1099,16 @@ static char *console_dial(struct ast_cli_entry *e, int cmd, struct ast_cli_args
        if (o->owner) { /* already in a call */
                int i;
                struct ast_frame f = { AST_FRAME_DTMF, { 0 } };
-               const char *s;
+               const char *digits;
 
                if (a->argc == e->args) {       /* argument is mandatory here */
                        ast_cli(a->fd, "Already in a call. You can only dial digits until you hangup.\n");
                        return CLI_FAILURE;
                }
-               s = a->argv[e->args];
+               digits = a->argv[e->args];
                /* send the string one char at a time */
-               for (i = 0; i < strlen(s); i++) {
-                       f.subclass.integer = s[i];
+               for (i = 0; i < strlen(digits); i++) {
+                       f.subclass.integer = digits[i];
                        ast_queue_frame(o->owner, &f);
                }
                return CLI_SUCCESS;
index 6926a7d..f7e7c33 100644 (file)
@@ -1018,7 +1018,7 @@ static void *do_monitor(void *data)
        struct phone_pvt *i;
        int tonepos = 0;
        /* The tone we're playing this round */
-       struct timeval tv = { 0, 0 };
+       struct timeval to = { 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 */
@@ -1055,7 +1055,7 @@ static void *do_monitor(void *data)
                                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(to)) {
                                                /* 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");
@@ -1075,13 +1075,13 @@ static void *do_monitor(void *data)
                        if (tonepos >= sizeof(DialTone)) {
                                tonepos = 0;
                        }
-                       if (ast_tvzero(tv)) {
-                               tv = ast_tv(0, 30000);
+                       if (ast_tvzero(to)) {
+                               to = ast_tv(0, 30000);
                        }
-                       res = ast_poll2(fds, inuse_fds, &tv);
+                       res = ast_poll2(fds, inuse_fds, &to);
                } else {
                        res = ast_poll(fds, inuse_fds, -1);
-                       tv = ast_tv(0, 0);
+                       to = ast_tv(0, 0);
                        tonepos = 0;
                }
                /* Okay, select has finished.  Let's see what happened.  */
@@ -1437,7 +1437,6 @@ static int load_module(void)
                } else if (!strcasecmp(v->name, "context")) {
                        ast_copy_string(context, v->value, sizeof(context));
                } else if (!strcasecmp(v->name, "format")) {
-                       struct ast_format tmpfmt;
                        if (!strcasecmp(v->value, "g729")) {
                                ast_format_cap_set(prefcap, ast_format_set(&tmpfmt, AST_FORMAT_G729A, 0));
                        } else if (!strcasecmp(v->value, "g723.1")) {
index 0323237..c4f4434 100644 (file)
@@ -5392,7 +5392,7 @@ static void dumpsub(struct skinny_subchannel *sub, int forcehangup)
 {
        struct skinny_line *l = sub->line;
        struct skinny_device *d = l->device;
-       struct skinny_subchannel *activatesub = NULL;
+       struct skinny_subchannel *activate_sub = NULL;
        struct skinny_subchannel *tsub;
 
        if (skinnydebug) {
@@ -5408,9 +5408,9 @@ static void dumpsub(struct skinny_subchannel *sub, int forcehangup)
                d->hookstate = SKINNY_ONHOOK;
                transmit_speaker_mode(d, SKINNY_SPEAKEROFF); 
                if (sub->related) {
-                       activatesub = sub->related;
+                       activate_sub = sub->related;
                        setsubstate(sub, SUBSTATE_ONHOOK);
-                       l->activesub = activatesub;
+                       l->activesub = activate_sub;
                        if (l->activesub->substate != SUBSTATE_HOLD) {
                                ast_log(LOG_WARNING, "Sub-%d was related but not at SUBSTATE_HOLD\n", sub->callid);
                                return;
@@ -5420,20 +5420,20 @@ static void dumpsub(struct skinny_subchannel *sub, int forcehangup)
                        setsubstate(sub, SUBSTATE_ONHOOK);
                        AST_LIST_TRAVERSE(&l->sub, tsub, list) {
                                if (tsub->substate == SUBSTATE_CALLWAIT) {
-                                       activatesub = tsub;
+                                       activate_sub = tsub;
                                }
                        }
-                       if (activatesub) {
-                               setsubstate(activatesub, SUBSTATE_RINGIN);
+                       if (activate_sub) {
+                               setsubstate(activate_sub, SUBSTATE_RINGIN);
                                return;
                        }
                        AST_LIST_TRAVERSE(&l->sub, tsub, list) {
                                if (tsub->substate == SUBSTATE_HOLD) {
-                                       activatesub = tsub;
+                                       activate_sub = tsub;
                                }
                        }
-                       if (activatesub) {
-                               setsubstate(activatesub, SUBSTATE_HOLD);
+                       if (activate_sub) {
+                               setsubstate(activate_sub, SUBSTATE_HOLD);
                                return;
                        }
                }
@@ -6674,7 +6674,6 @@ static int handle_message(struct skinny_req *req, struct skinnysession *s)
                break;
        case KEYPAD_BUTTON_MESSAGE:
            {
-               struct skinny_device *d = s->device;
                struct skinny_subchannel *sub;
                int lineInstance;
                int callReference;
index 4aeabe9..86b1322 100644 (file)
@@ -1632,8 +1632,8 @@ process_extension:
                                                v->value, cxt, v->lineno, vfile);
                                }
                        } else if (!strcasecmp(v->name, "switch") || !strcasecmp(v->name, "lswitch") || !strcasecmp(v->name, "eswitch")) {
-                               char *stringp = realvalue;
                                char *appl, *data;
+                               stringp = realvalue;
                                
                                if (!strcasecmp(v->name, "switch")) {
                                        pbx_substitute_variables_helper(NULL, v->value, realvalue, sizeof(realvalue) - 1);
index ab48ad6..2e5c39e 100644 (file)
@@ -1224,7 +1224,7 @@ static int cache_lookup_internal(time_t now, struct dundi_request *req, char *ke
        return 0;
 }
 
-static int cache_lookup(struct dundi_request *req, dundi_eid *peer_eid, uint32_t crc32, int *lowexpiration)
+static int cache_lookup(struct dundi_request *req, dundi_eid *peer_eid, uint32_t crc, int *lowexpiration)
 {
        char key[256];
        char eid_str[20];
@@ -1240,7 +1240,7 @@ static int cache_lookup(struct dundi_request *req, dundi_eid *peer_eid, uint32_t
        dundi_eid_to_str_short(eid_str, sizeof(eid_str), peer_eid);
        dundi_eid_to_str_short(eidroot_str, sizeof(eidroot_str), &req->root_eid);
        ast_eid_to_str(eid_str_full, sizeof(eid_str_full), peer_eid);
-       snprintf(key, sizeof(key), "%s/%s/%s/e%08x", eid_str, req->number, req->dcontext, crc32);
+       snprintf(key, sizeof(key), "%s/%s/%s/e%08x", eid_str, req->number, req->dcontext, crc);
        res |= cache_lookup_internal(now, req, key, eid_str_full, lowexpiration);
        snprintf(key, sizeof(key), "%s/%s/%s/e%08x", eid_str, req->number, req->dcontext, 0);
        res |= cache_lookup_internal(now, req, key, eid_str_full, lowexpiration);
@@ -1255,7 +1255,7 @@ static int cache_lookup(struct dundi_request *req, dundi_eid *peer_eid, uint32_t
                                break;
                        x++;
                        /* Check for hints */
-                       snprintf(key, sizeof(key), "hint/%s/%s/%s/e%08x", eid_str, tmp, req->dcontext, crc32);
+                       snprintf(key, sizeof(key), "hint/%s/%s/%s/e%08x", eid_str, tmp, req->dcontext, crc);
                        res2 |= cache_lookup_internal(now, req, key, eid_str_full, lowexpiration);
                        snprintf(key, sizeof(key), "hint/%s/%s/%s/e%08x", eid_str, tmp, req->dcontext, 0);
                        res2 |= cache_lookup_internal(now, req, key, eid_str_full, lowexpiration);
index d0e0f98..9288616 100644 (file)
@@ -1257,7 +1257,7 @@ static lua_State *lua_get_state(struct ast_channel *chan)
        lua_State *L;
 
        if (!chan) {
-               lua_State *L = luaL_newstate();
+               L = luaL_newstate();
                if (!L) {
                        ast_log(LOG_ERROR, "Error allocating lua_State, no memory\n");
                        return NULL;