mirror of
https://github.com/libretro/RetroArch
synced 2025-03-28 08:37:41 +00:00
driver.c - Fix warnings 'declaration shadows a global variable'
This commit is contained in:
parent
034aa35a0c
commit
3b7dfea93d
40
driver.c
40
driver.c
@ -253,63 +253,63 @@ static const menu_ctx_driver_t *menu_ctx_drivers[] = {
|
|||||||
static const void *find_driver_nonempty(const char *label, int i,
|
static const void *find_driver_nonempty(const char *label, int i,
|
||||||
char *str, size_t sizeof_str)
|
char *str, size_t sizeof_str)
|
||||||
{
|
{
|
||||||
const void *driver = NULL;
|
const void *drv = NULL;
|
||||||
|
|
||||||
if (!strcmp(label, "camera_driver"))
|
if (!strcmp(label, "camera_driver"))
|
||||||
{
|
{
|
||||||
driver = camera_drivers[i];
|
drv = camera_drivers[i];
|
||||||
if (driver)
|
if (drv)
|
||||||
strlcpy(str, camera_drivers[i]->ident, sizeof_str);
|
strlcpy(str, camera_drivers[i]->ident, sizeof_str);
|
||||||
}
|
}
|
||||||
else if (!strcmp(label, "location_driver"))
|
else if (!strcmp(label, "location_driver"))
|
||||||
{
|
{
|
||||||
driver = location_drivers[i];
|
drv = location_drivers[i];
|
||||||
if (driver)
|
if (drv)
|
||||||
strlcpy(str, location_drivers[i]->ident, sizeof_str);
|
strlcpy(str, location_drivers[i]->ident, sizeof_str);
|
||||||
}
|
}
|
||||||
else if (!strcmp(label, "osk_driver"))
|
else if (!strcmp(label, "osk_driver"))
|
||||||
{
|
{
|
||||||
driver = osk_drivers[i];
|
drv = osk_drivers[i];
|
||||||
if (driver)
|
if (drv)
|
||||||
strlcpy(str, osk_drivers[i]->ident, sizeof_str);
|
strlcpy(str, osk_drivers[i]->ident, sizeof_str);
|
||||||
}
|
}
|
||||||
#ifdef HAVE_MENU
|
#ifdef HAVE_MENU
|
||||||
else if (!strcmp(label, "menu_driver"))
|
else if (!strcmp(label, "menu_driver"))
|
||||||
{
|
{
|
||||||
driver = menu_ctx_drivers[i];
|
drv = menu_ctx_drivers[i];
|
||||||
if (driver)
|
if (drv)
|
||||||
strlcpy(str, menu_ctx_drivers[i]->ident, sizeof_str);
|
strlcpy(str, menu_ctx_drivers[i]->ident, sizeof_str);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
else if (!strcmp(label, "input_driver"))
|
else if (!strcmp(label, "input_driver"))
|
||||||
{
|
{
|
||||||
driver = input_drivers[i];
|
drv = input_drivers[i];
|
||||||
if (driver)
|
if (drv)
|
||||||
strlcpy(str, input_drivers[i]->ident, sizeof_str);
|
strlcpy(str, input_drivers[i]->ident, sizeof_str);
|
||||||
}
|
}
|
||||||
else if (!strcmp(label, "input_joypad_driver"))
|
else if (!strcmp(label, "input_joypad_driver"))
|
||||||
{
|
{
|
||||||
driver = joypad_drivers[i];
|
drv = joypad_drivers[i];
|
||||||
if (driver)
|
if (drv)
|
||||||
strlcpy(str, joypad_drivers[i]->ident, sizeof_str);
|
strlcpy(str, joypad_drivers[i]->ident, sizeof_str);
|
||||||
}
|
}
|
||||||
else if (!strcmp(label, "video_driver"))
|
else if (!strcmp(label, "video_driver"))
|
||||||
{
|
{
|
||||||
driver = video_drivers[i];
|
drv = video_drivers[i];
|
||||||
if (driver)
|
if (drv)
|
||||||
strlcpy(str, video_drivers[i]->ident, sizeof_str);
|
strlcpy(str, video_drivers[i]->ident, sizeof_str);
|
||||||
}
|
}
|
||||||
else if (!strcmp(label, "audio_driver"))
|
else if (!strcmp(label, "audio_driver"))
|
||||||
{
|
{
|
||||||
driver = audio_drivers[i];
|
drv = audio_drivers[i];
|
||||||
if (driver)
|
if (drv)
|
||||||
strlcpy(str, audio_drivers[i]->ident, sizeof_str);
|
strlcpy(str, audio_drivers[i]->ident, sizeof_str);
|
||||||
}
|
}
|
||||||
|
|
||||||
return driver;
|
return drv;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int find_driver_index(const char * label, const char *driver)
|
static int find_driver_index(const char * label, const char *drv)
|
||||||
{
|
{
|
||||||
unsigned i;
|
unsigned i;
|
||||||
char str[PATH_MAX];
|
char str[PATH_MAX];
|
||||||
@ -322,7 +322,7 @@ static int find_driver_index(const char * label, const char *driver)
|
|||||||
return -1;
|
return -1;
|
||||||
if (str[0] == '\0')
|
if (str[0] == '\0')
|
||||||
break;
|
break;
|
||||||
if (!strcasecmp(driver, str))
|
if (!strcasecmp(drv, str))
|
||||||
return i;
|
return i;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user