Remove some shadowed variables identified by -Wshadow

there are plenty more but these are the low hanging fruit

Change-Id: I86d9f4f56e8cd9b381d1bf6a6679cd58c6a4004d
This commit is contained in:
William Wilgus 2022-11-12 16:34:02 -05:00 committed by William Wilgus
parent f94a14b859
commit 034b6d5bfb
9 changed files with 12 additions and 15 deletions

View file

@ -65,7 +65,7 @@ static bool search_for_cuesheet(const char *path, struct cuesheet_file *cue_file
strcpy(cuepath, CUE_DIR);
if (strlcat(cuepath, slash, MAX_PATH) >= MAX_PATH)
goto skip; /* overflow */
char *dot = strrchr(cuepath, '.');
dot = strrchr(cuepath, '.');
strcpy(dot, ".cue");
if (!file_exists(cuepath))
{

View file

@ -667,7 +667,7 @@ int ft_enter(struct tree_context* c)
break;
}
struct entry* file = tree_get_entry_at(c, c->selected_item);
file = tree_get_entry_at(c, c->selected_item);
if (!file)
{
splashf(HZ, str(LANG_READ_FAILED), str(LANG_UNKNOWN));

View file

@ -208,7 +208,7 @@ static struct folder* load_folder(struct folder* parent, char *folder)
if ((dn[0] == '.') && (dn[1] == '\0' || (dn[1] == '.' && dn[2] == '\0')))
continue;
/* copy entry name to end of buffer, save pointer */
int len = strlen((char *)entry->d_name);
len = strlen((char *)entry->d_name);
char *name = folder_alloc_from_end(len+1); /*for NULL*/
if (name == NULL)
{

View file

@ -522,7 +522,6 @@ int do_menu(const struct menu_item_ex *start_menu, int *start_selected,
MENUITEM_STRINGLIST(notquickscreen_able_option,
ID2P(LANG_ONPLAY_MENU_TITLE), NULL,
ID2P(LANG_RESET_SETTING));
const struct menu_item_ex *menu;
const struct settings_list *setting =
find_setting(temp->variable, NULL);
#ifdef HAVE_QUICKSCREEN

View file

@ -549,8 +549,8 @@ int kbd_input(char* text, int buflen, unsigned short *kbd)
{
/* declare scoped pointers inside screen loops - hide the
declarations from previous block level */
struct keyboard_parameters *pm = &param[l];
struct screen *sc = &screens[l];
pm = &param[l];
sc->clear_display();
kbd_draw_picker(pm, sc, &state);
kbd_draw_edit_line(pm, sc, &state);

View file

@ -4333,7 +4333,7 @@ static bool load_tagcache(void)
unsigned int searchflag = auto_update ? DCS_STORAGE_PATH :
DCS_CACHED_PATH;
int rc = dircache_search(searchflag | DCS_UPDATE_FILEREF,
rc = dircache_search(searchflag | DCS_UPDATE_FILEREF,
&tcrc_dcfrefs[idx_id], filename);
if (rc > 0) /* in cache and we have fileref */
idx->flag |= FLAG_DIRCACHE;

View file

@ -215,11 +215,11 @@ static int move_callback(int handle, void* current, void* new)
/* loop over menus */
for(int i = 0; i < menu_count; i++)
{
struct menu_root* menu = menus[i];
struct menu_root* menuroot = menus[i];
/* then over the menu_entries of a menu */
for(int j = 0; j < menu->itemcount; j++)
for(int j = 0; j < menuroot->itemcount; j++)
{
struct menu_entry* mentry = menu->items[j];
struct menu_entry* mentry = menuroot->items[j];
/* then over the search_instructions of each menu_entry */
for(int k = 0; k < mentry->si.tagorder_count; k++)
{
@ -230,7 +230,7 @@ static int move_callback(int handle, void* current, void* new)
UPDATE(mentry->si.clause[k][l], diff);
}
}
UPDATE(menu->items[j], diff);
UPDATE(menuroot->items[j], diff);
}
UPDATE(menus[i], diff);
}

View file

@ -987,7 +987,7 @@ static int _talk_file(const char* filename,
return -1;
if (talk_handle <= 0 || index_handle <= 0)
{
int fd = open_voicefile();
fd = open_voicefile();
if (fd < 0 || !load_voicefile_index(fd))
return load_voicefile_failure(fd);
load_voicefile_data(fd);

View file

@ -242,6 +242,8 @@ void lcd_blit_yuv(unsigned char * const src[3],
int x, int y, int width, int height)
{
const unsigned char *ysrc, *usrc, *vsrc;
int cb, cr, rv, guv, bu, r, g, b;
int linecounter;
fb_data *dst, *row_end;
long z;
@ -272,8 +274,6 @@ void lcd_blit_yuv(unsigned char * const src[3],
{
do
{
int y, cb, cr, rv, guv, bu, r, g, b;
y = YFAC*(*ysrc++ - 16);
cb = *usrc++ - 128;
cr = *vsrc++ - 128;
@ -337,8 +337,6 @@ void lcd_blit_yuv(unsigned char * const src[3],
do
{
int y, cb, cr, rv, guv, bu, r, g, b;
y = YFAC*(*ysrc++ - 16);
cb = *usrc++ - 128;
cr = *vsrc++ - 128;