Use string_is_equal more

This commit is contained in:
twinaphex 2016-01-20 06:16:55 +01:00
parent b638b9bee8
commit 157eb71606
8 changed files with 21 additions and 13 deletions

View File

@ -34,6 +34,7 @@
#include <retro_inline.h>
#include <gfx/scaler/scaler.h>
#include <string/stdstring.h>
#include "../../driver.h"
#include "../../general.h"
@ -221,7 +222,7 @@ static int omapfb_detect_screen(omapfb_data_t *pdata)
if (ret < 0)
break;
if (!strcmp(manager_name, buff))
if (string_is_equal(manager_name, buff))
{
snprintf(buff, sizeof(buff), "/sys/devices/platform/omapdss/manager%d/display", i);
ret = omapfb_read_sysfs(buff, display_name, sizeof(display_name));
@ -250,7 +251,7 @@ static int omapfb_detect_screen(omapfb_data_t *pdata)
if (ret < 0)
break;
if (!strcmp(display_name, buff))
if (string_is_equal(display_name, buff))
{
display_id = i;
break;

View File

@ -22,6 +22,7 @@
#include <linux/fb.h>
#include <rthreads/rthreads.h>
#include <string/stdstring.h>
#include "../../general.h"
#include "../../retroarch.h"
@ -359,9 +360,9 @@ static sunxi_disp_t *sunxi_disp_init(const char *device)
if (!device)
device = "/dev/fb0";
if (!strcmp(device, "/dev/fb0"))
if (string_is_equal(device, "/dev/fb0"))
ctx->fb_id = 0;
else if (!strcmp(device, "/dev/fb1"))
else if (string_is_equal(device, "/dev/fb1"))
ctx->fb_id = 1;
else
goto error;

View File

@ -17,6 +17,7 @@
#include <vita2d.h>
#include <retro_inline.h>
#include <string/stdstring.h>
#include "../../defines/psp_defines.h"
#include "../../general.h"
@ -277,7 +278,7 @@ static bool vita2d_gfx_frame(void *data, const void *frame,
}
}
if(msg && strcmp(msg,""))
if(!string_is_empty(msg))
font_driver_render_msg(NULL, msg, NULL);
vita2d_end_drawing();

View File

@ -20,6 +20,8 @@
#include <wayland-client.h>
#include <wayland-egl.h>
#include <string/stdstring.h>
#include "../../driver.h"
#include "../../general.h"
#include "../../runloop.h"
@ -94,9 +96,9 @@ static void registry_handle_global(void *data, struct wl_registry *reg,
(void)version;
if (!strcmp(interface, "wl_compositor"))
if (string_is_equal(interface, "wl_compositor"))
wl->compositor = (struct wl_compositor*)wl_registry_bind(reg, id, &wl_compositor_interface, 1);
else if (!strcmp(interface, "wl_shell"))
else if (string_is_equal(interface, "wl_shell"))
wl->shell = (struct wl_shell*)wl_registry_bind(reg, id, &wl_shell_interface, 1);
}

View File

@ -33,6 +33,7 @@
#include <file/config_file.h>
#include <file/file_path.h>
#include <rhash.h>
#include <string/stdstring.h>
#include "../video_shader_driver.h"
#include "../video_shader_parse.h"
@ -925,7 +926,7 @@ static void *gl_cg_init(void *data, const char *path)
memset(cg_data->cg_alias_define, 0, sizeof(cg_data->cg_alias_define));
if (path && !strcmp(path_get_extension(path), "cgp"))
if (path && string_is_equal(path_get_extension(path), "cgp"))
{
if (!gl_cg_load_preset(cg_data, path))
goto error;

View File

@ -19,6 +19,7 @@
#include <compat/strl.h>
#include <compat/posix_string.h>
#include <file/file_path.h>
#include <string/stdstring.h>
#include "../../general.h"
#include "shader_glsl.h"
@ -764,7 +765,7 @@ static void *gl_glsl_init(void *data, const char *path)
bool ret;
const char *path_ext = path_get_extension(path);
if (!strcmp(path_ext, "glsl"))
if (string_is_equal(path_ext, "glsl"))
{
strlcpy(glsl->shader->pass[0].source.path, path,
sizeof(glsl->shader->pass[0].source.path));
@ -772,7 +773,7 @@ static void *gl_glsl_init(void *data, const char *path)
glsl->shader->modern = true;
ret = true;
}
else if (!strcmp(path_ext, "glslp"))
else if (string_is_equal(path_ext, "glslp"))
{
conf = config_file_new(path);
if (conf)

View File

@ -366,7 +366,7 @@ static void *hlsl_init(void *data, const char *path)
if (!hlsl_data)
return NULL;
if (path && !strcmp(path_get_extension(path), ".cgp"))
if (path && string_is_equal(path_get_extension(path), ".cgp"))
{
if (!hlsl_load_preset(hlsl_data, d3d, path))
goto error;

View File

@ -21,6 +21,7 @@
#include <compat/posix_string.h>
#include <boolean.h>
#include <gfx/math/matrix_4x4.h>
#include <string/stdstring.h>
#include "../../general.h"
#include "../video_state_tracker.h"
@ -77,7 +78,7 @@ static bool shader_null_set_mvp(void *data, void *shader_data, const math_matrix
{
#ifdef HAVE_OPENGL
#ifndef NO_GL_FF_MATRIX
if (!strcmp(video_driver_get_ident(), "gl"))
if (string_is_equal(video_driver_get_ident(), "gl"))
gl_ff_matrix(mat);
#endif
#endif
@ -88,7 +89,7 @@ static bool shader_null_set_coords(void *handle_data, void *shader_data, const v
{
#ifdef HAVE_OPENGL
#ifndef NO_GL_FF_VERTEX
if (!strcmp(video_driver_get_ident(), "gl"))
if (string_is_equal(video_driver_get_ident(), "gl"))
{
const struct gfx_coords *coords = (const struct gfx_coords*)data;
gl_ff_vertex(coords);