1
0
mirror of https://github.com/libretro/RetroArch synced 2024-07-05 09:48:42 +00:00

Silence more Clang warnings

This commit is contained in:
twinaphex 2017-10-11 22:49:13 +02:00
parent 7cf1793801
commit c68db61188
6 changed files with 36 additions and 28 deletions

View File

@ -748,6 +748,7 @@ void state_tracker_update_input(uint16_t *input1, uint16_t *input2)
binds,
0, RETRO_DEVICE_JOYPAD, 0, id) ? 1 : 0) << i;
}
if (binds[1][id].valid)
{
joypad_info.joy_idx = settings->uints.input_joypad_map[1];
@ -2316,7 +2317,7 @@ void input_config_parse_joy_button(void *data, const char *prefix,
}
}
if (config_get_string(conf, key_label, &tmp_a))
if (bind && config_get_string(conf, key_label, &tmp_a))
{
if (!string_is_empty(bind->joykey_label))
free(bind->joykey_label);

View File

@ -716,8 +716,8 @@ static struct buffer query_parse_method_call(struct buffer buff,
goto clean;
invocation->argc = argi;
invocation->argv = (struct argument*)
malloc(sizeof(struct argument) * argi);
invocation->argv = (argi > 0) ? (struct argument*)
malloc(sizeof(struct argument) * argi) : NULL;
if (!invocation->argv)
{

View File

@ -175,7 +175,7 @@ void path_set_redirect(void)
{
fill_pathname_dir(global->name.savefile,
!string_is_empty(path_main_basename) ? path_main_basename :
info->info.library_name,
info ? info->info.library_name : NULL,
file_path_str(FILE_PATH_SRM_EXTENSION),
sizeof(global->name.savefile));
RARCH_LOG("%s \"%s\".\n",
@ -187,7 +187,7 @@ void path_set_redirect(void)
{
fill_pathname_dir(global->name.savestate,
!string_is_empty(path_main_basename) ? path_main_basename :
info->info.library_name,
info ? info->info.library_name : NULL,
file_path_str(FILE_PATH_STATE_EXTENSION),
sizeof(global->name.savestate));
RARCH_LOG("%s \"%s\".\n",

View File

@ -344,27 +344,30 @@ bool playlist_push(playlist_t *playlist,
playlist->size--;
}
memmove(playlist->entries + 1, playlist->entries,
(playlist->cap - 1) * sizeof(struct playlist_entry));
if (playlist->entries)
{
memmove(playlist->entries + 1, playlist->entries,
(playlist->cap - 1) * sizeof(struct playlist_entry));
playlist->entries[0].path = NULL;
playlist->entries[0].label = NULL;
playlist->entries[0].core_path = NULL;
playlist->entries[0].core_name = NULL;
playlist->entries[0].db_name = NULL;
playlist->entries[0].crc32 = NULL;
if (!string_is_empty(path))
playlist->entries[0].path = strdup(path);
if (!string_is_empty(label))
playlist->entries[0].label = strdup(label);
if (!string_is_empty(core_path))
playlist->entries[0].core_path = strdup(core_path);
if (!string_is_empty(core_name))
playlist->entries[0].core_name = strdup(core_name);
if (!string_is_empty(db_name))
playlist->entries[0].db_name = strdup(db_name);
if (!string_is_empty(crc32))
playlist->entries[0].crc32 = strdup(crc32);
playlist->entries[0].path = NULL;
playlist->entries[0].label = NULL;
playlist->entries[0].core_path = NULL;
playlist->entries[0].core_name = NULL;
playlist->entries[0].db_name = NULL;
playlist->entries[0].crc32 = NULL;
if (!string_is_empty(path))
playlist->entries[0].path = strdup(path);
if (!string_is_empty(label))
playlist->entries[0].label = strdup(label);
if (!string_is_empty(core_path))
playlist->entries[0].core_path = strdup(core_path);
if (!string_is_empty(core_name))
playlist->entries[0].core_name = strdup(core_name);
if (!string_is_empty(db_name))
playlist->entries[0].db_name = strdup(db_name);
if (!string_is_empty(crc32))
playlist->entries[0].crc32 = strdup(crc32);
}
playlist->size++;

View File

@ -1304,7 +1304,7 @@ bool task_push_start_current_core(content_ctx_info_t *content_info)
/* Load content */
if (firmware_update_status(&content_ctx))
return true;
goto end;
if (!task_load_content(content_info, &content_ctx,
true, false, &error_string))
@ -1433,7 +1433,7 @@ bool task_push_load_content_with_new_core_from_menu(
content_info->environ_get = menu_content_environment_get;
if (firmware_update_status(&content_ctx))
return true;
goto end;
if (!task_load_content(content_info, &content_ctx,
true, false, &error_string))
@ -1528,10 +1528,11 @@ static bool task_load_content_callback(content_ctx_info_t *content_info,
#endif
if (firmware_update_status(&content_ctx))
return true;
goto end;
ret = task_load_content(content_info, &content_ctx, true, loading_from_cli, &error_string);
end:
if (content_ctx.name_ips)
free(content_ctx.name_ips);
if (content_ctx.name_bps)

View File

@ -627,6 +627,9 @@ static void task_save_handler(retro_task_t *task)
task_save_handler_finished(task, state);
if (!string_is_empty(msg))
free(msg);
return;
}
}