Use string_is_equal more

This commit is contained in:
twinaphex 2016-01-20 04:54:17 +01:00
parent 64e43a9935
commit 528a03f6f4
7 changed files with 31 additions and 28 deletions

View File

@ -14,6 +14,7 @@
*/
#include <file/file_path.h>
#include <string/stdstring.h>
#include "../menu_driver.h"
#include "../menu_cbs.h"
@ -312,7 +313,7 @@ static int playlist_association_left(unsigned type, const char *label,
for (i = 0; i < list->count; i++)
{
core_info_t *info = core_info_get(list, i);
if (!strcmp(info->path, core_path))
if (string_is_equal(info->path, core_path))
current = i;
}

View File

@ -15,6 +15,7 @@
#include <file/file_path.h>
#include <string/string_list.h>
#include <string/stdstring.h>
#include "../menu_driver.h"
#include "../menu_cbs.h"
@ -328,7 +329,7 @@ static int playlist_association_right(unsigned type, const char *label,
for (i = 0; i < list->count; i++)
{
core_info_t *info = core_info_get(list, i);
if (!strcmp(info->path, core_path))
if (string_is_equal(info->path, core_path))
current = i;
}

View File

@ -499,14 +499,14 @@ static void mui_render_label_value(mui_handle_t *mui,
hash_value = menu_hash_calculate(value);
if (!strcmp(value, "disabled") || !strcmp(value, "off"))
if (string_is_equal(value, "disabled") || string_is_equal(value, "off"))
{
if (mui->textures.list[MUI_TEXTURE_SWITCH_OFF].id)
texture_switch = mui->textures.list[MUI_TEXTURE_SWITCH_OFF].id;
else
do_draw_text = true;
}
else if (!strcmp(value, "enabled") || !strcmp(value, "on"))
else if (string_is_equal(value, "enabled") || string_is_equal(value, "on"))
{
if (mui->textures.list[MUI_TEXTURE_SWITCH_ON].id)
texture_switch = mui->textures.list[MUI_TEXTURE_SWITCH_ON].id;

View File

@ -802,7 +802,7 @@ static void xmb_list_switch_new(xmb_handle_t *xmb,
if (!path_file_exists(path))
xmb_fill_default_background_path(xmb, path, sizeof(path));
if(strcmp(path, xmb->background_file_path) != 0)
if(!string_is_equal(path, xmb->background_file_path))
{
if(path_file_exists(path))
{
@ -1404,16 +1404,16 @@ static void xmb_draw_items(xmb_handle_t *xmb,
break;
}
if (!strcmp(entry.value, "disabled") ||
!strcmp(entry.value, "off"))
if (string_is_equal(entry.value, "disabled") ||
string_is_equal(entry.value, "off"))
{
if (xmb->textures.list[XMB_TEXTURE_SWITCH_OFF].id)
texture_switch = xmb->textures.list[XMB_TEXTURE_SWITCH_OFF].id;
else
do_draw_text = true;
}
else if (!strcmp(entry.value, "enabled") ||
!strcmp(entry.value, "on"))
else if (string_is_equal(entry.value, "enabled") ||
string_is_equal(entry.value, "on"))
{
if (xmb->textures.list[XMB_TEXTURE_SWITCH_ON].id)
texture_switch = xmb->textures.list[XMB_TEXTURE_SWITCH_ON].id;

View File

@ -19,6 +19,7 @@
#include <queues/message_queue.h>
#include <retro_miscellaneous.h>
#include <formats/image.h>
#include <string/stdstring.h>
#include "../config.def.h"
#include "../retroarch.h"
@ -171,11 +172,11 @@ static bool menu_display_check_compatibility(enum menu_display_driver_type type)
case MENU_VIDEO_DRIVER_GENERIC:
return true;
case MENU_VIDEO_DRIVER_OPENGL:
if (!strcmp(video_driver, "gl"))
if (string_is_equal(video_driver, "gl"))
return true;
break;
case MENU_VIDEO_DRIVER_DIRECT3D:
if (!strcmp(video_driver, "d3d"))
if (string_is_equal(video_driver, "d3d"))
return true;
break;
}

View File

@ -115,7 +115,7 @@ static void print_buf_lines(file_list_t *list, char *buf, int buf_size,
last = (char*)strrchr(core_path, '_');
if (*last)
{
if (strcmp(last, "_libretro"))
if (!string_is_equal(last, "_libretro"))
*last = '\0';
}
strlcat(core_path, ".info", sizeof(core_path));
@ -1204,15 +1204,15 @@ static int menu_displaylist_parse_database_entry(menu_displaylist_info_t *info)
switch (hash_value)
{
case MENU_VALUE_CRC:
if (!strcmp(crc_str, elem0))
if (string_is_equal(crc_str, elem0))
match_found = true;
break;
case MENU_VALUE_SHA1:
if (!strcmp(db_info_entry->sha1, elem0))
if (string_is_equal(db_info_entry->sha1, elem0))
match_found = true;
break;
case MENU_VALUE_MD5:
if (!strcmp(db_info_entry->md5, elem0))
if (string_is_equal(db_info_entry->md5, elem0))
match_found = true;
break;
}
@ -1703,7 +1703,7 @@ static int menu_displaylist_parse_horizontal_list(menu_displaylist_info_t *info)
content_playlist_qsort(playlist, menu_displaylist_sort_playlist);
if (!strcmp(lpl_basename, "content_history"))
if (string_is_equal(lpl_basename, "content_history"))
is_historylist = true;
menu_displaylist_parse_playlist(info, playlist, path_playlist, is_historylist);
@ -1819,7 +1819,7 @@ static int menu_displaylist_parse_horizontal_content_actions(menu_displaylist_in
runloop_ctl(RUNLOOP_CTL_GET_CONTENT_PATH, &fullpath);
if (!rarch_ctl(RARCH_CTL_IS_DUMMY_CORE, NULL)
&& !strcmp(menu->deferred_path, fullpath))
&& string_is_equal(menu->deferred_path, fullpath))
menu_displaylist_parse_load_content_settings(info);
else
menu_entries_push(info->list, "Run", "collection",
@ -2344,7 +2344,7 @@ bool menu_playlist_find_associated_core(const char *path, char *s, size_t len)
for (j = 0; j < existing_core_names->size; j++)
{
if (!strcmp(path, existing_core_names->elems[j].data))
if (string_is_equal(path, existing_core_names->elems[j].data))
{
if (existing_core_paths)
{
@ -2930,7 +2930,7 @@ int menu_displaylist_push_list(menu_displaylist_info_t *info, unsigned type)
#endif
break;
case DISPLAYLIST_PLAYLIST_COLLECTION:
if (!strcmp(info->path, "content_history.lpl"))
if (string_is_equal(info->path, "content_history.lpl"))
{
if (menu_displaylist_push_list(info, DISPLAYLIST_HISTORY) == 0)
menu_displaylist_push_list_process(info);

View File

@ -1875,7 +1875,7 @@ rarch_setting_t *menu_setting_find(const char *label)
if (needle == setting->name_hash && menu_setting_get_type(setting) <= ST_GROUP)
{
/* make sure this isn't a collision */
if (strcmp(label, name) != 0)
if (!string_is_equal(label, name))
continue;
if (string_is_empty(short_description))
@ -2050,9 +2050,9 @@ int menu_setting_set_with_string_representation(rarch_setting_t* setting,
strlcpy(setting->value.string, value, setting->size);
break;
case ST_BOOL:
if (!strcmp(value, "true"))
if (string_is_equal(value, "true"))
*setting->value.boolean = true;
else if (!strcmp(value, "false"))
else if (string_is_equal(value, "false"))
*setting->value.boolean = false;
break;
default:
@ -4359,7 +4359,7 @@ static bool setting_append_list_video_options(
(*list)[list_info->index - 1].get_string_representation =
&setting_get_string_representation_st_float_video_refresh_rate_auto;
if (!strcmp(settings->video.driver, "gl"))
if (string_is_equal(settings->video.driver, "gl"))
{
CONFIG_BOOL(
list, list_info,
@ -5857,7 +5857,7 @@ static bool setting_append_list_multimedia_options(
START_SUB_GROUP(list, list_info, "State", &group_info, &subgroup_info, parent_group);
if (strcmp(settings->record.driver, "null") != 0)
if (!string_is_equal(settings->record.driver, "null"))
CONFIG_BOOL(
list, list_info,
&settings->multimedia.builtin_mediaplayer_enable,
@ -6884,7 +6884,7 @@ static bool setting_append_list_directory_options(
list_info,
SD_FLAG_ALLOW_EMPTY | SD_FLAG_PATH_DIR | SD_FLAG_BROWSER_ACTION);
if (strcmp(settings->record.driver, "null") != 0)
if (!string_is_equal(settings->record.driver, "null"))
{
CONFIG_DIR(
list, list_info,
@ -7109,7 +7109,7 @@ static bool setting_append_list_privacy_options(
START_SUB_GROUP(list, list_info, "State",
&group_info, &subgroup_info, parent_group);
if (strcmp(settings->camera.driver, "null") != 0)
if (!string_is_equal(settings->camera.driver, "null"))
{
CONFIG_BOOL(
list, list_info,
@ -7126,7 +7126,7 @@ static bool setting_append_list_privacy_options(
general_read_handler);
}
if (strcmp(settings->location.driver, "null") != 0)
if (!string_is_equal(settings->location.driver, "null"))
{
CONFIG_BOOL(
list, list_info,
@ -7253,7 +7253,7 @@ rarch_setting_t *menu_setting_new(void)
{
settings_t *settings = config_get_ptr();
if (strcmp(settings->record.driver, "null") != 0)
if (!string_is_equal(settings->record.driver, "null"))
{
if (!setting_append_list_recording_options(&list, list_info, root))
goto error;