Rename success variables to ret

This commit is contained in:
libretroadmin 2025-09-12 05:41:22 +02:00
parent 3dfa5cb02d
commit c4b655a583
10 changed files with 55 additions and 61 deletions

View File

@ -3987,7 +3987,7 @@ static int action_ok_remap_file_flush(const char *path,
runloop_state_t *runloop_st = runloop_state_get_ptr();
const char *path_remapfile = runloop_st->name.remapfile;
const char *remapfile = NULL;
bool success = false;
bool ret = false;
msg[0] = '\0';
@ -3995,7 +3995,7 @@ static int action_ok_remap_file_flush(const char *path,
if (!string_is_empty(path_remapfile))
{
/* Update existing remap file */
success = input_remapping_save_file(path_remapfile);
ret = input_remapping_save_file(path_remapfile);
/* Get remap file name for display purposes */
remapfile = path_basename_nocompression(path_remapfile);
}
@ -4004,7 +4004,7 @@ static int action_ok_remap_file_flush(const char *path,
remapfile = msg_hash_to_str(MENU_ENUM_LABEL_VALUE_UNKNOWN);
/* Log result */
if (success)
if (ret)
{
/* TODO/FIXME - localize */
RARCH_LOG(
@ -4027,7 +4027,7 @@ static int action_ok_remap_file_flush(const char *path,
runloop_msg_queue_push(msg, _len, 1, 100, true, NULL,
MESSAGE_QUEUE_ICON_DEFAULT,
(success) ? MESSAGE_QUEUE_CATEGORY_SUCCESS : MESSAGE_QUEUE_CATEGORY_ERROR);
ret ? MESSAGE_QUEUE_CATEGORY_SUCCESS : MESSAGE_QUEUE_CATEGORY_ERROR);
return 0;
}
@ -5001,14 +5001,14 @@ static int action_ok_core_updater_list(const char *path,
* interface */
struct string_list *available_cores =
play_feature_delivery_available_cores();
bool success = false;
bool ret = false;
if (!available_cores)
return -1;
core_updater_list_reset(core_list);
success = core_updater_list_parse_pfd_data(
ret = core_updater_list_parse_pfd_data(
core_list,
path_dir_libretro,
path_libretro_info,
@ -5016,7 +5016,7 @@ static int action_ok_core_updater_list(const char *path,
string_list_free(available_cores);
if (!success)
if (!ret)
return -1;
/* Ensure network is initialised */

View File

@ -3098,7 +3098,7 @@ static void rgui_load_custom_theme(
unsigned particle_color = 0;
config_file_t *conf = NULL;
const char *wallpaper_key = NULL;
bool success = false;
bool ret = false;
#if defined(DINGUX)
menu_rgui_aspect_ratio = RGUI_DINGUX_ASPECT_RATIO;
#endif
@ -3178,11 +3178,11 @@ static void rgui_load_custom_theme(
particle_color = (normal_color & 0x00FFFFFF) |
(bg_light_color & 0xFF000000);
success = true;
ret = true;
end:
if (success)
if (ret)
{
theme_colors->normal_color = (uint32_t)normal_color;
theme_colors->hover_color = (uint32_t)hover_color;

View File

@ -4213,7 +4213,7 @@ static bool xmb_animation_line_ticker(gfx_animation_t *p_anim, gfx_animation_ctx
size_t line_ticker_str_len = 0;
struct string_list lines = {0};
size_t line_offset = 0;
bool success = false;
bool ret = false;
bool is_active = false;
/* Sanity check */
@ -4253,7 +4253,7 @@ static bool xmb_animation_line_ticker(gfx_animation_t *p_anim, gfx_animation_ctx
if (lines.size <= line_ticker->max_lines)
{
strlcpy(line_ticker->s, wrapped_str, line_ticker->len);
success = true;
ret = true;
goto end;
}
@ -4282,7 +4282,7 @@ static bool xmb_animation_line_ticker(gfx_animation_t *p_anim, gfx_animation_ctx
line_ticker->max_lines, line_offset, &lines, lines.size,
line_ticker->s, line_ticker->len);
success = true;
ret = true;
is_active = true;
p_anim->flags |= GFX_ANIM_FLAG_TICKER_IS_ACTIVE;
@ -4295,7 +4295,7 @@ end:
}
string_list_deinitialize(&lines);
if (!success)
if (!ret)
if (line_ticker->len > 0)
line_ticker->s[0] = '\0';
@ -4513,7 +4513,7 @@ static bool xmb_animation_line_ticker_smooth(gfx_animation_t *p_anim, gfx_animat
size_t top_fade_line_offset = 0;
size_t bottom_fade_line_offset = 0;
bool fade_active = false;
bool success = false;
bool ret = false;
bool is_active = false;
int wideglyph_width = 100;
size_t (*word_wrap_func)(char *dst, size_t dst_size,
@ -4615,7 +4615,7 @@ static bool xmb_animation_line_ticker_smooth(gfx_animation_t *p_anim, gfx_animat
*line_ticker->bottom_fade_alpha = 0.0f;
}
success = true;
ret = true;
goto end;
}
@ -4671,7 +4671,7 @@ static bool xmb_animation_line_ticker_smooth(gfx_animation_t *p_anim, gfx_animat
line_ticker->bottom_fade_str_len);
}
success = true;
ret = true;
is_active = true;
p_anim->flags |= GFX_ANIM_FLAG_TICKER_IS_ACTIVE;
@ -4685,7 +4685,7 @@ end:
string_list_deinitialize(&lines);
if (!success)
if (!ret)
{
if (line_ticker->dst_str_len > 0)
line_ticker->dst_str[0] = '\0';

View File

@ -491,15 +491,15 @@ bool play_feature_delivery_download(const char *core_file)
play_feature_delivery_state_t* state = play_feature_delivery_get_state();
JNIEnv *env = jni_thread_getenv();
struct android_app *app = (struct android_app*)g_android;
bool success = false;
bool ret = false;
char core_name[256];
jstring core_name_jni;
core_name[0] = '\0';
if (!env ||
!app ||
!app->downloadCore)
if ( !env
|| !app
|| !app->downloadCore)
return false;
/* Extract core name */
@ -532,7 +532,7 @@ bool play_feature_delivery_download(const char *core_file)
/* Free core_name_jni reference */
(*env)->DeleteLocalRef(env, core_name_jni);
success = true;
ret = true;
}
/* Unlock mutex */
@ -540,7 +540,7 @@ bool play_feature_delivery_download(const char *core_file)
slock_unlock(state->status_lock);
#endif
return success;
return ret;
}
/* Deletes specified core.
@ -554,9 +554,9 @@ bool play_feature_delivery_delete(const char *core_file)
core_name[0] = '\0';
if (!env ||
!app ||
!app->deleteCore)
if ( !env
|| !app
|| !app->deleteCore)
return false;
/* Extract core name */

View File

@ -5301,7 +5301,7 @@ void core_options_flush(void)
core_option_manager_t *coreopts = runloop_st->core_options;
const char *path_core_options = path_get(RARCH_PATH_CORE_OPTIONS);
const char *core_options_file = NULL;
bool success = false;
bool ret = false;
msg[0] = '\0';
@ -5329,7 +5329,7 @@ void core_options_flush(void)
{
core_option_manager_flush(runloop_st->core_options, conf_tmp);
success = config_file_write(conf_tmp, path_core_options, true);
ret = config_file_write(conf_tmp, path_core_options, true);
config_file_free(conf_tmp);
}
}
@ -5353,7 +5353,7 @@ void core_options_flush(void)
if (!path_is_valid(path_core_options))
runloop_st->core_options->conf->flags |= CONF_FILE_FLG_MODIFIED;
success = config_file_write(runloop_st->core_options->conf,
ret = config_file_write(runloop_st->core_options->conf,
path_core_options, true);
}
}
@ -5365,7 +5365,7 @@ void core_options_flush(void)
if (string_is_empty(core_options_file))
core_options_file = msg_hash_to_str(MENU_ENUM_LABEL_VALUE_UNKNOWN);
if (success)
if (ret)
{
/* Log result */
_len = strlcpy(msg, msg_hash_to_str(MSG_CORE_OPTIONS_FLUSHED),

6
save.c
View File

@ -512,7 +512,7 @@ bool event_save_files(bool is_sram_used, bool compress_files,
bool event_load_save_files(bool is_sram_load_disabled)
{
unsigned i;
bool success = false;
bool ret = false;
if (!task_save_files || is_sram_load_disabled)
return false;
@ -521,9 +521,9 @@ bool event_load_save_files(bool is_sram_load_disabled)
* any type of RAM file is found and
* processed correctly */
for (i = 0; i < task_save_files->size; i++)
success |= content_load_ram_file(i);
ret |= content_load_ram_file(i);
return success;
return ret;
}
void path_init_savefile_rtc(const char *savefile_path)

View File

@ -161,7 +161,7 @@ static const blissbox_pad_type_t* input_autoconfigure_get_blissbox_pad_type_win3
SP_DEVICE_INTERFACE_DATA deviceInterfaceData;
HANDLE hDeviceHandle = INVALID_HANDLE_VALUE;
BOOL bResult = TRUE;
BOOL success = FALSE;
BOOL ret = FALSE;
GUID guidDeviceInterface = {0};
PSP_DEVICE_INTERFACE_DETAIL_DATA
pInterfaceDetailData = NULL;
@ -200,9 +200,9 @@ static const blissbox_pad_type_t* input_autoconfigure_get_blissbox_pad_type_win3
/* Enumerate all the device interfaces in the device information set. */
device_info_data.cbSize = sizeof(SP_DEVINFO_DATA);
while (!success)
while (!ret)
{
success = SetupDiEnumDeviceInfo(hDeviceInfo, index, &device_info_data);
ret = SetupDiEnumDeviceInfo(hDeviceInfo, index, &device_info_data);
/* Reset for this iteration */
if (lp_device_path)
@ -314,7 +314,7 @@ static const blissbox_pad_type_t* input_autoconfigure_get_blissbox_pad_type_win3
goto found;
}
success = FALSE;
ret = FALSE;
index++;
}

View File

@ -1397,7 +1397,7 @@ static bool content_load(content_ctx_info_t *info,
content_state_t *p_content)
{
size_t i;
bool success = false;
bool ret = false;
int rarch_argc = 0;
char *rarch_argv[MAX_ARGS] = {NULL};
char *argv_copy [MAX_ARGS] = {NULL};
@ -1439,13 +1439,13 @@ static bool content_load(content_ctx_info_t *info,
wrap_args->argc = *rarch_argc_ptr;
wrap_args->argv = rarch_argv_ptr;
success = retroarch_main_init(wrap_args->argc, wrap_args->argv);
ret = retroarch_main_init(wrap_args->argc, wrap_args->argv);
for (i = 0; i < ARRAY_SIZE(argv_copy); i++)
free(argv_copy[i]);
free(wrap_args);
if (!success)
if (!ret)
return false;
if (p_content->flags & CONTENT_ST_FLAG_PENDING_SUBSYSTEM_INIT)

View File

@ -194,14 +194,14 @@ static uint32_t task_core_updater_get_core_crc(const char *core_path)
{
uint32_t crc = 0;
/* Get CRC value */
bool success = intfstream_get_crc(core_file, &crc);
bool ret = intfstream_get_crc(core_file, &crc);
/* Close core file */
intfstream_close(core_file);
free(core_file);
core_file = NULL;
if (success)
if (ret)
return crc;
}
@ -216,9 +216,9 @@ static void cb_http_task_core_updater_get_list(
retro_task_t *task, void *task_data,
void *user_data, const char *err)
{
file_transfer_t *transf = (file_transfer_t*)user_data;
http_transfer_data_t *data = (http_transfer_data_t*)task_data;
bool success = data && string_is_empty(err);
file_transfer_t *transf = (file_transfer_t*)user_data;
http_transfer_data_t *data = (http_transfer_data_t*)task_data;
bool ret = data && string_is_empty(err);
if (transf)
{
@ -229,12 +229,12 @@ static void cb_http_task_core_updater_get_list(
list_handle->http_data = data;
list_handle->http_task_complete = true;
list_handle->http_task_success = success;
list_handle->http_task_success = ret;
}
}
/* Log any error messages */
if (!success)
if (!ret)
RARCH_ERR("[Core Updater] Download of core list \"%s\" failed: %s.\n",
(transf ? transf->path: "unknown"),
(err ? err : "unknown"));
@ -1947,7 +1947,7 @@ static void task_play_feature_delivery_switch_cores_handler(
* core list' error */
struct string_list *available_cores =
play_feature_delivery_available_cores();
bool success = false;
bool ret = false;
if (!available_cores)
{
@ -1957,7 +1957,7 @@ static void task_play_feature_delivery_switch_cores_handler(
}
/* Populate core updater list */
success = core_updater_list_parse_pfd_data(
ret = core_updater_list_parse_pfd_data(
pfd_switch_cores_handle->core_list,
pfd_switch_cores_handle->path_dir_libretro,
pfd_switch_cores_handle->path_libretro_info,
@ -1966,7 +1966,7 @@ static void task_play_feature_delivery_switch_cores_handler(
string_list_free(available_cores);
/* Cache list size */
if (success)
if (ret)
pfd_switch_cores_handle->list_size =
core_updater_list_size(pfd_switch_cores_handle->core_list);

View File

@ -327,12 +327,9 @@ bool MainWindow::addDirectoryFilesToList(QProgressDialog *dialog,
if (fileInfo.isDir())
{
QDir fileInfoDir(path);
bool success = addDirectoryFilesToList(
dialog, list, fileInfoDir, extensions);
if (!success)
if (!addDirectoryFilesToList(
dialog, list, fileInfoDir, extensions))
return false;
continue;
}
@ -523,12 +520,9 @@ void MainWindow::addFilesToPlaylist(QStringList files)
if (fileInfo.isDir())
{
QDir dir(path);
bool success = addDirectoryFilesToList(
dialog.data(), list, dir, selectedExtensions);
if (!success)
if (!addDirectoryFilesToList(
dialog.data(), list, dir, selectedExtensions))
return;
continue;
}