Use memcmp instead of string_is_equal where possible for

better performance
This commit is contained in:
twinaphex 2017-04-21 22:47:15 +02:00
parent e9e1db2945
commit f9bc2d3783
22 changed files with 103 additions and 90 deletions

View File

@ -1684,15 +1684,16 @@ static bool check_shader_compatibility(enum file_path_enum enum_idx)
{
settings_t *settings = config_get_ptr();
if (string_is_equal("vulkan", settings->video.driver))
if (memcmp(settings->video.driver, "vulkan", 6) == 0)
{
if (enum_idx != FILE_PATH_SLANGP_EXTENSION)
return false;
return true;
}
if (string_is_equal("gl", settings->video.driver) ||
string_is_equal("d3d", settings->video.driver))
if ((memcmp(settings->video.driver, "gl", 2) == 0) ||
(memcmp(settings->video.driver, "d3d", 3) == 0)
)
{
if (enum_idx == FILE_PATH_SLANGP_EXTENSION)
return false;
@ -2107,7 +2108,7 @@ static bool config_load_file(const char *path, bool set_defaults,
if (!string_is_empty(settings->directory.screenshot))
{
if (string_is_equal(settings->directory.screenshot, "default"))
if (memcmp(settings->directory.screenshot, "default", 7) == 0)
*settings->directory.screenshot = '\0';
else if (!path_is_directory(settings->directory.screenshot))
{
@ -2125,36 +2126,36 @@ static bool config_load_file(const char *path, bool set_defaults,
path_clear(RARCH_PATH_CORE);
}
if (string_is_equal(settings->path.menu_wallpaper, "default"))
if (memcmp(settings->path.menu_wallpaper, "default", 7) == 0)
*settings->path.menu_wallpaper = '\0';
if (string_is_equal(settings->directory.video_shader, "default"))
if (memcmp(settings->directory.video_shader, "default", 7) == 0)
*settings->directory.video_shader = '\0';
if (string_is_equal(settings->directory.video_filter, "default"))
if (memcmp(settings->directory.video_filter, "default", 7) == 0)
*settings->directory.video_filter = '\0';
if (string_is_equal(settings->directory.audio_filter, "default"))
if (memcmp(settings->directory.audio_filter, "default", 7) == 0)
*settings->directory.audio_filter = '\0';
if (string_is_equal(settings->directory.core_assets, "default"))
if (memcmp(settings->directory.core_assets, "default", 7) == 0)
*settings->directory.core_assets = '\0';
if (string_is_equal(settings->directory.assets, "default"))
if (memcmp(settings->directory.assets, "default", 7) == 0)
*settings->directory.assets = '\0';
if (string_is_equal(settings->directory.dynamic_wallpapers, "default"))
if (memcmp(settings->directory.dynamic_wallpapers, "default", 7) == 0)
*settings->directory.dynamic_wallpapers = '\0';
if (string_is_equal(settings->directory.thumbnails, "default"))
if (memcmp(settings->directory.thumbnails, "default", 7) == 0)
*settings->directory.thumbnails = '\0';
if (string_is_equal(settings->directory.playlist, "default"))
if (memcmp(settings->directory.playlist, "default", 7) == 0)
*settings->directory.playlist = '\0';
#ifdef HAVE_MENU
if (string_is_equal(settings->directory.menu_content, "default"))
if (memcmp(settings->directory.menu_content, "default", 7) == 0)
*settings->directory.menu_content = '\0';
if (string_is_equal(settings->directory.menu_config, "default"))
if (memcmp(settings->directory.menu_config, "default", 7) == 0)
*settings->directory.menu_config = '\0';
#endif
#ifdef HAVE_OVERLAY
if (string_is_equal(settings->directory.overlay, "default"))
if (memcmp(settings->directory.overlay, "default", 7) == 0)
*settings->directory.overlay = '\0';
#endif
if (string_is_equal(settings->directory.system, "default"))
if (memcmp(settings->directory.system, "default", 7) == 0)
*settings->directory.system = '\0';
if (settings->slowmotion_ratio < 1.0f)
@ -2174,7 +2175,7 @@ static bool config_load_file(const char *path, bool set_defaults,
if (!retroarch_override_setting_is_set(RARCH_OVERRIDE_SETTING_SAVE_PATH, NULL) &&
config_get_path(conf, "savefile_directory", tmp_str, sizeof(tmp_str)))
{
if (string_is_equal(tmp_str, "default"))
if (memcmp(tmp_str, "default", 7) == 0)
dir_set(RARCH_DIR_SAVEFILE, g_defaults.dir.sram);
else if (path_is_directory(tmp_str))
@ -2200,7 +2201,7 @@ static bool config_load_file(const char *path, bool set_defaults,
if (!retroarch_override_setting_is_set(RARCH_OVERRIDE_SETTING_STATE_PATH, NULL) &&
config_get_path(conf, "savestate_directory", tmp_str, sizeof(tmp_str)))
{
if (string_is_equal(tmp_str, "default"))
if (memcmp(tmp_str, "default", 7) == 0)
dir_set(RARCH_DIR_SAVESTATE, g_defaults.dir.savestate);
else if (path_is_directory(tmp_str))
{

View File

@ -202,7 +202,7 @@ bool driver_find_next(const char *label, char *s, size_t len)
{
int i = driver_find_index(label, s);
if (i >= 0 && !string_is_equal(s, "null"))
if (i >= 0 && (memcmp(s, "null", 4) != 0))
{
find_driver_nonempty(label, i + 1, s, len);
return true;

View File

@ -933,7 +933,7 @@ static bool dynamic_verify_hw_context(enum retro_hw_context_type type,
switch (type)
{
case RETRO_HW_CONTEXT_VULKAN:
if (!string_is_equal(video_ident, "vulkan"))
if (memcmp(video_ident, "vulkan", 6) != 0)
return false;
break;
case RETRO_HW_CONTEXT_OPENGLES2:
@ -941,7 +941,7 @@ static bool dynamic_verify_hw_context(enum retro_hw_context_type type,
case RETRO_HW_CONTEXT_OPENGLES_VERSION:
case RETRO_HW_CONTEXT_OPENGL:
case RETRO_HW_CONTEXT_OPENGL_CORE:
if (!string_is_equal(video_ident, "gl"))
if (memcmp(video_ident, "gl", 2) != 0)
return false;
break;
default:

View File

@ -1054,7 +1054,7 @@ static void *gl_cg_init(void *data, const char *path)
memset(cg->alias_define, 0, sizeof(cg->alias_define));
if ( !string_is_empty(path)
&& string_is_equal(path_get_extension(path), "cgp"))
&& (memcmp(path_get_extension(path), "cgp", 3) == 0))
{
if (!gl_cg_load_preset(cg, path))
goto error;

View File

@ -758,7 +758,7 @@ static void *gl_glsl_init(void *data, const char *path)
bool ret = false;
const char *path_ext = path_get_extension(path);
if (string_is_equal(path_ext, "glsl"))
if (memcmp(path_ext, "glsl", 4) == 0)
{
strlcpy(glsl->shader->pass[0].source.path, path,
sizeof(glsl->shader->pass[0].source.path));
@ -766,7 +766,7 @@ static void *gl_glsl_init(void *data, const char *path)
glsl->shader->modern = true;
ret = true;
}
else if (string_is_equal(path_ext, "glslp"))
else if (memcmp(path_ext, "glslp", 5) == 0)
{
conf = config_file_new(path);
if (conf)

View File

@ -81,7 +81,7 @@ static bool shader_null_set_mvp(void *data, void *shader_data, const math_matrix
{
#ifdef HAVE_OPENGL
#ifndef NO_GL_FF_MATRIX
if (string_is_equal(video_driver_get_ident(), "gl"))
if (memcmp(video_driver_get_ident(), "gl", 2) == 0)
gl_ff_matrix(mat);
#endif
#endif
@ -92,7 +92,7 @@ static bool shader_null_set_coords(void *handle_data, void *shader_data, const s
{
#ifdef HAVE_OPENGL
#ifndef NO_GL_FF_VERTEX
if (string_is_equal(video_driver_get_ident(), "gl"))
if (memcmp(video_driver_get_ident(), "gl", 2) == 0)
gl_ff_vertex(coords);
#endif
#endif

View File

@ -83,22 +83,22 @@ static void blargg_ntsc_snes_initialize(void *data,
if (config->get_string(userdata, "tvtype", &tvtype, "composite"))
{
if (string_is_equal(tvtype, "composite"))
if (memcmp(tvtype, "composite", 9) == 0)
{
setup = snes_ntsc_composite;
setup.merge_fields = 1;
}
else if (string_is_equal(tvtype, "rf"))
else if (memcmp(tvtype, "rf", 2) == 0)
{
setup = snes_ntsc_composite;
setup.merge_fields = 0;
}
else if (string_is_equal(tvtype, "rgb"))
else if (memcmp(tvtype, "rgb", 3) == 0)
{
setup = snes_ntsc_rgb;
setup.merge_fields = 1;
}
else if (string_is_equal(tvtype, "svideo"))
else if (memcmp(tvtype, "svideo", 6) == 0)
{
setup = snes_ntsc_svideo;
setup.merge_fields = 1;

View File

@ -491,7 +491,7 @@ bool video_shader_resolve_parameters(config_file_t *conf,
/* First try to use the more robust slang implementation to support #includes. */
/* FIXME: The check for slang can be removed if it's sufficiently tested for
* GLSL/Cg as well, it should be the same implementation. */
if (string_is_equal(path_get_extension(shader->pass[i].source.path), "slang") &&
if ((memcmp(path_get_extension(shader->pass[i].source.path), "slang", 5) == 0) &&
slang_preprocess_parse_parameters(shader->pass[i].source.path, shader))
continue;
/* If that doesn't work, fallback to the old path.

View File

@ -302,7 +302,7 @@ static void sdl_grab_mouse(void *data, bool state)
SDL_Window *w;
};
if (!string_is_equal(video_driver_get_ident(), "sdl2"))
if (memcmp(video_driver_get_ident(), "sdl2", 4) != 0)
return;
/* First member of sdl2_video_t is the window */

View File

@ -317,32 +317,32 @@ static void udev_input_handle_hotplug(udev_input_t *udev)
action = udev_device_get_action(dev);
devnode = udev_device_get_devnode(dev);
if (val_keyboard && string_is_equal(val_keyboard, "1") && devnode)
if (val_keyboard && (memcmp(val_keyboard, "1", 1) == 0) && devnode)
devtype = "keyboard";
if (val_mouse && string_is_equal(val_mouse, "1") && devnode)
if (val_mouse && (memcmp(val_mouse, "1", 1) == 0) && devnode)
devtype = "mouse";
if (val_touchpad && string_is_equal(val_touchpad, "1") && devnode)
if (val_touchpad && (memcmp(val_touchpad, "1", 1) == 0) && devnode)
devtype = "touchpad";
if (!devtype)
goto end;
if (string_is_equal(action, "add"))
if (memcmp(action, "add", 3) == 0)
{
device_handle_cb cb = NULL;
if (string_is_equal(devtype, "keyboard"))
if (memcmp(devtype, "keyboard", 8) == 0)
cb = udev_handle_keyboard;
else if (string_is_equal(devtype, "touchpad"))
else if (memcmp(devtype, "touchpad", 8) == 0)
cb = udev_handle_touchpad;
else if (string_is_equal(devtype, "mouse"))
else if (memcmp(devtype, "mouse", 5) == 0)
cb = udev_handle_mouse;
RARCH_LOG("[udev]: Hotplug add %s: %s.\n", devtype, devnode);
udev_input_add_device(udev, devnode, cb);
}
else if (string_is_equal(action, "remove"))
else if (memcmp(action, "remove", 6) == 0)
{
RARCH_LOG("[udev]: Hotplug remove %s: %s.\n", devtype, devnode);
udev_input_remove_device(udev, devnode);

View File

@ -420,15 +420,15 @@ static void udev_joypad_handle_hotplug(struct udev_device *dev)
const char *action = udev_device_get_action(dev);
const char *devnode = udev_device_get_devnode(dev);
if (!val || !string_is_equal(val, "1") || !devnode)
if (!val || (memcmp(val, "1", 1) != 0) || !devnode)
goto end;
if (string_is_equal(action, "add"))
if (memcmp(action, "add", 3) == 0)
{
RARCH_LOG("[udev]: Hotplug add: %s.\n", devnode);
udev_check_device(dev, devnode);
}
else if (string_is_equal(action, "remove"))
else if (memcmp(action, "remove", 6) == 0)
{
RARCH_LOG("[udev]: Hotplug remove: %s.\n", devnode);
udev_joypad_remove_device(devnode);

View File

@ -280,13 +280,13 @@ static void parse_hat(struct retro_keybind *bind, const char *str)
return;
}
if (string_is_equal(dir, "up"))
if (memcmp(dir, "up", 2) == 0)
hat_dir = HAT_UP_MASK;
else if (string_is_equal(dir, "down"))
else if (memcmp(dir, "down", 4) == 0)
hat_dir = HAT_DOWN_MASK;
else if (string_is_equal(dir, "left"))
else if (memcmp(dir, "left", 4) == 0)
hat_dir = HAT_LEFT_MASK;
else if (string_is_equal(dir, "right"))
else if (memcmp(dir, "right", 5) == 0)
hat_dir = HAT_RIGHT_MASK;
if (hat_dir)

View File

@ -769,7 +769,8 @@ int menu_hash_get_help_us_enum(enum msg_hash_enums msg, char *s, size_t len) {
snprintf(s, len,
"Current Video driver.");
if (string_is_equal(settings->video.driver, "gl")) {
if (memcmp(settings->video.driver, "gl", 2) == 0)
{
snprintf(s, len,
"OpenGL Video driver. \n"
" \n"
@ -781,7 +782,9 @@ int menu_hash_get_help_us_enum(enum msg_hash_enums msg, char *s, size_t len) {
"libretro GL core implementations is \n"
"dependent on your graphics card's \n"
"underlying GL driver).");
} else if (string_is_equal(settings->video.driver, "sdl2")) {
}
else if (memcmp(settings->video.driver, "sdl2", 4) == 0)
{
snprintf(s, len,
"SDL 2 Video driver.\n"
" \n"
@ -791,7 +794,9 @@ int menu_hash_get_help_us_enum(enum msg_hash_enums msg, char *s, size_t len) {
"Performance for software-rendered libretro \n"
"core implementations is dependent \n"
"on your platform SDL implementation.");
} else if (string_is_equal(settings->video.driver, "sdl1")) {
}
else if (memcmp(settings->video.driver, "sdl1", 4) == 0)
{
snprintf(s, len,
"SDL Video driver.\n"
" \n"
@ -800,14 +805,18 @@ int menu_hash_get_help_us_enum(enum msg_hash_enums msg, char *s, size_t len) {
" \n"
"Performance is considered to be suboptimal. \n"
"Consider using it only as a last resort.");
} else if (string_is_equal(settings->video.driver, "d3d")) {
}
else if (memcmp(settings->video.driver, "d3d", 3) == 0)
{
snprintf(s, len,
"Direct3D Video driver. \n"
" \n"
"Performance for software-rendered cores \n"
"is dependent on your graphic card's \n"
"underlying D3D driver).");
} else if (string_is_equal(settings->video.driver, "exynos")) {
}
else if (memcmp(settings->video.driver, "exynos", 6) == 0)
{
snprintf(s, len,
"Exynos-G2D Video Driver. \n"
" \n"
@ -817,14 +826,18 @@ int menu_hash_get_help_us_enum(enum msg_hash_enums msg, char *s, size_t len) {
" \n"
"Performance for software rendered cores \n"
"should be optimal.");
} else if (string_is_equal(settings->video.driver, "drm")) {
}
else if (memcmp(settings->video.driver, "drm", 3) == 0)
{
snprintf(s, len,
"Plain DRM Video Driver. \n"
" \n"
"This is a low-level video driver using. \n"
"libdrm for hardware scaling using \n"
"GPU overlays.");
} else if (string_is_equal(settings->video.driver, "sunxi")) {
}
else if (memcmp(settings->video.driver, "sunxi", 5) == 0)
{
snprintf(s, len,
"Sunxi-G2D Video Driver. \n"
" \n"
@ -1992,7 +2005,7 @@ const char *msg_hash_to_str_us(enum msg_hash_enums msg) {
#ifdef HAVE_MENU
const char *ret = menu_hash_to_str_us_label_enum(msg);
if (ret && !string_is_equal(ret, "null"))
if (ret && (memcmp(ret, "null", 4) != 0))
return ret;
#endif

View File

@ -745,13 +745,13 @@ bool config_get_bool(config_file_t *conf, const char *key, bool *in)
if (entry)
{
if (string_is_equal(entry->value, "true"))
if (memcmp(entry->value, "true", 4) == 0)
*in = true;
else if (string_is_equal(entry->value, "1"))
else if (memcmp(entry->value, "1", 1) == 0)
*in = true;
else if (string_is_equal(entry->value, "false"))
else if (memcmp(entry->value, "false", 5) == 0)
*in = false;
else if (string_is_equal(entry->value, "0"))
else if (memcmp(entry->value, "0", 1) == 0)
*in = false;
else
return false;

View File

@ -124,7 +124,7 @@ static int parse_dir_entry(const char *name, char *file_path,
if (!include_dirs && is_dir)
return 1;
if (string_is_equal(name, ".") || string_is_equal(name, ".."))
if ((memcmp(name, ".", 1) == 0) || (memcmp(name, "..", 2) == 0))
return 1;
if (!is_dir && ext_list &&

View File

@ -71,7 +71,7 @@ static void zlib_inflate_stream_free(void *data)
static bool zlib_deflate_define(void *data, const char *prop, uint32_t val)
{
struct zlib_trans_stream *z = (struct zlib_trans_stream *) data;
if (string_is_equal(prop, "level"))
if (memcmp(prop, "level", 5) == 0)
{
z->ex = (int) val;
return true;
@ -82,7 +82,7 @@ static bool zlib_deflate_define(void *data, const char *prop, uint32_t val)
static bool zlib_inflate_define(void *data, const char *prop, uint32_t val)
{
struct zlib_trans_stream *z = (struct zlib_trans_stream *) data;
if (string_is_equal(prop, "window_bits"))
if (memcmp(prop, "window_bits", 11) == 0)
{
z->ex = (int) val;
return true;

View File

@ -2422,7 +2422,7 @@ static void xmb_render(void *data)
static bool xmb_shader_pipeline_active(video_frame_info_t *video_info)
{
if (!string_is_equal(menu_driver_ident(), "xmb"))
if (memcmp(menu_driver_ident(), "xmb", 3) != 0)
return false;
if (video_info->menu_shader_pipeline == XMB_SHADER_PIPELINE_WALLPAPER)
return false;

View File

@ -123,35 +123,35 @@ static bool menu_display_check_compatibility(
case MENU_VIDEO_DRIVER_GENERIC:
return true;
case MENU_VIDEO_DRIVER_OPENGL:
if (string_is_equal(video_driver, "gl"))
if (memcmp(video_driver, "gl", 2) == 0)
return true;
break;
case MENU_VIDEO_DRIVER_VULKAN:
if (string_is_equal(video_driver, "vulkan"))
if (memcmp(video_driver, "vulkan", 6) == 0)
return true;
break;
case MENU_VIDEO_DRIVER_DIRECT3D:
if (string_is_equal(video_driver, "d3d"))
if (memcmp(video_driver, "d3d", 3) == 0)
return true;
break;
case MENU_VIDEO_DRIVER_VITA2D:
if (string_is_equal(video_driver, "vita2d"))
if (memcmp(video_driver, "vita2d", 6) == 0)
return true;
break;
case MENU_VIDEO_DRIVER_CTR:
if (string_is_equal(video_driver, "ctr"))
if (memcmp(video_driver, "ctr", 3) == 0)
return true;
break;
case MENU_VIDEO_DRIVER_CACA:
if (string_is_equal(video_driver, "caca"))
if (memcmp(video_driver, "caca", 4) == 0)
return true;
break;
case MENU_VIDEO_DRIVER_GDI:
if (string_is_equal(video_driver, "gdi"))
if (memcmp(video_driver, "gdi", 3) == 0)
return true;
break;
case MENU_VIDEO_DRIVER_VGA:
if (string_is_equal(video_driver, "vga"))
if (memcmp(video_driver, "vga", 3) == 0)
return true;
break;
}

View File

@ -2238,7 +2238,7 @@ static bool setting_append_list(
parent_group);
}
if (!string_is_equal(settings->menu.driver, "xmb"))
if (memcmp(settings->menu.driver, "xmb", 3) != 0)
{
CONFIG_ACTION(
list, list_info,
@ -2559,7 +2559,7 @@ static bool setting_append_list(
parent_group);
settings_data_list_current_add_flags(list, list_info, SD_FLAG_ADVANCED);
if (!string_is_equal(settings->wifi.driver, "null"))
if (memcmp(settings->wifi.driver, "null", 4) != 0)
{
CONFIG_ACTION(
list, list_info,
@ -3227,7 +3227,7 @@ static bool setting_append_list(
&setting_get_string_representation_st_float_video_refresh_rate_auto;
settings_data_list_current_add_flags(list, list_info, SD_FLAG_LAKKA_ADVANCED);
if (string_is_equal(settings->video.driver, "gl"))
if (memcmp(settings->video.driver, "gl", 2) == 0)
{
CONFIG_BOOL(
list, list_info,
@ -3562,7 +3562,7 @@ static bool setting_append_list(
settings_data_list_current_add_flags(list, list_info, SD_FLAG_CMD_APPLY_AUTO);
settings_data_list_current_add_flags(list, list_info, SD_FLAG_LAKKA_ADVANCED);
if (string_is_equal(settings->video.driver, "gl"))
if (memcmp(settings->video.driver, "gl", 2) == 0)
{
CONFIG_BOOL(
list, list_info,
@ -4694,7 +4694,7 @@ static bool setting_append_list(
START_SUB_GROUP(list, list_info, "State", &group_info, &subgroup_info, parent_group);
if (!string_is_equal(settings->menu.driver, "rgui"))
if (memcmp(settings->menu.driver, "rgui", 4) != 0)
{
CONFIG_PATH(
list, list_info,
@ -4726,8 +4726,7 @@ static bool setting_append_list(
settings_data_list_current_add_flags(list, list_info, SD_FLAG_LAKKA_ADVANCED);
}
if (string_is_equal(settings->menu.driver, "xmb"))
if (memcmp(settings->menu.driver, "xmb", 3) == 0)
{
CONFIG_BOOL(
list, list_info,
@ -4927,7 +4926,7 @@ static bool setting_append_list(
START_SUB_GROUP(list, list_info, "Display", &group_info, &subgroup_info, parent_group);
/* only GLUI uses these values, don't show them on other drivers */
if (string_is_equal(settings->menu.driver, "glui"))
if (memcmp(settings->menu.driver, "glui", 4) == 0)
{
CONFIG_BOOL(
list, list_info,
@ -4960,7 +4959,7 @@ static bool setting_append_list(
#ifdef HAVE_XMB
/* only XMB uses these values, don't show them on other drivers */
if (string_is_equal(settings->menu.driver, "xmb"))
if (memcmp(settings->menu.driver, "xmb", 3) == 0)
{
CONFIG_UINT(
list, list_info,
@ -5181,7 +5180,7 @@ static bool setting_append_list(
#ifdef HAVE_MATERIALUI
/* only MaterialUI uses these values, don't show them on other drivers */
if (string_is_equal(settings->menu.driver, "glui"))
if (memcmp(settings->menu.driver, "glui", 4) == 0)
{
CONFIG_UINT(
list, list_info,
@ -5241,7 +5240,7 @@ static bool setting_append_list(
general_read_handler,
SD_FLAG_ADVANCED);
if (string_is_equal(settings->menu.driver, "xmb"))
if (memcmp(settings->menu.driver, "xmb", 3) == 0)
{
CONFIG_UINT(
list, list_info,
@ -5341,7 +5340,7 @@ static bool setting_append_list(
START_SUB_GROUP(list, list_info, "State", &group_info, &subgroup_info, parent_group);
if (!string_is_equal(settings->record.driver, "null"))
if (memcmp(settings->record.driver, "null", 4) != 0)
{
CONFIG_BOOL(
list, list_info,
@ -5422,7 +5421,7 @@ static bool setting_append_list(
menu_settings_list_current_add_cmd(list, list_info, CMD_EVENT_REINIT);
#endif
if (!string_is_equal(ui_companion_driver_get_ident(), "null"))
if (memcmp(ui_companion_driver_get_ident(), "null", 4) != 0)
{
CONFIG_BOOL(
list, list_info,

View File

@ -383,9 +383,9 @@ int setting_set_with_string_representation(rarch_setting_t* setting,
strlcpy(setting->value.target.string, value, setting->size);
break;
case ST_BOOL:
if (string_is_equal(value, "true"))
if (memcmp(value, "true", 4) == 0)
*setting->value.target.boolean = true;
else if (string_is_equal(value, "false"))
else if (memcmp(value, "false", 5) == 0)
*setting->value.target.boolean = false;
break;
default:

View File

@ -156,7 +156,7 @@ static void input_autoconfigure_joypad_add(config_file_t *conf,
input_autoconfigure_joypad_conf(conf,
settings->input.autoconf_binds[params->idx]);
if (string_is_equal(device_type, "remote"))
if (memcmp(device_type, "remote", 6) == 0)
{
snprintf(msg, sizeof(msg), "%s configured.",
string_is_empty(display_name) ? params->name : display_name);

View File

@ -131,13 +131,13 @@ static int iso_get_serial(database_state_handle_t *db_state,
if (rv < 0)
return rv;
if (string_is_equal(system_name, "psp"))
if (memcmp(system_name, "psp", 3) == 0)
{
if (detect_psp_game(name, serial) == 0)
return 0;
RARCH_LOG("%s '%s'\n", msg_hash_to_str(MSG_FOUND_DISK_LABEL), serial);
}
else if (string_is_equal(system_name, "ps1"))
else if (memcmp(system_name, "ps1", 3) == 0)
{
if (detect_ps1_game(name, serial) == 0)
return 0;