Skip to content

Commit

Permalink
Buildfixes and warning fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
LibretroAdmin committed Jan 17, 2025
1 parent 31b7812 commit e2c8e98
Show file tree
Hide file tree
Showing 11 changed files with 38 additions and 38 deletions.
16 changes: 8 additions & 8 deletions core_updater_list.c
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ bool core_updater_list_get_core(
static bool core_updater_list_set_date(
core_updater_list_entry_t *entry, const char *date_str)
{
char *tok, *save;
char *tok, *save = NULL;
char *elem0 = NULL;
char *elem1 = NULL;
char *elem2 = NULL;
Expand Down Expand Up @@ -784,7 +784,7 @@ bool core_updater_list_parse_network_data(
const char *network_buildbot_url,
const char *data, size_t len)
{
char *tok, *save;
char *tok, *save = NULL;
unsigned list_size = 0;
char *data_buf = NULL;

Expand Down Expand Up @@ -817,12 +817,12 @@ bool core_updater_list_parse_network_data(
for (tok = strtok_r(data_buf, "\n", &save); tok;
tok = strtok_r(NULL, "\n", &save))
{
char *tok2, *save2;
char *elem0 = NULL;
char *elem1 = NULL;
char *elem2 = NULL;
char *line_cpy = NULL;
const char *line = tok;
char *tok2, *save2 = NULL;
char *elem0 = NULL;
char *elem1 = NULL;
char *elem2 = NULL;
char *line_cpy = NULL;
const char *line = tok;

if (string_is_empty(line))
continue;
Expand Down
2 changes: 1 addition & 1 deletion input/connect/connect_retrode.c
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ static void hidpad_retrode_packet_handler(void *device_data, uint8_t *packet, ui
* 4 = right Genesis/MD
*/

hidpad_retrode_pad_packet_handler(&device->pad_data[packet[0] - 1], &device->data[0], size);
hidpad_retrode_pad_packet_handler(&device->pad_data[packet[0] - 1], &device->data[0], len);
}

static void hidpad_retrode_set_rumble(void *data,
Expand Down
18 changes: 9 additions & 9 deletions menu/cbs/menu_cbs_deferred_push.c
Original file line number Diff line number Diff line change
Expand Up @@ -353,11 +353,11 @@ static int deferred_push_cursor_manager_list_generic(
menu_displaylist_info_t *info, enum database_query_type type)
{
char query[256];
char *tok, *save;
char *elem0 = NULL;
char *elem1 = NULL;
char *path_cpy = NULL;
const char *path = info->path;
char *tok, *save = NULL;
char *elem0 = NULL;
char *elem1 = NULL;
char *path_cpy = NULL;
const char *path = info->path;

if (!path)
return -1;
Expand Down Expand Up @@ -526,8 +526,8 @@ static int general_push(menu_displaylist_info_t *info,
core_info_get_list(&list);
if (list && !string_is_empty(list->all_ext))
{
char *tok, *save;
char *all_ext_cpy = strdup(list->all_ext);
char *tok, *save = NULL;
char *all_ext_cpy = strdup(list->all_ext);

/* If the current core already supports
* this extension, skip adding it */
Expand All @@ -538,8 +538,8 @@ static int general_push(menu_displaylist_info_t *info,

if (!string_is_empty(newstr2))
{
char *tok2, *save2;
char *newstr2_cpy = strdup(newstr2);
char *tok2, *save2 = NULL;
char *newstr2_cpy = strdup(newstr2);
for ( tok2 = strtok_r(newstr2_cpy, "|", &save2); tok2;
tok2 = strtok_r(NULL, "|", &save2))
{
Expand Down
16 changes: 8 additions & 8 deletions menu/cbs/menu_cbs_ok.c
Original file line number Diff line number Diff line change
Expand Up @@ -5376,8 +5376,8 @@ static int action_ok_download_generic(const char *path,
break;
case MENU_ENUM_LABEL_CB_CORE_CONTENT_DOWNLOAD:
{
char *tok, *save;
char *menu_label_cpy = strdup(menu_label);
char *tok, *save = NULL;
char *menu_label_cpy = strdup(menu_label);
if ((tok = strtok_r(menu_label_cpy, ";", &save)))
strlcpy(s, tok, sizeof(s));
free(menu_label_cpy);
Expand Down Expand Up @@ -6243,17 +6243,17 @@ static int action_ok_delete_entry(const char *path,
static int action_ok_rdb_entry_submenu(const char *path,
const char *label, unsigned type, size_t idx, size_t entry_idx)
{
char *tok, *save;
char new_str[PATH_MAX_LENGTH];
char new_label[PATH_MAX_LENGTH];
size_t _len = 0;
char *label_cpy = NULL;
char *tok, *save = NULL;
size_t _len = 0;
char *label_cpy = NULL;

if (!label)
return -1;

new_label[0] = '\0';
label_cpy = strdup(label);
new_label[0] = '\0';
label_cpy = strdup(label);

/* element 0: label */
if ((tok = strtok_r(label_cpy, "|", &save)))
Expand Down Expand Up @@ -6939,7 +6939,7 @@ static int generic_action_ok_dropdown_setting(const char *path, const char *labe
case ST_STRING_OPTIONS:
if (setting->get_string_representation)
{
char *tok, *save;
char *tok, *save = NULL;
unsigned tok_idx = 0;
char *setting_values_cpy = strdup(setting->values);

Expand Down
4 changes: 2 additions & 2 deletions menu/cbs/menu_cbs_title.c
Original file line number Diff line number Diff line change
Expand Up @@ -812,8 +812,8 @@ static int action_get_title_generic(char *s, size_t len,
{
if (!string_is_empty(path))
{
char *tok, *save;
char *path_cpy = strdup(path);
char *tok, *save = NULL;
char *path_cpy = strdup(path);

if ((tok = strtok_r(path_cpy, "|", &save)))
{
Expand Down
2 changes: 1 addition & 1 deletion menu/drivers/ozone.c
Original file line number Diff line number Diff line change
Expand Up @@ -6751,7 +6751,7 @@ static void ozone_draw_osk(
0.00, 0.00, 0.00, 0.15,
0.00, 0.00, 0.00, 0.15,
};
char *tok, *save;
char *tok, *save = NULL;
unsigned i = 0;
static retro_time_t last_time = 0;
unsigned list_size = 0;
Expand Down
2 changes: 1 addition & 1 deletion menu/drivers/rgui.c
Original file line number Diff line number Diff line change
Expand Up @@ -7166,7 +7166,7 @@ static void rgui_update_menu_sublabel(rgui_t *rgui, size_t selection)

if (!string_is_empty(entry.sublabel))
{
char *tok, *save;
char *tok, *save = NULL;
static const char* const
sublabel_spacer = RGUI_TICKER_SPACER;
bool prev_line_empty = true;
Expand Down
6 changes: 3 additions & 3 deletions menu/menu_displaylist.c
Original file line number Diff line number Diff line change
Expand Up @@ -13073,7 +13073,7 @@ bool menu_displaylist_ctl(enum menu_displaylist_ctl_state type,
#endif
if (!string_is_empty(info->label))
{
char *tok, *save;
char *tok, *save = NULL;
char *info_label_cpy = strdup(info->label);

if ((tok = strtok_r(info_label_cpy, "|", &save)))
Expand Down Expand Up @@ -15594,7 +15594,7 @@ bool menu_displaylist_ctl(enum menu_displaylist_ctl_state type,
case ST_STRING_OPTIONS:
{
char val_d[16];
char *tok, *save;
char *tok, *save = NULL;
unsigned i = 0;
bool checked_found = false;
unsigned checked = 0;
Expand Down Expand Up @@ -15943,7 +15943,7 @@ bool menu_displaylist_ctl(enum menu_displaylist_ctl_state type,
case ST_STRING_OPTIONS:
{
char val_d[16];
char *tok, *save;
char *tok, *save = NULL;
unsigned i = 0;
bool checked_found = false;
unsigned checked = 0;
Expand Down
2 changes: 1 addition & 1 deletion playlist.c
Original file line number Diff line number Diff line change
Expand Up @@ -2823,7 +2823,7 @@ static bool playlist_read_file(playlist_t *playlist)
line_buf[3], thumbnail_mode_str,
sizeof(thumbnail_mode_str)) > 0)
{
char *tok, *save;
char *tok, *save = NULL;
char *thumbnail_mode_str_cpy = strdup(thumbnail_mode_str);

if ((tok = strtok_r(thumbnail_mode_str_cpy, "|", &save)))
Expand Down
2 changes: 1 addition & 1 deletion tasks/task_content.c
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ bool content_file_override_set(

for (i = 0; overrides[i].extensions; i++)
{
char *tok, *save;
char *tok, *save = NULL;
char *overrides_ext_cpy = strdup(overrides[i].extensions);

/* Get list of extensions affected by overrides */
Expand Down
6 changes: 3 additions & 3 deletions tasks/task_overlay.c
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,8 @@ static void task_overlay_load_desc_image(
static void task_overlay_redefine_eightway_direction(
char *str, input_bits_t *data)
{
char *tok, *save;
unsigned bit;
char *tok, *save = NULL;

BIT256_CLEAR_ALL(*data);

Expand Down Expand Up @@ -230,7 +230,7 @@ static bool task_overlay_load_desc(
char overlay_desc_key[32];
char overlay_key[64];
char overlay[256];
char *tok, *save;
char *tok, *save = NULL;
unsigned list_size = 0;
char *elem0 = NULL;
char *elem1 = NULL;
Expand Down Expand Up @@ -835,7 +835,7 @@ static void task_overlay_deferred_load(retro_task_t *task)
if (config_get_array(conf, overlay->config.rect.key,
overlay->config.rect.array, sizeof(overlay->config.rect.array)))
{
char *tok, *save;
char *tok, *save = NULL;
char *elem0 = NULL;
char *elem1 = NULL;
char *elem2 = NULL;
Expand Down

0 comments on commit e2c8e98

Please sign in to comment.