mirror of
https://github.com/libretro/RetroArch
synced 2025-02-06 00:39:53 +00:00
Use string_is_equal_fast/string_is_not_equal_fast
This commit is contained in:
parent
8eca08c6ac
commit
126a5bf121
@ -370,7 +370,7 @@ static void *alsa_device_list_new(void *data)
|
||||
/* description of device IOID - input / output identifcation
|
||||
* ("Input" or "Output"), NULL means both) */
|
||||
|
||||
if (!io || (memcmp(io, "Output", 6) == 0))
|
||||
if (!io || (string_is_equal_fast(io, "Output", 6)))
|
||||
string_list_append(s, name, attr);
|
||||
|
||||
if (name)
|
||||
|
@ -370,7 +370,7 @@ static void *alsa_device_list_new(void *data)
|
||||
/* description of device IOID - input / output identifcation
|
||||
* ("Input" or "Output"), NULL means both) */
|
||||
|
||||
if (!io || (memcmp(io,"Output", 6) == 0))
|
||||
if (!io || (string_is_equal_fast(io,"Output", 6)))
|
||||
string_list_append(s, name, attr);
|
||||
|
||||
if (name)
|
||||
|
@ -2067,15 +2067,15 @@ static bool check_shader_compatibility(enum file_path_enum enum_idx)
|
||||
{
|
||||
settings_t *settings = config_get_ptr();
|
||||
|
||||
if (memcmp(settings->arrays.video_driver, "vulkan", 6) == 0)
|
||||
if (string_is_equal_fast(settings->arrays.video_driver, "vulkan", 6))
|
||||
{
|
||||
if (enum_idx != FILE_PATH_SLANGP_EXTENSION)
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
if ((memcmp(settings->arrays.video_driver, "gl", 2) == 0) ||
|
||||
(memcmp(settings->arrays.video_driver, "d3d", 3) == 0)
|
||||
if (string_is_equal_fast(settings->arrays.video_driver, "gl", 2) ||
|
||||
string_is_equal_fast(settings->arrays.video_driver, "d3d", 3)
|
||||
)
|
||||
{
|
||||
if (enum_idx == FILE_PATH_SLANGP_EXTENSION)
|
||||
@ -2504,7 +2504,7 @@ static bool config_load_file(const char *path, bool set_defaults,
|
||||
|
||||
if (!string_is_empty(settings->paths.directory_screenshot))
|
||||
{
|
||||
if (memcmp(settings->paths.directory_screenshot, "default", 7) == 0)
|
||||
if (string_is_equal_fast(settings->paths.directory_screenshot, "default", 7))
|
||||
*settings->paths.directory_screenshot = '\0';
|
||||
else if (!path_is_directory(settings->paths.directory_screenshot))
|
||||
{
|
||||
@ -2522,36 +2522,36 @@ static bool config_load_file(const char *path, bool set_defaults,
|
||||
path_clear(RARCH_PATH_CORE);
|
||||
}
|
||||
|
||||
if (memcmp(settings->paths.path_menu_wallpaper, "default", 7) == 0)
|
||||
if (string_is_equal_fast(settings->paths.path_menu_wallpaper, "default", 7))
|
||||
*settings->paths.path_menu_wallpaper = '\0';
|
||||
if (memcmp(settings->paths.directory_video_shader, "default", 7) == 0)
|
||||
if (string_is_equal_fast(settings->paths.directory_video_shader, "default", 7))
|
||||
*settings->paths.directory_video_shader = '\0';
|
||||
if (memcmp(settings->paths.directory_video_filter, "default", 7) == 0)
|
||||
if (string_is_equal_fast(settings->paths.directory_video_filter, "default", 7))
|
||||
*settings->paths.directory_video_filter = '\0';
|
||||
if (memcmp(settings->paths.directory_audio_filter, "default", 7) == 0)
|
||||
if (string_is_equal_fast(settings->paths.directory_audio_filter, "default", 7))
|
||||
*settings->paths.directory_audio_filter = '\0';
|
||||
if (memcmp(settings->paths.directory_core_assets, "default", 7) == 0)
|
||||
if (string_is_equal_fast(settings->paths.directory_core_assets, "default", 7))
|
||||
*settings->paths.directory_core_assets = '\0';
|
||||
if (memcmp(settings->paths.directory_assets, "default", 7) == 0)
|
||||
if (string_is_equal_fast(settings->paths.directory_assets, "default", 7))
|
||||
*settings->paths.directory_assets = '\0';
|
||||
if (memcmp(settings->paths.directory_dynamic_wallpapers, "default", 7) == 0)
|
||||
if (string_is_equal_fast(settings->paths.directory_dynamic_wallpapers, "default", 7))
|
||||
*settings->paths.directory_dynamic_wallpapers = '\0';
|
||||
if (memcmp(settings->paths.directory_thumbnails, "default", 7) == 0)
|
||||
if (string_is_equal_fast(settings->paths.directory_thumbnails, "default", 7))
|
||||
*settings->paths.directory_thumbnails = '\0';
|
||||
if (memcmp(settings->paths.directory_playlist, "default", 7) == 0)
|
||||
if (string_is_equal_fast(settings->paths.directory_playlist, "default", 7))
|
||||
*settings->paths.directory_playlist = '\0';
|
||||
#ifdef HAVE_MENU
|
||||
|
||||
if (memcmp(settings->paths.directory_menu_content, "default", 7) == 0)
|
||||
if (string_is_equal_fast(settings->paths.directory_menu_content, "default", 7))
|
||||
*settings->paths.directory_menu_content = '\0';
|
||||
if (memcmp(settings->paths.directory_menu_config, "default", 7) == 0)
|
||||
if (string_is_equal_fast(settings->paths.directory_menu_config, "default", 7))
|
||||
*settings->paths.directory_menu_config = '\0';
|
||||
#endif
|
||||
#ifdef HAVE_OVERLAY
|
||||
if (memcmp(settings->paths.directory_overlay, "default", 7) == 0)
|
||||
if (string_is_equal_fast(settings->paths.directory_overlay, "default", 7))
|
||||
*settings->paths.directory_overlay = '\0';
|
||||
#endif
|
||||
if (memcmp(settings->paths.directory_system, "default", 7) == 0)
|
||||
if (string_is_equal_fast(settings->paths.directory_system, "default", 7))
|
||||
*settings->paths.directory_system = '\0';
|
||||
|
||||
if (settings->floats.slowmotion_ratio < 1.0f)
|
||||
@ -2575,7 +2575,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 (memcmp(tmp_str, "default", 7) == 0)
|
||||
if (string_is_equal_fast(tmp_str, "default", 7))
|
||||
dir_set(RARCH_DIR_SAVEFILE, g_defaults.dir.sram);
|
||||
|
||||
else if (path_is_directory(tmp_str))
|
||||
@ -2601,7 +2601,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 (memcmp(tmp_str, "default", 7) == 0)
|
||||
if (string_is_equal_fast(tmp_str, "default", 7))
|
||||
dir_set(RARCH_DIR_SAVESTATE, g_defaults.dir.savestate);
|
||||
else if (path_is_directory(tmp_str))
|
||||
{
|
||||
|
@ -961,7 +961,7 @@ static bool frontend_linux_powerstate_check_apm(
|
||||
|
||||
if (!next_string(&ptr, &str)) /* remaining battery life time units */
|
||||
goto error;
|
||||
else if (memcmp(str, "min", 3) == 0)
|
||||
else if (string_is_equal_fast(str, "min", 3))
|
||||
battery_time *= 60;
|
||||
|
||||
if (battery_flag == 0xFF) /* unknown state */
|
||||
@ -1311,7 +1311,7 @@ static void frontend_linux_get_env(int *argc,
|
||||
if (android_app->getStringExtra && jstr)
|
||||
{
|
||||
const char *argv = (*env)->GetStringUTFChars(env, jstr, 0);
|
||||
bool used = (memcmp(argv, "false", 5) == 0) ? false : true;
|
||||
bool used = string_is_equal_fast(argv, "false", 5) ? false : true;
|
||||
|
||||
(*env)->ReleaseStringUTFChars(env, jstr, argv);
|
||||
|
||||
|
@ -867,7 +867,9 @@ void vulkan_draw_quad(vk_t *vk, const struct vk_draw_quad *quad)
|
||||
sizeof(*quad->mvp), &range))
|
||||
return;
|
||||
|
||||
if (memcmp(quad->mvp, &vk->tracker.mvp, sizeof(*quad->mvp))
|
||||
if (
|
||||
string_is_equal_fast(quad->mvp,
|
||||
&vk->tracker.mvp, sizeof(*quad->mvp))
|
||||
|| quad->texture->view != vk->tracker.view
|
||||
|| quad->sampler != vk->tracker.sampler)
|
||||
{
|
||||
|
@ -313,7 +313,7 @@ static bool d3d_init_multipass(d3d_video_t *d3d)
|
||||
static bool d3d_process_shader(d3d_video_t *d3d)
|
||||
{
|
||||
#ifdef HAVE_FBO
|
||||
if (memcmp(path_get_extension(d3d->shader_path.c_str()), "cgp", 3) == 0)
|
||||
if (string_is_equal_fast(path_get_extension(d3d->shader_path.c_str()), "cgp", 3))
|
||||
return d3d_init_multipass(d3d);
|
||||
#endif
|
||||
|
||||
|
@ -414,7 +414,7 @@ static uint64_t drm_plane_type(drmModePlane *plane)
|
||||
for (j = 0; j < props->count_props; j++)
|
||||
{
|
||||
/* found the type property */
|
||||
if (memcmp(drmModeGetProperty(drm.fd, props->props[j])->name, "type", 4) == 0)
|
||||
if (string_is_equal_fast(drmModeGetProperty(drm.fd, props->props[j])->name, "type", 4))
|
||||
return (props->prop_values[j]);
|
||||
}
|
||||
return (0);
|
||||
|
@ -181,7 +181,7 @@ static int exynos_get_device_index(void)
|
||||
|
||||
ver = drmGetVersion(fd);
|
||||
|
||||
if (memcmp(ver->name, "exynos", 6) == 0)
|
||||
if (string_is_equal_fast(ver->name, "exynos", 6))
|
||||
found = true;
|
||||
else
|
||||
++index;
|
||||
|
@ -499,22 +499,22 @@ static void registry_handle_global(void *data, struct wl_registry *reg,
|
||||
|
||||
(void)version;
|
||||
|
||||
if (memcmp(interface, "wl_compositor", 13) == 0)
|
||||
if (string_is_equal_fast(interface, "wl_compositor", 13))
|
||||
wl->compositor = (struct wl_compositor*)wl_registry_bind(reg,
|
||||
id, &wl_compositor_interface, 3);
|
||||
else if (memcmp(interface, "wl_output", 9) == 0)
|
||||
else if (string_is_equal_fast(interface, "wl_output", 9))
|
||||
{
|
||||
output = (struct wl_output*)wl_registry_bind(reg,
|
||||
id, &wl_output_interface, 2);
|
||||
wl_output_add_listener(output, &output_listener, wl);
|
||||
wl_display_roundtrip(wl->dpy);
|
||||
}
|
||||
else if (memcmp(interface, "wl_shell", 8) == 0)
|
||||
else if (string_is_equal_fast(interface, "wl_shell", 8))
|
||||
wl->shell = (struct wl_shell*)
|
||||
wl_registry_bind(reg, id, &wl_shell_interface, 1);
|
||||
else if (memcmp(interface, "wl_shm", 6) == 0)
|
||||
else if (string_is_equal_fast(interface, "wl_shm", 6))
|
||||
wl->shm = (struct wl_shm*)wl_registry_bind(reg, id, &wl_shm_interface, 1);
|
||||
else if (memcmp(interface, "wl_seat", 7) == 0)
|
||||
else if (string_is_equal_fast(interface, "wl_seat", 7))
|
||||
{
|
||||
wl->seat = (struct wl_seat*)wl_registry_bind(reg, id, &wl_seat_interface, 4);
|
||||
wl_seat_add_listener(wl->seat, &seat_listener, wl);
|
||||
|
@ -299,7 +299,7 @@ static bool cg_d3d9_renderchain_init_shader_fvf(void *data, void *pass_data)
|
||||
|
||||
for (count = 0; count < MAXD3DDECLLENGTH; count++)
|
||||
{
|
||||
if (memcmp(&decl_end, &decl[count], sizeof(decl_end)) == 0)
|
||||
if (string_is_equal_fast(&decl_end, &decl[count], sizeof(decl_end)))
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -1053,7 +1053,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)
|
||||
&& (memcmp(path_get_extension(path), "cgp", 3) == 0))
|
||||
&& string_is_equal_fast(path_get_extension(path), "cgp", 3))
|
||||
{
|
||||
if (!gl_cg_load_preset(cg, path))
|
||||
goto error;
|
||||
|
@ -775,7 +775,7 @@ static void *gl_glsl_init(void *data, const char *path)
|
||||
bool ret = false;
|
||||
const char *path_ext = path_get_extension(path);
|
||||
|
||||
if (memcmp(path_ext, "glslp", 5) == 0)
|
||||
if (string_is_equal_fast(path_ext, "glslp", 5))
|
||||
{
|
||||
conf = config_file_new(path);
|
||||
if (conf)
|
||||
@ -784,7 +784,7 @@ static void *gl_glsl_init(void *data, const char *path)
|
||||
glsl->shader->modern = true;
|
||||
}
|
||||
}
|
||||
else if (memcmp(path_ext, "glsl", 4) == 0)
|
||||
else if (string_is_equal_fast(path_ext, "glsl", 4))
|
||||
{
|
||||
strlcpy(glsl->shader->pass[0].source.path, path,
|
||||
sizeof(glsl->shader->pass[0].source.path));
|
||||
|
@ -410,7 +410,7 @@ static void *hlsl_init(void *data, const char *path)
|
||||
if (!hlsl_data)
|
||||
return NULL;
|
||||
|
||||
if (path && (memcmp(path_get_extension(path), ".cgp", 4) == 0))
|
||||
if (path && (string_is_equal_fast(path_get_extension(path), ".cgp", 4)))
|
||||
{
|
||||
if (!hlsl_load_preset(hlsl_data, d3d, path))
|
||||
goto error;
|
||||
|
@ -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 (memcmp(video_driver_get_ident(), "gl", 2) == 0)
|
||||
if (string_is_equal_fast(video_driver_get_ident(), "gl", 2))
|
||||
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 (memcmp(video_driver_get_ident(), "gl", 2) == 0)
|
||||
if (string_is_equal_fast(video_driver_get_ident(), "gl", 2))
|
||||
gl_ff_vertex(coords);
|
||||
#endif
|
||||
#endif
|
||||
|
@ -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 ((memcmp(path_get_extension(shader->pass[i].source.path), "slang", 5) == 0) &&
|
||||
if ((string_is_equal_fast(path_get_extension(shader->pass[i].source.path), "slang", 5)) &&
|
||||
slang_preprocess_parse_parameters(shader->pass[i].source.path, shader))
|
||||
continue;
|
||||
/* If that doesn't work, fallback to the old path.
|
||||
|
@ -21,6 +21,7 @@
|
||||
#include <compat/strl.h>
|
||||
#include <features/features_cpu.h>
|
||||
#include <rthreads/rthreads.h>
|
||||
#include <string/stdstring.h>
|
||||
|
||||
#include "video_thread_wrapper.h"
|
||||
#include "font_driver.h"
|
||||
@ -376,7 +377,7 @@ static bool video_thread_handle_packet(
|
||||
|
||||
thr->driver->viewport_info(thr->driver_data, &vp);
|
||||
|
||||
if (memcmp(&vp, &thr->read_vp, sizeof(vp)) == 0)
|
||||
if (string_is_equal_fast(&vp, &thr->read_vp, sizeof(vp)))
|
||||
{
|
||||
/* We can read safely
|
||||
*
|
||||
|
@ -302,7 +302,7 @@ static void sdl_grab_mouse(void *data, bool state)
|
||||
SDL_Window *w;
|
||||
};
|
||||
|
||||
if (memcmp(video_driver_get_ident(), "sdl2", 4) != 0)
|
||||
if (string_is_not_equal_fast(video_driver_get_ident(), "sdl2", 4))
|
||||
return;
|
||||
|
||||
/* First member of sdl2_video_t is the window */
|
||||
|
@ -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 && (memcmp(val_keyboard, "1", 1) == 0) && devnode)
|
||||
if (val_keyboard && string_is_equal_fast(val_keyboard, "1", 1) && devnode)
|
||||
devtype = "keyboard";
|
||||
|
||||
if (val_mouse && (memcmp(val_mouse, "1", 1) == 0) && devnode)
|
||||
if (val_mouse && string_is_equal_fast(val_mouse, "1", 1) && devnode)
|
||||
devtype = "mouse";
|
||||
|
||||
if (val_touchpad && (memcmp(val_touchpad, "1", 1) == 0) && devnode)
|
||||
if (val_touchpad && string_is_equal_fast(val_touchpad, "1", 1) && devnode)
|
||||
devtype = "touchpad";
|
||||
|
||||
if (!devtype)
|
||||
goto end;
|
||||
|
||||
if (memcmp(action, "add", 3) == 0)
|
||||
if (string_is_equal_fast(action, "add", 3))
|
||||
{
|
||||
device_handle_cb cb = NULL;
|
||||
if (memcmp(devtype, "keyboard", 8) == 0)
|
||||
if (string_is_equal_fast(devtype, "keyboard", 8))
|
||||
cb = udev_handle_keyboard;
|
||||
else if (memcmp(devtype, "touchpad", 8) == 0)
|
||||
else if (string_is_equal_fast(devtype, "touchpad", 8))
|
||||
cb = udev_handle_touchpad;
|
||||
else if (memcmp(devtype, "mouse", 5) == 0)
|
||||
else if (string_is_equal_fast(devtype, "mouse", 5))
|
||||
cb = udev_handle_mouse;
|
||||
|
||||
RARCH_LOG("[udev]: Hotplug add %s: %s.\n", devtype, devnode);
|
||||
udev_input_add_device(udev, devnode, cb);
|
||||
}
|
||||
else if (memcmp(action, "remove", 6) == 0)
|
||||
else if (string_is_equal_fast(action, "remove", 6))
|
||||
{
|
||||
RARCH_LOG("[udev]: Hotplug remove %s: %s.\n", devtype, devnode);
|
||||
udev_input_remove_device(udev, devnode);
|
||||
|
@ -31,6 +31,7 @@
|
||||
#ifdef HAVE_DYNAMIC
|
||||
#include <dynamic/dylib.h>
|
||||
#endif
|
||||
#include <string/stdstring.h>
|
||||
|
||||
#include "../input_defines.h"
|
||||
#include "../input_hid_driver.h"
|
||||
@ -554,8 +555,8 @@ uint32_t embedded_get_ticks(void);
|
||||
#define READ_L2CAP_LENGTH(buffer) ( READ_BT_16(buffer, 4))
|
||||
#define READ_L2CAP_CHANNEL_ID(buffer) ( READ_BT_16(buffer, 6))
|
||||
|
||||
#define BD_ADDR_CMP(a,b) memcmp(a,b, BD_ADDR_LEN)
|
||||
#define BD_ADDR_COPY(dest,src) memcpy(dest,src,BD_ADDR_LEN)
|
||||
#define BD_ADDR_CMP(a,b) memcmp(a,b, BD_ADDR_LEN)
|
||||
#define BD_ADDR_COPY(dest,src) memcpy(dest,src,BD_ADDR_LEN)
|
||||
|
||||
void bt_store_16(uint8_t *buffer, uint16_t pos, uint16_t value);
|
||||
|
||||
|
@ -23,6 +23,7 @@
|
||||
|
||||
#include <boolean.h>
|
||||
#include <compat/strl.h>
|
||||
#include <string/stdstring.h>
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "../../config.h"
|
||||
@ -123,7 +124,7 @@ static bool guid_is_xinput_device(const GUID* product_guid)
|
||||
|
||||
for (i = 0; i < ARRAY_SIZE(common_xinput_guids); ++i)
|
||||
{
|
||||
if (memcmp(product_guid, &common_xinput_guids[i], sizeof(GUID)) == 0)
|
||||
if (string_is_equal_fast(product_guid, &common_xinput_guids[i], sizeof(GUID)))
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -418,15 +418,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 || (memcmp(val, "1", 1) != 0) || !devnode)
|
||||
if (!val || string_is_not_equal_fast(val, "1", 1) || !devnode)
|
||||
goto end;
|
||||
|
||||
if (memcmp(action, "add", 3) == 0)
|
||||
if (string_is_equal_fast(action, "add", 3))
|
||||
{
|
||||
RARCH_LOG("[udev]: Hotplug add: %s.\n", devnode);
|
||||
udev_check_device(dev, devnode);
|
||||
}
|
||||
else if (memcmp(action, "remove", 6) == 0)
|
||||
else if (string_is_equal_fast(action, "remove", 6))
|
||||
{
|
||||
RARCH_LOG("[udev]: Hotplug remove: %s.\n", devnode);
|
||||
udev_joypad_remove_device(devnode);
|
||||
|
@ -308,7 +308,7 @@ static int sevenzip_parse_file_init(file_archive_transfer_t *state,
|
||||
if (state->archive_size < SEVENZIP_MAGIC_LEN)
|
||||
goto error;
|
||||
|
||||
if (memcmp(state->data, SEVENZIP_MAGIC, SEVENZIP_MAGIC_LEN) != 0)
|
||||
if (string_is_not_equal_fast(state->data, SEVENZIP_MAGIC, SEVENZIP_MAGIC_LEN))
|
||||
goto error;
|
||||
|
||||
state->stream = sevenzip_context;
|
||||
|
@ -324,7 +324,7 @@ struct http_t *net_http_new(struct http_connection_t *conn)
|
||||
net_http_send_str(fd, &error, "\r\n");
|
||||
}
|
||||
|
||||
if (conn->methodcopy && (memcmp(conn->methodcopy, "POST", 4) == 0))
|
||||
if (conn->methodcopy && (string_is_equal_fast(conn->methodcopy, "POST", 4)))
|
||||
{
|
||||
size_t post_len, len;
|
||||
char *len_str = NULL;
|
||||
@ -361,7 +361,7 @@ struct http_t *net_http_new(struct http_connection_t *conn)
|
||||
net_http_send_str(fd, &error, "Connection: close\r\n");
|
||||
net_http_send_str(fd, &error, "\r\n");
|
||||
|
||||
if (conn->methodcopy && (memcmp(conn->methodcopy, "POST", 4) == 0))
|
||||
if (conn->methodcopy && (string_is_equal_fast(conn->methodcopy, "POST", 4)))
|
||||
net_http_send_str(fd, &error, conn->postdatacopy);
|
||||
|
||||
if (error)
|
||||
|
@ -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 (memcmp(prop, "level", 5) == 0)
|
||||
if (string_is_equal_fast(prop, "level", 5))
|
||||
{
|
||||
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 (memcmp(prop, "window_bits", 11) == 0)
|
||||
if (string_is_equal_fast(prop, "window_bits", 11))
|
||||
{
|
||||
z->ex = (int) val;
|
||||
return true;
|
||||
|
@ -2230,7 +2230,7 @@ static bool setting_append_list(
|
||||
parent_group);
|
||||
}
|
||||
|
||||
if (memcmp(settings->arrays.menu_driver, "xmb", 3) != 0)
|
||||
if (string_is_not_equal_fast(settings->arrays.menu_driver, "xmb", 3))
|
||||
{
|
||||
CONFIG_ACTION(
|
||||
list, list_info,
|
||||
@ -2551,7 +2551,7 @@ static bool setting_append_list(
|
||||
parent_group);
|
||||
settings_data_list_current_add_flags(list, list_info, SD_FLAG_ADVANCED);
|
||||
|
||||
if (memcmp(settings->arrays.wifi_driver, "null", 4) != 0)
|
||||
if (string_is_not_equal_fast(settings->arrays.wifi_driver, "null", 4))
|
||||
{
|
||||
CONFIG_ACTION(
|
||||
list, list_info,
|
||||
@ -3249,7 +3249,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 (memcmp(settings->arrays.video_driver, "gl", 2) == 0)
|
||||
if (string_is_equal_fast(settings->arrays.video_driver, "gl", 2))
|
||||
{
|
||||
CONFIG_BOOL(
|
||||
list, list_info,
|
||||
@ -3603,7 +3603,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 (memcmp(settings->arrays.video_driver, "gl", 2) == 0)
|
||||
if (string_is_equal_fast(settings->arrays.video_driver, "gl", 2))
|
||||
{
|
||||
CONFIG_BOOL(
|
||||
list, list_info,
|
||||
@ -3969,7 +3969,7 @@ static bool setting_append_list(
|
||||
settings_data_list_current_add_flags(list, list_info, SD_FLAG_LAKKA_ADVANCED);
|
||||
|
||||
#ifdef HAVE_WASAPI
|
||||
if (memcmp(settings->arrays.audio_driver, "wasapi", 6) == 0)
|
||||
if (string_is_equal_fast(settings->arrays.audio_driver, "wasapi", 6))
|
||||
{
|
||||
CONFIG_BOOL(
|
||||
list, list_info,
|
||||
@ -4789,7 +4789,7 @@ static bool setting_append_list(
|
||||
|
||||
START_SUB_GROUP(list, list_info, "State", &group_info, &subgroup_info, parent_group);
|
||||
|
||||
if (memcmp(settings->arrays.menu_driver, "rgui", 4) != 0)
|
||||
if (string_is_not_equal_fast(settings->arrays.menu_driver, "rgui", 4))
|
||||
{
|
||||
CONFIG_PATH(
|
||||
list, list_info,
|
||||
@ -4821,7 +4821,7 @@ static bool setting_append_list(
|
||||
settings_data_list_current_add_flags(list, list_info, SD_FLAG_LAKKA_ADVANCED);
|
||||
}
|
||||
|
||||
if (memcmp(settings->arrays.menu_driver, "xmb", 3) == 0)
|
||||
if (string_is_equal_fast(settings->arrays.menu_driver, "xmb", 3))
|
||||
{
|
||||
CONFIG_BOOL(
|
||||
list, list_info,
|
||||
@ -5021,7 +5021,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 (memcmp(settings->arrays.menu_driver, "glui", 4) == 0)
|
||||
if (string_is_equal_fast(settings->arrays.menu_driver, "glui", 4))
|
||||
{
|
||||
CONFIG_BOOL(
|
||||
list, list_info,
|
||||
@ -5054,7 +5054,7 @@ static bool setting_append_list(
|
||||
|
||||
#ifdef HAVE_XMB
|
||||
/* only XMB uses these values, don't show them on other drivers */
|
||||
if (memcmp(settings->arrays.menu_driver, "xmb", 3) == 0)
|
||||
if (string_is_equal_fast(settings->arrays.menu_driver, "xmb", 3))
|
||||
{
|
||||
CONFIG_UINT(
|
||||
list, list_info,
|
||||
@ -5275,7 +5275,7 @@ static bool setting_append_list(
|
||||
|
||||
#ifdef HAVE_MATERIALUI
|
||||
/* only MaterialUI uses these values, don't show them on other drivers */
|
||||
if (memcmp(settings->arrays.menu_driver, "glui", 4) == 0)
|
||||
if (string_is_equal_fast(settings->arrays.menu_driver, "glui", 4))
|
||||
{
|
||||
CONFIG_UINT(
|
||||
list, list_info,
|
||||
@ -5335,7 +5335,7 @@ static bool setting_append_list(
|
||||
general_read_handler,
|
||||
SD_FLAG_ADVANCED);
|
||||
|
||||
if (memcmp(settings->arrays.menu_driver, "xmb", 3) == 0)
|
||||
if (string_is_equal_fast(settings->arrays.menu_driver, "xmb", 3))
|
||||
{
|
||||
CONFIG_UINT(
|
||||
list, list_info,
|
||||
@ -5435,7 +5435,7 @@ static bool setting_append_list(
|
||||
|
||||
START_SUB_GROUP(list, list_info, "State", &group_info, &subgroup_info, parent_group);
|
||||
|
||||
if (memcmp(settings->arrays.record_driver, "null", 4) != 0)
|
||||
if (string_is_not_equal_fast(settings->arrays.record_driver, "null", 4))
|
||||
{
|
||||
CONFIG_BOOL(
|
||||
list, list_info,
|
||||
@ -5516,7 +5516,7 @@ static bool setting_append_list(
|
||||
menu_settings_list_current_add_cmd(list, list_info, CMD_EVENT_REINIT);
|
||||
#endif
|
||||
|
||||
if (memcmp(ui_companion_driver_get_ident(), "null", 4) != 0)
|
||||
if (string_is_not_equal_fast(ui_companion_driver_get_ident(), "null", 4))
|
||||
{
|
||||
CONFIG_BOOL(
|
||||
list, list_info,
|
||||
@ -6534,7 +6534,7 @@ static bool setting_append_list(
|
||||
general_write_handler,
|
||||
general_read_handler);
|
||||
|
||||
if (memcmp(settings->arrays.record_driver, "null", 4) != 0)
|
||||
if (string_is_not_equal_fast(settings->arrays.record_driver, "null", 4))
|
||||
{
|
||||
CONFIG_DIR(
|
||||
list, list_info,
|
||||
@ -6690,7 +6690,7 @@ static bool setting_append_list(
|
||||
START_SUB_GROUP(list, list_info, "State",
|
||||
&group_info, &subgroup_info, parent_group);
|
||||
|
||||
if (memcmp(settings->arrays.camera_driver, "null", 4) != 0)
|
||||
if (string_is_not_equal_fast(settings->arrays.camera_driver, "null", 4))
|
||||
{
|
||||
CONFIG_BOOL(
|
||||
list, list_info,
|
||||
@ -6708,7 +6708,7 @@ static bool setting_append_list(
|
||||
SD_FLAG_NONE);
|
||||
}
|
||||
|
||||
if (memcmp(settings->arrays.location_driver, "null", 4) != 0)
|
||||
if (string_is_not_equal_fast(settings->arrays.location_driver, "null", 4))
|
||||
{
|
||||
CONFIG_BOOL(
|
||||
list, list_info,
|
||||
|
@ -140,7 +140,7 @@ const char *msg_hash_to_str(enum msg_hash_enums msg)
|
||||
}
|
||||
#endif
|
||||
|
||||
if (ret && (memcmp(ret, "null", 4) != 0))
|
||||
if (ret && string_is_not_equal_fast(ret, "null", 4))
|
||||
return ret;
|
||||
|
||||
return msg_hash_to_str_us(msg);
|
||||
|
@ -837,16 +837,16 @@ static void retroarch_parse_input(int argc, char *argv[])
|
||||
break;
|
||||
|
||||
case 'M':
|
||||
if (memcmp(optarg, "noload-nosave", 13) == 0)
|
||||
if (string_is_equal_fast(optarg, "noload-nosave", 13))
|
||||
{
|
||||
rarch_is_sram_load_disabled = true;
|
||||
rarch_is_sram_save_disabled = true;
|
||||
}
|
||||
else if (memcmp(optarg, "noload-save", 11) == 0)
|
||||
else if (string_is_equal_fast(optarg, "noload-save", 11))
|
||||
rarch_is_sram_load_disabled = true;
|
||||
else if (memcmp(optarg, "load-nosave", 11) == 0)
|
||||
else if (string_is_equal_fast(optarg, "load-nosave", 11))
|
||||
rarch_is_sram_save_disabled = true;
|
||||
else if (memcmp(optarg, "load-save", 9) != 0)
|
||||
else if (string_is_not_equal_fast(optarg, "load-save", 9))
|
||||
{
|
||||
RARCH_ERR("Invalid argument in --sram-mode.\n");
|
||||
retroarch_print_help(argv[0]);
|
||||
|
@ -160,7 +160,7 @@ static void input_autoconfigure_joypad_add(config_file_t *conf,
|
||||
input_autoconfigure_joypad_conf(conf,
|
||||
input_autoconf_binds[params->idx]);
|
||||
|
||||
if (memcmp(device_type, "remote", 6) == 0)
|
||||
if (string_is_equal_fast(device_type, "remote", 6))
|
||||
{
|
||||
static bool remote_is_bound = false;
|
||||
|
||||
|
@ -282,27 +282,27 @@ int detect_psp_game(const char *track_path, char *game_id)
|
||||
|| (string_is_equal_fast(game_id, "ULUS-", 5))
|
||||
|| (string_is_equal_fast(game_id, "ULJS-", 5))
|
||||
|
||||
|| (memcmp(game_id, "ULEM-", 5) == 0)
|
||||
|| (memcmp(game_id, "ULUM-", 5) == 0)
|
||||
|| (memcmp(game_id, "ULJM-", 5) == 0)
|
||||
|| (string_is_equal_fast(game_id, "ULEM-", 5))
|
||||
|| (string_is_equal_fast(game_id, "ULUM-", 5))
|
||||
|| (string_is_equal_fast(game_id, "ULJM-", 5))
|
||||
|
||||
|| (memcmp(game_id, "UCES-", 5) == 0)
|
||||
|| (memcmp(game_id, "UCUS-", 5) == 0)
|
||||
|| (memcmp(game_id, "UCJS-", 5) == 0)
|
||||
|| (memcmp(game_id, "UCAS-", 5) == 0)
|
||||
|| (string_is_equal_fast(game_id, "UCES-", 5))
|
||||
|| (string_is_equal_fast(game_id, "UCUS-", 5))
|
||||
|| (string_is_equal_fast(game_id, "UCJS-", 5))
|
||||
|| (string_is_equal_fast(game_id, "UCAS-", 5))
|
||||
|
||||
|| (memcmp(game_id, "NPEH-", 5) == 0)
|
||||
|| (memcmp(game_id, "NPUH-", 5) == 0)
|
||||
|| (memcmp(game_id, "NPJH-", 5) == 0)
|
||||
|| (string_is_equal_fast(game_id, "NPEH-", 5))
|
||||
|| (string_is_equal_fast(game_id, "NPUH-", 5))
|
||||
|| (string_is_equal_fast(game_id, "NPJH-", 5))
|
||||
|
||||
|| (memcmp(game_id, "NPEG-", 5) == 0)
|
||||
|| (memcmp(game_id, "NPUG-", 5) == 0)
|
||||
|| (memcmp(game_id, "NPJG-", 5) == 0)
|
||||
|| (memcmp(game_id, "NPHG-", 5) == 0)
|
||||
|| (string_is_equal_fast(game_id, "NPEG-", 5))
|
||||
|| (string_is_equal_fast(game_id, "NPUG-", 5))
|
||||
|| (string_is_equal_fast(game_id, "NPJG-", 5))
|
||||
|| (string_is_equal_fast(game_id, "NPHG-", 5))
|
||||
|
||||
|| (memcmp(game_id, "NPEZ-", 5) == 0)
|
||||
|| (memcmp(game_id, "NPUZ-", 5) == 0)
|
||||
|| (memcmp(game_id, "NPJZ-", 5) == 0)
|
||||
|| (string_is_equal_fast(game_id, "NPEZ-", 5))
|
||||
|| (string_is_equal_fast(game_id, "NPUZ-", 5))
|
||||
|| (string_is_equal_fast(game_id, "NPJZ-", 5))
|
||||
)
|
||||
{
|
||||
filestream_seek(fd, pos, SEEK_SET);
|
||||
|
@ -33,6 +33,7 @@
|
||||
#include <rthreads/rthreads.h>
|
||||
#include <file/file_path.h>
|
||||
#include <retro_miscellaneous.h>
|
||||
#include <string/stdstring.h>
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "../core.h"
|
||||
@ -149,8 +150,8 @@ static void autosave_thread(void *data)
|
||||
bool differ;
|
||||
|
||||
slock_lock(save->lock);
|
||||
differ = memcmp(save->buffer, save->retro_buffer,
|
||||
save->bufsize) != 0;
|
||||
differ = string_is_not_equal_fast(save->buffer, save->retro_buffer,
|
||||
save->bufsize);
|
||||
if (differ)
|
||||
memcpy(save->buffer, save->retro_buffer, save->bufsize);
|
||||
slock_unlock(save->lock);
|
||||
|
@ -22,6 +22,7 @@
|
||||
|
||||
#include <file/file_path.h>
|
||||
#include <queues/task_queue.h>
|
||||
#include <string/stdstring.h>
|
||||
|
||||
#include "cocoa/cocoa_common.h"
|
||||
#include "../ui_companion_driver.h"
|
||||
@ -484,10 +485,11 @@ enum
|
||||
/* Get enabled orientations */
|
||||
apple_frontend_settings.orientation_flags = UIInterfaceOrientationMaskAll;
|
||||
|
||||
if (memcmp(apple_frontend_settings.orientations, "landscape", 9) == 0)
|
||||
if (string_is_equal_fast(apple_frontend_settings.orientations, "landscape", 9))
|
||||
apple_frontend_settings.orientation_flags = UIInterfaceOrientationMaskLandscape;
|
||||
else if (memcmp(apple_frontend_settings.orientations, "portrait", 8) == 0)
|
||||
apple_frontend_settings.orientation_flags = UIInterfaceOrientationMaskPortrait | UIInterfaceOrientationMaskPortraitUpsideDown;
|
||||
else if (string_is_equal_fast(apple_frontend_settings.orientations, "portrait", 8))
|
||||
apple_frontend_settings.orientation_flags = UIInterfaceOrientationMaskPortrait
|
||||
| UIInterfaceOrientationMaskPortraitUpsideDown;
|
||||
}
|
||||
|
||||
- (void)mainMenuRefresh
|
||||
|
Loading…
x
Reference in New Issue
Block a user