From b1ed564ad05fb27a5aec2b2594ff22065afc6d42 Mon Sep 17 00:00:00 2001 From: Joel Brobecker Date: Thu, 29 Mar 2012 23:30:55 +0000 Subject: [PATCH] Rename variables in ada-lang.c:ada_make_symbol_completion_list. This renaming allows us to have variable names that are consistent with the names of the parameters in the functions where these variables are used. This also allows us to avoid a -Wshadow warning in the case of variable "wild_match", which is now renamed to "wild_match_p". gdb/ChangeLog: -Wshadow warning fix. * ada-lang.c (ada_make_symbol_completion_list): Rename parameters "wild_match" and "encoded" into "wild_match_p" and "encoded_p". Adjust code accordingly. --- gdb/ChangeLog | 8 ++++++++ gdb/ada-lang.c | 25 +++++++++++++------------ 2 files changed, 21 insertions(+), 12 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 16bb222e568..f6c77355862 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,11 @@ +2012-03-29 Joel Brobecker + Andrey Smirnov + + -Wshadow warning fix. + * ada-lang.c (ada_make_symbol_completion_list): Rename parameters + "wild_match" and "encoded" into "wild_match_p" and "encoded_p". + Adjust code accordingly. + 2012-03-29 Joel Brobecker * ada-lang.c (symbol_completion_add): Rename parameter diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c index 4a6e847decc..031609df71c 100644 --- a/gdb/ada-lang.c +++ b/gdb/ada-lang.c @@ -5807,8 +5807,8 @@ ada_make_symbol_completion_list (char *text0, char *word) { char *text; int text_len; - int wild_match; - int encoded; + int wild_match_p; + int encoded_p; VEC(char_ptr) *completions = VEC_alloc (char_ptr, 128); struct symbol *sym; struct symtab *s; @@ -5823,8 +5823,8 @@ ada_make_symbol_completion_list (char *text0, char *word) text = xstrdup (text0); make_cleanup (xfree, text); text_len = strlen (text); - wild_match = 0; - encoded = 1; + wild_match_p = 0; + encoded_p = 1; } else { @@ -5834,12 +5834,12 @@ ada_make_symbol_completion_list (char *text0, char *word) for (i = 0; i < text_len; i++) text[i] = tolower (text[i]); - encoded = (strstr (text0, "__") != NULL); + encoded_p = (strstr (text0, "__") != NULL); /* If the name contains a ".", then the user is entering a fully qualified entity name, and the match must not be done in wild mode. Similarly, if the user wants to complete what looks like an encoded name, the match must not be done in wild mode. */ - wild_match = (strchr (text0, '.') == NULL && !encoded); + wild_match_p = (strchr (text0, '.') == NULL && !encoded_p); } /* First, look at the partial symtab symbols. */ @@ -5851,8 +5851,8 @@ ada_make_symbol_completion_list (char *text0, char *word) data.text_len = text_len; data.text0 = text0; data.word = word; - data.wild_match = wild_match; - data.encoded = encoded; + data.wild_match = wild_match_p; + data.encoded = encoded_p; expand_partial_symbol_names (ada_expand_partial_symbol_name, &data); } @@ -5865,7 +5865,8 @@ ada_make_symbol_completion_list (char *text0, char *word) { QUIT; symbol_completion_add (&completions, SYMBOL_LINKAGE_NAME (msymbol), - text, text_len, text0, word, wild_match, encoded); + text, text_len, text0, word, wild_match_p, + encoded_p); } /* Search upwards from currently selected frame (so that we can @@ -5880,7 +5881,7 @@ ada_make_symbol_completion_list (char *text0, char *word) { symbol_completion_add (&completions, SYMBOL_LINKAGE_NAME (sym), text, text_len, text0, word, - wild_match, encoded); + wild_match_p, encoded_p); } } @@ -5895,7 +5896,7 @@ ada_make_symbol_completion_list (char *text0, char *word) { symbol_completion_add (&completions, SYMBOL_LINKAGE_NAME (sym), text, text_len, text0, word, - wild_match, encoded); + wild_match_p, encoded_p); } } @@ -5910,7 +5911,7 @@ ada_make_symbol_completion_list (char *text0, char *word) { symbol_completion_add (&completions, SYMBOL_LINKAGE_NAME (sym), text, text_len, text0, word, - wild_match, encoded); + wild_match_p, encoded_p); } } -- 2.30.2