Create string_is_equal_case_insensitive
This commit is contained in:
parent
2f457af8bf
commit
df7f47d00a
|
@ -1147,8 +1147,7 @@ enum rarch_shader_type video_shader_get_type_from_ext(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (
|
if (
|
||||||
string_is_equal(ext, "cgp") ||
|
string_is_equal_case_insensitive(ext, "cgp")
|
||||||
string_is_equal(ext, "CGP")
|
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
*is_preset = true;
|
*is_preset = true;
|
||||||
|
@ -1180,8 +1179,7 @@ enum rarch_shader_type video_shader_get_type_from_ext(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (
|
if (
|
||||||
string_is_equal(ext, "glsl") ||
|
string_is_equal_case_insensitive(ext, "glsl")
|
||||||
string_is_equal(ext, "GLSL")
|
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
switch (api)
|
switch (api)
|
||||||
|
@ -1194,8 +1192,7 @@ enum rarch_shader_type video_shader_get_type_from_ext(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (
|
if (
|
||||||
string_is_equal(ext, "glslp") ||
|
string_is_equal_case_insensitive(ext, "glslp")
|
||||||
string_is_equal(ext, "GLSLP")
|
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
*is_preset = true;
|
*is_preset = true;
|
||||||
|
@ -1209,8 +1206,7 @@ enum rarch_shader_type video_shader_get_type_from_ext(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (
|
if (
|
||||||
string_is_equal(ext, "slang") ||
|
string_is_equal_case_insensitive(ext, "slang")
|
||||||
string_is_equal(ext, "SLANG")
|
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
switch (api)
|
switch (api)
|
||||||
|
@ -1225,8 +1221,7 @@ enum rarch_shader_type video_shader_get_type_from_ext(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (
|
if (
|
||||||
string_is_equal(ext, "slangp") ||
|
string_is_equal_case_insensitive(ext, "slangp")
|
||||||
string_is_equal(ext, "SLANGP")
|
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
*is_preset = true;
|
*is_preset = true;
|
||||||
|
|
|
@ -75,9 +75,28 @@ static INLINE void string_add_between_pairs(char *s, const char *str,
|
||||||
#define string_is_not_equal_fast(a, b, size) (memcmp(a, b, size) != 0)
|
#define string_is_not_equal_fast(a, b, size) (memcmp(a, b, size) != 0)
|
||||||
#define string_is_equal_fast(a, b, size) (memcmp(a, b, size) == 0)
|
#define string_is_equal_fast(a, b, size) (memcmp(a, b, size) == 0)
|
||||||
|
|
||||||
|
static INLINE bool string_is_equal_case_insensitive(const char *a,
|
||||||
|
const char *b)
|
||||||
|
{
|
||||||
|
int result = 0;
|
||||||
|
const unsigned char *p1 = (const unsigned char*)a;
|
||||||
|
const unsigned char *p2 = (const unsigned char*)b;
|
||||||
|
|
||||||
|
if (!a || !b)
|
||||||
|
return false;
|
||||||
|
if (p1 == p2)
|
||||||
|
return true;
|
||||||
|
|
||||||
|
while ((result = tolower (*p1) - tolower (*p2++)) == 0)
|
||||||
|
if (*p1++ == '\0')
|
||||||
|
break;
|
||||||
|
|
||||||
|
return (result == 0);
|
||||||
|
}
|
||||||
|
|
||||||
static INLINE bool string_is_equal_noncase(const char *a, const char *b)
|
static INLINE bool string_is_equal_noncase(const char *a, const char *b)
|
||||||
{
|
{
|
||||||
int result;
|
int result = 0;
|
||||||
const unsigned char *p1 = (const unsigned char*)a;
|
const unsigned char *p1 = (const unsigned char*)a;
|
||||||
const unsigned char *p2 = (const unsigned char*)b;
|
const unsigned char *p2 = (const unsigned char*)b;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue