mirror of
https://github.com/CTCaer/RetroArch.git
synced 2025-01-19 01:12:33 +00:00
Consistency in how we treat positive strcmp matches
This commit is contained in:
parent
a23cadda07
commit
40f8fabda6
@ -196,7 +196,7 @@ static int exynos_get_device_index(void)
|
||||
|
||||
ver = drmGetVersion(fd);
|
||||
|
||||
if (strcmp("exynos", ver->name) == 0)
|
||||
if (!strcmp("exynos", ver->name))
|
||||
found = true;
|
||||
else
|
||||
++index;
|
||||
|
@ -359,9 +359,9 @@ static sunxi_disp_t *sunxi_disp_init(const char *device)
|
||||
if (!device)
|
||||
device = "/dev/fb0";
|
||||
|
||||
if (strcmp(device, "/dev/fb0") == 0)
|
||||
if (!strcmp(device, "/dev/fb0"))
|
||||
ctx->fb_id = 0;
|
||||
else if (strcmp(device, "/dev/fb1") == 0)
|
||||
else if (!strcmp(device, "/dev/fb1"))
|
||||
ctx->fb_id = 1;
|
||||
else
|
||||
goto error;
|
||||
|
@ -749,13 +749,13 @@ static void set_program_base_attrib(cg_shader_data_t *cg, unsigned i)
|
||||
|
||||
RARCH_LOG("CG: Found semantic \"%s\" in prog #%u.\n", semantic, i);
|
||||
|
||||
if (strcmp(semantic, "TEXCOORD") == 0 || strcmp(semantic, "TEXCOORD0") == 0)
|
||||
if (!strcmp(semantic, "TEXCOORD") || !strcmp(semantic, "TEXCOORD0"))
|
||||
cg->prg[i].tex = param;
|
||||
else if (strcmp(semantic, "COLOR") == 0 || strcmp(semantic, "COLOR0") == 0)
|
||||
else if (!strcmp(semantic, "COLOR") || !strcmp(semantic, "COLOR0"))
|
||||
cg->prg[i].color = param;
|
||||
else if (strcmp(semantic, "POSITION") == 0)
|
||||
else if (!strcmp(semantic, "POSITION"))
|
||||
cg->prg[i].vertex = param;
|
||||
else if (strcmp(semantic, "TEXCOORD1") == 0)
|
||||
else if (!strcmp(semantic, "TEXCOORD1"))
|
||||
cg->prg[i].lut_tex = param;
|
||||
}
|
||||
|
||||
@ -944,7 +944,7 @@ static bool gl_cg_init(void *data, const char *path)
|
||||
|
||||
memset(cg->cg_alias_define, 0, sizeof(cg->cg_alias_define));
|
||||
|
||||
if (path && strcmp(path_get_extension(path), "cgp") == 0)
|
||||
if (path && !strcmp(path_get_extension(path), "cgp"))
|
||||
{
|
||||
if (!load_preset(cg, path))
|
||||
goto error;
|
||||
|
@ -361,7 +361,7 @@ static bool hlsl_init(void *data, const char *path)
|
||||
if (!hlsl)
|
||||
return false;
|
||||
|
||||
if (path && strcmp(path_get_extension(path), ".cgp") == 0)
|
||||
if (path && !strcmp(path_get_extension(path), ".cgp"))
|
||||
{
|
||||
if (!load_preset(hlsl, d3d, path))
|
||||
goto error;
|
||||
|
@ -904,9 +904,9 @@ enum rarch_shader_type video_shader_parse_type(const char *path,
|
||||
|
||||
ext = path_get_extension(path);
|
||||
|
||||
if (strcmp(ext, "cg") == 0 || strcmp(ext, "cgp") == 0)
|
||||
if (!strcmp(ext, "cg") || !strcmp(ext, "cgp"))
|
||||
return RARCH_SHADER_CG;
|
||||
else if (strcmp(ext, "glslp") == 0 || strcmp(ext, "glsl") == 0)
|
||||
else if (!strcmp(ext, "glslp") || !strcmp(ext, "glsl"))
|
||||
return RARCH_SHADER_GLSL;
|
||||
|
||||
return fallback;
|
||||
|
@ -279,7 +279,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") == 0)
|
||||
if (!strcmp(btn, "nul"))
|
||||
bind->joykey = NO_BTN;
|
||||
else
|
||||
{
|
||||
@ -307,7 +307,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") == 0)
|
||||
if (!strcmp(tmp, "nul"))
|
||||
bind->joyaxis = AXIS_NONE;
|
||||
else if (strlen(tmp) >= 2 && (*tmp == '+' || *tmp == '-'))
|
||||
{
|
||||
|
@ -539,7 +539,7 @@ static struct config_entry_list *config_get_entry(const config_file_t *conf,
|
||||
|
||||
for (entry = conf->entries; entry; entry = entry->next)
|
||||
{
|
||||
if (hash == entry->key_hash && strcmp(key, entry->key) == 0)
|
||||
if (hash == entry->key_hash && !strcmp(key, entry->key))
|
||||
return entry;
|
||||
|
||||
previous = entry;
|
||||
@ -848,7 +848,7 @@ bool config_entry_exists(config_file_t *conf, const char *entry)
|
||||
|
||||
while (list)
|
||||
{
|
||||
if (strcmp(entry, list->key) == 0)
|
||||
if (!strcmp(entry, list->key))
|
||||
return true;
|
||||
list = list->next;
|
||||
}
|
||||
|
@ -660,14 +660,14 @@ static void parse_input(int argc, char *argv[])
|
||||
break;
|
||||
|
||||
case 'M':
|
||||
if (strcmp(optarg, "noload-nosave") == 0)
|
||||
if (!strcmp(optarg, "noload-nosave"))
|
||||
{
|
||||
global->sram_load_disable = true;
|
||||
global->sram_save_disable = true;
|
||||
}
|
||||
else if (strcmp(optarg, "noload-save") == 0)
|
||||
else if (!strcmp(optarg, "noload-save"))
|
||||
global->sram_load_disable = true;
|
||||
else if (strcmp(optarg, "load-nosave") == 0)
|
||||
else if (!strcmp(optarg, "load-nosave"))
|
||||
global->sram_save_disable = true;
|
||||
else if (strcmp(optarg, "load-save") != 0)
|
||||
{
|
||||
|
@ -377,7 +377,7 @@ int main(int argc, char *argv[])
|
||||
int i;
|
||||
for (i = 0; i < argc; i ++)
|
||||
{
|
||||
if (strcmp(argv[i], "--") == 0)
|
||||
if (!strcmp(argv[i], "--"))
|
||||
{
|
||||
waiting_argc = argc - i;
|
||||
waiting_argv = argv + i;
|
||||
|
Loading…
x
Reference in New Issue
Block a user