mirror of
https://github.com/CTCaer/RetroArch.git
synced 2025-02-20 19:40:39 +00:00
stdstring - create string_is_equal
This commit is contained in:
parent
da2ce48fb2
commit
454abdee48
@ -1343,7 +1343,7 @@ static bool config_load_file(const char *path, bool set_defaults)
|
||||
&settings->menu.title_color);
|
||||
config_get_path(conf, "menu_wallpaper",
|
||||
settings->menu.wallpaper, sizeof(settings->menu.wallpaper));
|
||||
if (!strcmp(settings->menu.wallpaper, "default"))
|
||||
if (string_is_equal(settings->menu.wallpaper, "default"))
|
||||
*settings->menu.wallpaper = '\0';
|
||||
#endif
|
||||
|
||||
@ -1416,15 +1416,15 @@ static bool config_load_file(const char *path, bool set_defaults)
|
||||
CONFIG_GET_BOOL_BASE(conf, settings, video.gpu_screenshot, "video_gpu_screenshot");
|
||||
|
||||
config_get_path(conf, "video_shader_dir", settings->video.shader_dir, sizeof(settings->video.shader_dir));
|
||||
if (!strcmp(settings->video.shader_dir, "default"))
|
||||
if (string_is_equal(settings->video.shader_dir, "default"))
|
||||
*settings->video.shader_dir = '\0';
|
||||
|
||||
config_get_path(conf, "video_filter_dir", settings->video.filter_dir, sizeof(settings->video.filter_dir));
|
||||
if (!strcmp(settings->video.filter_dir, "default"))
|
||||
if (string_is_equal(settings->video.filter_dir, "default"))
|
||||
*settings->video.filter_dir = '\0';
|
||||
|
||||
config_get_path(conf, "audio_filter_dir", settings->audio.filter_dir, sizeof(settings->audio.filter_dir));
|
||||
if (!strcmp(settings->audio.filter_dir, "default"))
|
||||
if (string_is_equal(settings->audio.filter_dir, "default"))
|
||||
*settings->audio.filter_dir = '\0';
|
||||
|
||||
CONFIG_GET_BOOL_BASE(conf, settings, input.back_as_menu_toggle_enable, "back_as_menu_toggle_enable");
|
||||
@ -1547,7 +1547,7 @@ static bool config_load_file(const char *path, bool set_defaults)
|
||||
config_get_path(conf, "screenshot_directory", settings->screenshot_directory, sizeof(settings->screenshot_directory));
|
||||
if (*settings->screenshot_directory)
|
||||
{
|
||||
if (!strcmp(settings->screenshot_directory, "default"))
|
||||
if (string_is_equal(settings->screenshot_directory, "default"))
|
||||
*settings->screenshot_directory = '\0';
|
||||
else if (!path_is_directory(settings->screenshot_directory))
|
||||
{
|
||||
@ -1574,24 +1574,24 @@ static bool config_load_file(const char *path, bool set_defaults)
|
||||
sizeof(settings->boxarts_directory));
|
||||
config_get_path(conf, "playlist_directory", settings->playlist_directory,
|
||||
sizeof(settings->playlist_directory));
|
||||
if (!strcmp(settings->core_assets_directory, "default"))
|
||||
if (string_is_equal(settings->core_assets_directory, "default"))
|
||||
*settings->core_assets_directory = '\0';
|
||||
if (!strcmp(settings->assets_directory, "default"))
|
||||
if (string_is_equal(settings->assets_directory, "default"))
|
||||
*settings->assets_directory = '\0';
|
||||
if (!strcmp(settings->dynamic_wallpapers_directory, "default"))
|
||||
if (string_is_equal(settings->dynamic_wallpapers_directory, "default"))
|
||||
*settings->dynamic_wallpapers_directory = '\0';
|
||||
if (!strcmp(settings->boxarts_directory, "default"))
|
||||
if (string_is_equal(settings->boxarts_directory, "default"))
|
||||
*settings->boxarts_directory = '\0';
|
||||
if (!strcmp(settings->playlist_directory, "default"))
|
||||
if (string_is_equal(settings->playlist_directory, "default"))
|
||||
*settings->playlist_directory = '\0';
|
||||
#ifdef HAVE_MENU
|
||||
config_get_path(conf, "rgui_browser_directory", settings->menu_content_directory,
|
||||
sizeof(settings->menu_content_directory));
|
||||
if (!strcmp(settings->menu_content_directory, "default"))
|
||||
if (string_is_equal(settings->menu_content_directory, "default"))
|
||||
*settings->menu_content_directory = '\0';
|
||||
config_get_path(conf, "rgui_config_directory", settings->menu_config_directory,
|
||||
sizeof(settings->menu_config_directory));
|
||||
if (!strcmp(settings->menu_config_directory, "default"))
|
||||
if (string_is_equal(settings->menu_config_directory, "default"))
|
||||
*settings->menu_config_directory = '\0';
|
||||
CONFIG_GET_BOOL_BASE(conf, settings, menu_show_start_screen, "rgui_show_start_screen");
|
||||
#endif
|
||||
@ -1631,7 +1631,7 @@ static bool config_load_file(const char *path, bool set_defaults)
|
||||
|
||||
#ifdef HAVE_OVERLAY
|
||||
config_get_path(conf, "overlay_directory", settings->overlay_directory, sizeof(settings->overlay_directory));
|
||||
if (!strcmp(settings->overlay_directory, "default"))
|
||||
if (string_is_equal(settings->overlay_directory, "default"))
|
||||
*settings->overlay_directory = '\0';
|
||||
|
||||
config_get_path(conf, "input_overlay", settings->input.overlay, sizeof(settings->input.overlay));
|
||||
@ -1642,7 +1642,7 @@ static bool config_load_file(const char *path, bool set_defaults)
|
||||
CONFIG_GET_FLOAT_BASE(conf, settings, input.overlay_scale, "input_overlay_scale");
|
||||
|
||||
config_get_path(conf, "osk_overlay_directory", global->dir.osk_overlay, sizeof(global->dir.osk_overlay));
|
||||
if (!strcmp(global->dir.osk_overlay, "default"))
|
||||
if (string_is_equal(global->dir.osk_overlay, "default"))
|
||||
*global->dir.osk_overlay = '\0';
|
||||
|
||||
config_get_path(conf, "input_osk_overlay", settings->osk.overlay, sizeof(settings->osk.overlay));
|
||||
@ -1752,7 +1752,7 @@ static bool config_load_file(const char *path, bool set_defaults)
|
||||
if (!global->has_set.save_path &&
|
||||
config_get_path(conf, "savefile_directory", tmp_str, sizeof(tmp_str)))
|
||||
{
|
||||
if (!strcmp(tmp_str, "default"))
|
||||
if (string_is_equal(tmp_str, "default"))
|
||||
strlcpy(global->dir.savefile, g_defaults.dir.sram,
|
||||
sizeof(global->dir.savefile));
|
||||
else if (path_is_directory(tmp_str))
|
||||
@ -1771,7 +1771,7 @@ static bool config_load_file(const char *path, bool set_defaults)
|
||||
if (!global->has_set.state_path &&
|
||||
config_get_path(conf, "savestate_directory", tmp_str, sizeof(tmp_str)))
|
||||
{
|
||||
if (!strcmp(tmp_str, "default"))
|
||||
if (string_is_equal(tmp_str, "default"))
|
||||
strlcpy(global->dir.savestate, g_defaults.dir.savestate,
|
||||
sizeof(global->dir.savestate));
|
||||
else if (path_is_directory(tmp_str))
|
||||
@ -1811,7 +1811,7 @@ static bool config_load_file(const char *path, bool set_defaults)
|
||||
*settings->system_directory = '\0';
|
||||
}
|
||||
|
||||
if (!strcmp(settings->system_directory, "default"))
|
||||
if (string_is_equal(settings->system_directory, "default"))
|
||||
{
|
||||
RARCH_WARN("SYSTEM DIR is empty, assume CONTENT DIR\n");
|
||||
*settings->system_directory = '\0';
|
||||
@ -1941,7 +1941,7 @@ bool config_load_override(void)
|
||||
}
|
||||
|
||||
/* Early return in case a library isn't loaded */
|
||||
if (string_is_empty(system->info.library_name) || !strcmp(system->info.library_name,"No Core"))
|
||||
if (string_is_empty(system->info.library_name) || string_is_equal(system->info.library_name, "No Core"))
|
||||
return false;
|
||||
|
||||
core_name = system ? system->info.library_name : NULL;
|
||||
@ -2123,7 +2123,7 @@ bool config_load_remap(void)
|
||||
runloop_ctl(RUNLOOP_CTL_SYSTEM_INFO_GET, &system);
|
||||
|
||||
/* Early return in case a library isn't loaded or remapping is disabled */
|
||||
if (!system->info.library_name || !strcmp(system->info.library_name,"No Core"))
|
||||
if (!system->info.library_name || string_is_equal(system->info.library_name,"No Core"))
|
||||
return false;
|
||||
|
||||
core_name = system ? system->info.library_name : NULL;
|
||||
|
15
core_info.c
15
core_info.c
@ -18,6 +18,8 @@
|
||||
#include <file/file_path.h>
|
||||
#include <file/file_extract.h>
|
||||
|
||||
#include <string/stdstring.h>
|
||||
|
||||
#include "core_info.h"
|
||||
#include "general.h"
|
||||
#include "dir_list_special.h"
|
||||
@ -136,7 +138,7 @@ void core_info_get_name(const char *path, char *s, size_t len)
|
||||
if (!core_info[i].path)
|
||||
break;
|
||||
|
||||
if (strcmp(core_info[i].path, path) != 0)
|
||||
if (!string_is_equal(core_info[i].path, path))
|
||||
continue;
|
||||
|
||||
fill_pathname_base(info_path_base, contents->elems[i].data,
|
||||
@ -377,7 +379,7 @@ bool core_info_list_get_display_name(core_info_list_t *core_info_list,
|
||||
for (i = 0; i < core_info_list->count; i++)
|
||||
{
|
||||
const core_info_t *info = &core_info_list->list[i];
|
||||
if (!strcmp(path_basename(info->path), path_basename(path))
|
||||
if (string_is_equal(path_basename(info->path), path_basename(path))
|
||||
&& info->display_name)
|
||||
{
|
||||
strlcpy(buf, info->display_name, size);
|
||||
@ -440,7 +442,8 @@ bool core_info_list_get_info(core_info_list_t *core_info_list,
|
||||
for (i = 0; i < core_info_list->count; i++)
|
||||
{
|
||||
const core_info_t *info = &core_info_list->list[i];
|
||||
if (!strcmp(path_basename(info->path), path_basename(path)))
|
||||
|
||||
if (string_is_equal(path_basename(info->path), path_basename(path)))
|
||||
{
|
||||
*out_info = *info;
|
||||
return true;
|
||||
@ -559,11 +562,9 @@ core_info_t *core_info_find(core_info_list_t *list,
|
||||
{
|
||||
core_info_t *info = (core_info_t*)&list->list[i];
|
||||
|
||||
if (!info)
|
||||
if (!info || !info->path)
|
||||
continue;
|
||||
if (!info->path)
|
||||
continue;
|
||||
if (!strcmp(info->path, core))
|
||||
if (string_is_equal(info->path, core))
|
||||
return info;
|
||||
}
|
||||
|
||||
|
@ -21,6 +21,7 @@
|
||||
#include <compat/posix_string.h>
|
||||
#include <compat/strl.h>
|
||||
#include <retro_miscellaneous.h>
|
||||
#include <string/stdstring.h>
|
||||
|
||||
#include "core_options.h"
|
||||
|
||||
@ -79,7 +80,7 @@ void core_option_get(core_option_manager_t *opt, struct retro_variable *var)
|
||||
|
||||
for (i = 0; i < opt->size; i++)
|
||||
{
|
||||
if (!strcmp(opt->opts[i].key, var->key))
|
||||
if (string_is_equal(opt->opts[i].key, var->key))
|
||||
{
|
||||
var->value = core_option_get_val(opt, i);
|
||||
return;
|
||||
@ -129,7 +130,7 @@ static bool parse_variable(core_option_manager_t *opt, size_t idx,
|
||||
|
||||
for (i = 0; i < option->vals->size; i++)
|
||||
{
|
||||
if (!strcmp(option->vals->elems[i].data, config_val))
|
||||
if (string_is_equal(option->vals->elems[i].data, config_val))
|
||||
{
|
||||
option->index = i;
|
||||
break;
|
||||
|
2
driver.c
2
driver.c
@ -188,7 +188,7 @@ bool find_prev_driver(const char *label, char *s, size_t len)
|
||||
bool find_next_driver(const char *label, char *s, size_t len)
|
||||
{
|
||||
int i = find_driver_index(label, s);
|
||||
if (i >= 0 && (strcmp(s, "null") != 0))
|
||||
if (i >= 0 && !string_is_equal(s, "null"))
|
||||
find_driver_nonempty(label, i + 1, s, len);
|
||||
else
|
||||
{
|
||||
|
@ -213,9 +213,9 @@ const struct retro_subsystem_info *libretro_find_subsystem_info(
|
||||
unsigned i;
|
||||
for (i = 0; i < num_info; i++)
|
||||
{
|
||||
if (!strcmp(info[i].ident, ident))
|
||||
if (string_is_equal(info[i].ident, ident))
|
||||
return &info[i];
|
||||
else if (!strcmp(info[i].desc, ident))
|
||||
else if (string_is_equal(info[i].desc, ident))
|
||||
return &info[i];
|
||||
}
|
||||
|
||||
|
@ -32,6 +32,7 @@
|
||||
#include <file/file_path.h>
|
||||
#include <retro_file.h>
|
||||
#include <string/string_list.h>
|
||||
#include <string/stdstring.h>
|
||||
#ifdef HAVE_COMPRESSION
|
||||
#include <file/file_extract.h>
|
||||
#endif
|
||||
@ -162,7 +163,7 @@ static int read_7zip_file(
|
||||
SzArEx_GetFileNameUtf16(&db, i, temp);
|
||||
res = utf16_to_char_string(temp, infile, sizeof(infile)) ? SZ_OK : SZ_ERROR_FAIL;
|
||||
|
||||
if (!strcmp(infile, relative_path))
|
||||
if (string_is_equal(infile, relative_path))
|
||||
{
|
||||
/* C LZMA SDK does not support chunked extraction - see here:
|
||||
* sourceforge.net/p/sevenzip/discussion/45798/thread/6fb59aaf/
|
||||
@ -399,7 +400,7 @@ static int read_zip_file(const char *archive_path,
|
||||
|
||||
/* We skip directories */
|
||||
if ( last_char == '/' || last_char == '\\' ) { }
|
||||
else if (!strcmp(filename, relative_path))
|
||||
else if (string_is_equal(filename, relative_path))
|
||||
{
|
||||
/* We found the correct file in the zip,
|
||||
* now extract it to *buf. */
|
||||
|
@ -22,6 +22,7 @@
|
||||
#include <compat/strl.h>
|
||||
#include <file/file_path.h>
|
||||
#include <rhash.h>
|
||||
#include <string/stdstring.h>
|
||||
|
||||
#include "../general.h"
|
||||
#include "../verbosity.h"
|
||||
@ -369,7 +370,7 @@ static struct video_shader_parameter *video_shader_parse_find_parameter(
|
||||
|
||||
for (i = 0; i < num_params; i++)
|
||||
{
|
||||
if (!strcmp(params[i].id, id))
|
||||
if (string_is_equal(params[i].id, id))
|
||||
return ¶ms[i];
|
||||
}
|
||||
|
||||
@ -915,9 +916,9 @@ enum rarch_shader_type video_shader_parse_type(const char *path,
|
||||
|
||||
ext = path_get_extension(path);
|
||||
|
||||
if (!strcmp(ext, "cg") || !strcmp(ext, "cgp"))
|
||||
if (string_is_equal(ext, "cg") || string_is_equal(ext, "cgp"))
|
||||
return RARCH_SHADER_CG;
|
||||
else if (!strcmp(ext, "glslp") || !strcmp(ext, "glsl"))
|
||||
else if (string_is_equal(ext, "glslp") || string_is_equal(ext, "glsl"))
|
||||
return RARCH_SHADER_GLSL;
|
||||
|
||||
return fallback;
|
||||
|
@ -17,6 +17,8 @@
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <string/stdstring.h>
|
||||
|
||||
#include "../input_config.h"
|
||||
|
||||
#include "joypad_connection.h"
|
||||
@ -100,7 +102,7 @@ int32_t pad_connection_pad_init(joypad_connection_t *joyconn,
|
||||
|
||||
if(pad_map[i].vid == 1406 && pad_map[i].pid == 816) /* Never change, Nintendo. */
|
||||
{
|
||||
if(strcmp(pad_map[i].name, name) != 0)
|
||||
if(!string_is_equal(pad_map[i].name, name))
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@ -46,8 +46,8 @@ static void input_reindex_devices()
|
||||
|
||||
for(j = 0; j < settings->input.max_users; j++)
|
||||
{
|
||||
if(!strcmp(tmp,settings->input.device_names[j])
|
||||
&& settings->input.device_name_index[i]==0)
|
||||
if(string_is_equal(tmp, settings->input.device_names[j])
|
||||
&& settings->input.device_name_index[i] == 0)
|
||||
settings->input.device_name_index[j]=k++;
|
||||
}
|
||||
}
|
||||
@ -99,7 +99,7 @@ static int input_try_autoconfigure_joypad_from_conf(config_file_t *conf,
|
||||
}
|
||||
|
||||
/* Check for name match */
|
||||
if (!strcmp(ident, params->name))
|
||||
if (string_is_equal(ident, params->name))
|
||||
{
|
||||
score += 2;
|
||||
#if 0
|
||||
@ -146,14 +146,10 @@ static void input_autoconfigure_joypad_add(config_file_t *conf, autoconfig_param
|
||||
input_autoconfigure_joypad_conf(conf,
|
||||
settings->input.autoconf_binds[params->idx]);
|
||||
|
||||
if (!strcmp(device_type,"remote"))
|
||||
if (string_is_equal(device_type,"remote"))
|
||||
{
|
||||
if (!string_is_empty(display_name) || strcmp(display_name, ""))
|
||||
snprintf(msg, sizeof(msg), "%s configured",
|
||||
display_name);
|
||||
else
|
||||
snprintf(msg, sizeof(msg), "%s configured",
|
||||
params->name);
|
||||
snprintf(msg, sizeof(msg), "%s configured",
|
||||
string_is_empty(display_name) ? params->name : display_name);
|
||||
|
||||
if(!remote_is_bound)
|
||||
runloop_msg_queue_push(msg, 0, 60, false);
|
||||
@ -161,12 +157,10 @@ static void input_autoconfigure_joypad_add(config_file_t *conf, autoconfig_param
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!string_is_empty(display_name) || strcmp(display_name, ""))
|
||||
snprintf(msg, sizeof(msg), "%s configured in port #%u.",
|
||||
display_name, params->idx);
|
||||
else
|
||||
snprintf(msg, sizeof(msg), "%s configured in port #%u.",
|
||||
params->name, params->idx);
|
||||
snprintf(msg, sizeof(msg), "%s configured in port #%u.",
|
||||
string_is_empty(display_name) ? params->name : display_name,
|
||||
params->idx);
|
||||
|
||||
if (!block_osd_spam)
|
||||
runloop_msg_queue_push(msg, 0, 60, false);
|
||||
}
|
||||
|
@ -240,8 +240,9 @@ unsigned input_config_translate_str_to_bind_id(const char *str)
|
||||
unsigned i;
|
||||
|
||||
for (i = 0; input_config_bind_map[i].valid; i++)
|
||||
if (!strcmp(str, input_config_bind_map[i].base))
|
||||
if (string_is_equal(str, input_config_bind_map[i].base))
|
||||
return i;
|
||||
|
||||
return RARCH_BIND_LIST_END;
|
||||
}
|
||||
|
||||
@ -294,7 +295,7 @@ void input_config_parse_joy_button(config_file_t *conf, const char *prefix,
|
||||
if (config_get_array(conf, key, tmp, sizeof(tmp)))
|
||||
{
|
||||
btn = tmp;
|
||||
if (!strcmp(btn, "nul"))
|
||||
if (string_is_equal(btn, "nul"))
|
||||
bind->joykey = NO_BTN;
|
||||
else
|
||||
{
|
||||
@ -327,7 +328,7 @@ void input_config_parse_joy_axis(config_file_t *conf, const char *prefix,
|
||||
|
||||
if (config_get_array(conf, key, tmp, sizeof(tmp)))
|
||||
{
|
||||
if (!strcmp(tmp, "nul"))
|
||||
if (string_is_equal(tmp, "nul"))
|
||||
bind->joyaxis = AXIS_NONE;
|
||||
else if (strlen(tmp) >= 2 && (*tmp == '+' || *tmp == '-'))
|
||||
{
|
||||
@ -436,7 +437,7 @@ void input_config_get_bind_string(char *buf, const struct retro_keybind *bind,
|
||||
|
||||
#ifndef RARCH_CONSOLE
|
||||
input_keymaps_translate_rk_to_str(bind->key, key, sizeof(key));
|
||||
if (!strcmp(key, "nul"))
|
||||
if (string_is_equal(key, "nul"))
|
||||
*key = '\0';
|
||||
|
||||
snprintf(keybuf, sizeof(keybuf), "(Key: %s)", key);
|
||||
|
@ -18,6 +18,8 @@
|
||||
#include <string.h>
|
||||
#include <ctype.h>
|
||||
|
||||
#include <string/stdstring.h>
|
||||
|
||||
#include "input_keymaps.h"
|
||||
#include "../general.h"
|
||||
#include "../string_list_special.h"
|
||||
@ -132,7 +134,7 @@ const input_device_driver_t *input_joypad_init_driver(const char *ident, void *d
|
||||
|
||||
for (i = 0; joypad_drivers[i]; i++)
|
||||
{
|
||||
if (!strcmp(ident, joypad_drivers[i]->ident)
|
||||
if (string_is_equal(ident, joypad_drivers[i]->ident)
|
||||
&& joypad_drivers[i]->init(data))
|
||||
{
|
||||
RARCH_LOG("Found joypad driver: \"%s\".\n",
|
||||
|
@ -34,6 +34,8 @@ extern "C" {
|
||||
|
||||
bool string_is_empty(const char *data);
|
||||
|
||||
bool string_is_equal(const char *a, const char *b);
|
||||
|
||||
char *string_to_upper(char *s);
|
||||
|
||||
char *string_to_lower(char *s);
|
||||
|
@ -37,6 +37,13 @@ bool string_is_empty(const char *data)
|
||||
return false;
|
||||
}
|
||||
|
||||
bool string_is_equal(const char *a, const char *b)
|
||||
{
|
||||
if (!a || !b)
|
||||
return false;
|
||||
return (strcmp(a, b) == 0);
|
||||
}
|
||||
|
||||
char *string_to_upper(char *s)
|
||||
{
|
||||
unsigned char *ucs = (unsigned char *)s;
|
||||
|
@ -21,6 +21,7 @@
|
||||
|
||||
#include <boolean.h>
|
||||
#include <compat/posix_string.h>
|
||||
#include <string/stdstring.h>
|
||||
|
||||
#include "playlist.h"
|
||||
#include "verbosity.h"
|
||||
@ -91,7 +92,7 @@ void content_playlist_get_index_by_path(content_playlist_t *playlist,
|
||||
|
||||
for (i = 0; i < playlist->size; i++)
|
||||
{
|
||||
if (strcmp(playlist->entries[i].path, search_path) != 0)
|
||||
if (!string_is_equal(playlist->entries[i].path, search_path))
|
||||
continue;
|
||||
|
||||
if (path)
|
||||
@ -208,14 +209,14 @@ void content_playlist_push(content_playlist_t *playlist,
|
||||
content_playlist_entry_t tmp;
|
||||
bool equal_path = (!path && !playlist->entries[i].path) ||
|
||||
(path && playlist->entries[i].path &&
|
||||
!strcmp(path,playlist->entries[i].path));
|
||||
string_is_equal(path,playlist->entries[i].path));
|
||||
|
||||
/* Core name can have changed while still being the same core.
|
||||
* Differentiate based on the core path only. */
|
||||
if (!equal_path)
|
||||
continue;
|
||||
|
||||
if (strcmp(playlist->entries[i].core_path, core_path))
|
||||
if (!string_is_equal(playlist->entries[i].core_path, core_path))
|
||||
continue;
|
||||
|
||||
/* If top entry, we don't want to push a new entry since
|
||||
|
10
retroarch.c
10
retroarch.c
@ -794,16 +794,16 @@ static void parse_input(int argc, char *argv[])
|
||||
break;
|
||||
|
||||
case 'M':
|
||||
if (!strcmp(optarg, "noload-nosave"))
|
||||
if (string_is_equal(optarg, "noload-nosave"))
|
||||
{
|
||||
global->sram.load_disable = true;
|
||||
global->sram.save_disable = true;
|
||||
}
|
||||
else if (!strcmp(optarg, "noload-save"))
|
||||
else if (string_is_equal(optarg, "noload-save"))
|
||||
global->sram.load_disable = true;
|
||||
else if (!strcmp(optarg, "load-nosave"))
|
||||
else if (string_is_equal(optarg, "load-nosave"))
|
||||
global->sram.save_disable = true;
|
||||
else if (strcmp(optarg, "load-save") != 0)
|
||||
else if (!string_is_equal(optarg, "load-save"))
|
||||
{
|
||||
RARCH_ERR("Invalid argument in --sram-mode.\n");
|
||||
print_help(argv[0]);
|
||||
@ -1389,7 +1389,7 @@ bool rarch_ctl(enum rarch_ctl_state state, void *data)
|
||||
|
||||
/* If config file to be replaced is the same as the
|
||||
* current config file, exit. */
|
||||
if (!strcmp(path, global->path.config))
|
||||
if (string_is_equal(path, global->path.config))
|
||||
return false;
|
||||
|
||||
if (settings->config_save_on_exit && *global->path.config)
|
||||
|
@ -130,13 +130,13 @@ static int iso_get_serial(database_state_handle_t *db_state,
|
||||
if ((rv = detect_system(name, offset, &system_name)) < 0)
|
||||
return rv;
|
||||
|
||||
if (strcmp(system_name, "psp") == 0)
|
||||
if (string_is_equal(system_name, "psp"))
|
||||
{
|
||||
if (detect_psp_game(name, serial) == 0)
|
||||
return 0;
|
||||
RARCH_LOG("Found disk label '%s'\n", serial);
|
||||
}
|
||||
else if (strcmp(system_name, "ps1") == 0)
|
||||
else if (string_is_equal(system_name, "ps1"))
|
||||
{
|
||||
if (detect_ps1_game(name, serial) == 0)
|
||||
return 0;
|
||||
@ -430,7 +430,7 @@ static int database_info_iterate_serial_lookup(
|
||||
RARCH_LOG("serial: %s , entry serial: %s (%s).\n",
|
||||
db_state->serial, db_info_entry->serial, db_info_entry->name);
|
||||
#endif
|
||||
if (!strcmp(db_state->serial, db_info_entry->serial))
|
||||
if (string_is_equal(db_state->serial, db_info_entry->serial))
|
||||
return database_info_list_iterate_found_match(db_state, db, NULL);
|
||||
}
|
||||
}
|
||||
|
@ -21,6 +21,7 @@
|
||||
#include <compat/strl.h>
|
||||
#include <retro_endianness.h>
|
||||
#include <retro_file.h>
|
||||
#include <string/stdstring.h>
|
||||
|
||||
#include "tasks.h"
|
||||
|
||||
@ -238,31 +239,31 @@ int detect_psp_game(const char *track_path, char *game_id)
|
||||
if (retro_fread(fd, game_id, 5) > 0)
|
||||
{
|
||||
game_id[5] = '\0';
|
||||
if (!strcmp(game_id, "ULES-")
|
||||
|| !strcmp(game_id, "ULUS-")
|
||||
|| !strcmp(game_id, "ULJS-")
|
||||
if (string_is_equal(game_id, "ULES-")
|
||||
|| string_is_equal(game_id, "ULUS-")
|
||||
|| string_is_equal(game_id, "ULJS-")
|
||||
|
||||
|| !strcmp(game_id, "ULEM-")
|
||||
|| !strcmp(game_id, "ULUM-")
|
||||
|| !strcmp(game_id, "ULJM-")
|
||||
|| string_is_equal(game_id, "ULEM-")
|
||||
|| string_is_equal(game_id, "ULUM-")
|
||||
|| string_is_equal(game_id, "ULJM-")
|
||||
|
||||
|| !strcmp(game_id, "UCES-")
|
||||
|| !strcmp(game_id, "UCUS-")
|
||||
|| !strcmp(game_id, "UCJS-")
|
||||
|| !strcmp(game_id, "UCAS-")
|
||||
|| string_is_equal(game_id, "UCES-")
|
||||
|| string_is_equal(game_id, "UCUS-")
|
||||
|| string_is_equal(game_id, "UCJS-")
|
||||
|| string_is_equal(game_id, "UCAS-")
|
||||
|
||||
|| !strcmp(game_id, "NPEH-")
|
||||
|| !strcmp(game_id, "NPUH-")
|
||||
|| !strcmp(game_id, "NPJH-")
|
||||
|| string_is_equal(game_id, "NPEH-")
|
||||
|| string_is_equal(game_id, "NPUH-")
|
||||
|| string_is_equal(game_id, "NPJH-")
|
||||
|
||||
|| !strcmp(game_id, "NPEG-")
|
||||
|| !strcmp(game_id, "NPUG-")
|
||||
|| !strcmp(game_id, "NPJG-")
|
||||
|| !strcmp(game_id, "NPHG-")
|
||||
|| string_is_equal(game_id, "NPEG-")
|
||||
|| string_is_equal(game_id, "NPUG-")
|
||||
|| string_is_equal(game_id, "NPJG-")
|
||||
|| string_is_equal(game_id, "NPHG-")
|
||||
|
||||
|| !strcmp(game_id, "NPEZ-")
|
||||
|| !strcmp(game_id, "NPUZ-")
|
||||
|| !strcmp(game_id, "NPJZ-")
|
||||
|| string_is_equal(game_id, "NPEZ-")
|
||||
|| string_is_equal(game_id, "NPUZ-")
|
||||
|| string_is_equal(game_id, "NPJZ-")
|
||||
)
|
||||
{
|
||||
retro_fseek(fd, pos, SEEK_SET);
|
||||
@ -327,7 +328,7 @@ int detect_system(const char *track_path, int32_t offset,
|
||||
if (retro_fread(fd, magic, 8) > 0)
|
||||
{
|
||||
magic[8] = '\0';
|
||||
if (!strcmp(magic, "PSP GAME"))
|
||||
if (string_is_equal(magic, "PSP GAME"))
|
||||
{
|
||||
*system_name = "psp\0";
|
||||
rv = 0;
|
||||
@ -365,7 +366,7 @@ int find_first_data_track(const char *cue_path,
|
||||
|
||||
while (get_token(fd, tmp_token, MAX_TOKEN_LEN) > 0)
|
||||
{
|
||||
if (strcmp(tmp_token, "FILE") == 0)
|
||||
if (string_is_equal(tmp_token, "FILE"))
|
||||
{
|
||||
get_token(fd, tmp_token, MAX_TOKEN_LEN);
|
||||
fill_pathname_join(track_path, cue_dir, tmp_token, max_len);
|
||||
|
@ -185,7 +185,7 @@ static bool rarch_task_decompress_finder(rarch_task_t *task, void *user_data)
|
||||
if (task->handler != rarch_task_decompress_handler)
|
||||
return false;
|
||||
|
||||
return strcmp(dec->source_file, (const char*)user_data) == 0;
|
||||
return string_is_equal(dec->source_file, (const char*)user_data);
|
||||
}
|
||||
|
||||
bool rarch_task_push_decompress(const char *source_file, const char *target_dir,
|
||||
@ -203,8 +203,8 @@ bool rarch_task_push_decompress(const char *source_file, const char *target_dir,
|
||||
}
|
||||
|
||||
/* ZIP or APK only */
|
||||
is_compressed = !strcmp("zip", path_get_extension(source_file));
|
||||
is_compressed = !is_compressed ? !strcmp("apk", path_get_extension(source_file)) : is_compressed;
|
||||
is_compressed = string_is_equal(path_get_extension(source_file), "zip");
|
||||
is_compressed = !is_compressed ? string_is_equal(path_get_extension(source_file), "apk") : is_compressed;
|
||||
|
||||
if (!path_file_exists(source_file) || !is_compressed)
|
||||
{
|
||||
|
@ -17,6 +17,7 @@
|
||||
#include <net/net_http.h>
|
||||
#include <queues/message_queue.h>
|
||||
#include <string/string_list.h>
|
||||
#include <string/stdstring.h>
|
||||
#include <compat/strl.h>
|
||||
#include <file/file_path.h>
|
||||
#include <file/file_extract.h>
|
||||
@ -202,7 +203,7 @@ static bool rarch_task_http_finder(rarch_task_t *task, void *user_data)
|
||||
|
||||
handle_url = net_http_connection_url(http->connection.handle);
|
||||
|
||||
return strcmp(handle_url, (const char*)user_data) == 0;
|
||||
return string_is_equal(handle_url, (const char*)user_data);
|
||||
}
|
||||
|
||||
bool rarch_task_push_http_transfer(const char *url, const char *type, rarch_task_callback_t cb, void *user_data)
|
||||
|
@ -184,7 +184,7 @@ static bool rarch_task_overlay_load_desc(
|
||||
desc->type = OVERLAY_TYPE_BUTTONS;
|
||||
for (tmp = strtok_r(key, "|", &save); tmp; tmp = strtok_r(NULL, "|", &save))
|
||||
{
|
||||
if (strcmp(tmp, "nul") != 0)
|
||||
if (!string_is_equal(tmp, "nul"))
|
||||
desc->key_mask |= UINT64_C(1) << input_config_translate_str_to_bind_id(tmp);
|
||||
}
|
||||
|
||||
@ -538,7 +538,7 @@ static ssize_t rarch_task_overlay_find_index(const struct overlay *ol,
|
||||
|
||||
for (i = 0; i < size; i++)
|
||||
{
|
||||
if (!strcmp(ol[i].name, name))
|
||||
if (string_is_equal(ol[i].name, name))
|
||||
return i;
|
||||
}
|
||||
|
||||
|
@ -30,6 +30,8 @@
|
||||
#include <android/log.h>
|
||||
#endif
|
||||
|
||||
#include <string/stdstring.h>
|
||||
|
||||
#if defined(HAVE_FILE_LOGGER)
|
||||
#define LOG_FILE (retro_main_log_file())
|
||||
#else
|
||||
@ -129,9 +131,9 @@ static aslclient asl_client;
|
||||
int prio = ANDROID_LOG_INFO;
|
||||
if (tag)
|
||||
{
|
||||
if (!strcmp("[WARN]", tag))
|
||||
if (string_is_equal("[WARN]", tag))
|
||||
prio = ANDROID_LOG_WARN;
|
||||
else if (!strcmp("[ERROR]", tag))
|
||||
else if (string_is_equal("[ERROR]", tag))
|
||||
prio = ANDROID_LOG_ERROR;
|
||||
}
|
||||
__android_log_vprint(prio, PROGRAM_NAME, fmt, ap);
|
||||
|
Loading…
x
Reference in New Issue
Block a user