Skip to content

Commit d18ff42

Browse files
libretroadminLibretroAdmin
authored andcommitted
menu_setting: fix the lazy-builder warnings, drop two orphaned reprs
The on-demand builder compared an unsigned counter against the signed list-info size and passed the address of a local through the append macro's truth test; the loop now compares like signs and the macro receives a pointer variable. The st_dir and st_string representation helpers had lost their last caller earlier in the handler-tuple work - a tree-wide reference audit found none under any guard - and are deleted. Both validation dumps byte-identical across the full coverage.
1 parent 235e513 commit d18ff42

1 file changed

Lines changed: 7 additions & 33 deletions

File tree

menu/menu_setting.c

Lines changed: 7 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1291,26 +1291,6 @@ static size_t setting_get_string_representation_st_float(rarch_setting_t *settin
12911291
return 0;
12921292
}
12931293

1294-
static size_t setting_get_string_representation_st_dir(rarch_setting_t *setting,
1295-
char *s, size_t len)
1296-
{
1297-
if (setting)
1298-
{
1299-
#if IOS
1300-
if (*setting->value.target.string)
1301-
return fill_pathname_abbreviate_special(s, setting->value.target.string, len);
1302-
return strlcpy(s, setting->aux.empty_path, len);
1303-
#else
1304-
return strlcpy(s,
1305-
*setting->value.target.string
1306-
? setting->value.target.string
1307-
: setting->aux.empty_path,
1308-
len);
1309-
#endif
1310-
}
1311-
return 0;
1312-
}
1313-
13141294
static size_t setting_get_string_representation_st_path(rarch_setting_t *setting,
13151295
char *s, size_t len)
13161296
{
@@ -1327,14 +1307,6 @@ static size_t setting_get_string_representation_st_path(rarch_setting_t *setting
13271307
return 0;
13281308
}
13291309

1330-
static size_t setting_get_string_representation_st_string(rarch_setting_t *setting,
1331-
char *s, size_t len)
1332-
{
1333-
if (setting)
1334-
return strlcpy(s, setting->value.target.string, len);
1335-
return 0;
1336-
}
1337-
13381310
static size_t setting_get_string_representation_st_bind(rarch_setting_t *setting,
13391311
char *s, size_t len)
13401312
{
@@ -18799,9 +18771,10 @@ static rarch_setting_t *settings_lazy_get(unsigned k)
1879918771
{
1880018772
settings_t *settings = config_get_ptr();
1880118773
global_t *global = global_get_ptr();
18802-
rarch_setting_t *sl = NULL;
18803-
rarch_setting_t **lp = NULL;
18774+
rarch_setting_t *sl = NULL;
18775+
rarch_setting_t **lp = NULL;
1880418776
rarch_setting_info_t li;
18777+
rarch_setting_info_t *lip = NULL;
1880518778
unsigned j;
1880618779
if (k >= settings_lazy_nbuilders)
1880718780
return NULL;
@@ -18811,7 +18784,7 @@ static rarch_setting_t *settings_lazy_get(unsigned k)
1881118784
li.size = 32;
1881218785
if (!(sl = (rarch_setting_t*)malloc(li.size * sizeof(*sl))))
1881318786
return NULL;
18814-
for (j = 0; j < li.size; j++)
18787+
for (j = 0; j < (unsigned)li.size; j++)
1881518788
{
1881618789
MENU_SETTING_INITIALIZE((&sl)[0], j);
1881718790
}
@@ -18822,8 +18795,9 @@ static rarch_setting_t *settings_lazy_get(unsigned k)
1882218795
free(sl);
1882318796
return NULL;
1882418797
}
18825-
lp = &sl;
18826-
if (!SETTINGS_LIST_APPEND(lp, (&li)))
18798+
lp = &sl;
18799+
lip = &li;
18800+
if (!SETTINGS_LIST_APPEND(lp, lip))
1882718801
{
1882818802
free(sl);
1882918803
return NULL;

0 commit comments

Comments
 (0)