Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 29 additions & 8 deletions src/SB/Core/x/xString.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,21 +61,42 @@ char* xStrupr(char* string)
return string;
}

// @unnamed@xString_cpp@::tolower(char)
extern "C" {
U32 tolower__21_esc__2_unnamed_esc__2_xString_cpp_esc__2_Fc(U32 param_1)
namespace
{
return tolower__21_esc__2_unnamed_esc__2_xString_cpp_esc__2_Fi(param_1 & 0xff);
U32 tolower(char param_1);
U32 tolower(S32 param_1);
} // namespace

S32 imemcmp(void const* d1, void const* d2, size_t size)
{
const char* s1 = (char*)d1;
const char* s2 = (char*)d2;

for (size_t i = 0; i < size; i++)
{
S32 cval1 = tolower(s1[i]);
S32 cval2 = tolower(s2[i]);
if (cval1 != cval2)
{
return cval1 - cval2;
}
}

return 0;
}

// @unnamed@xString_cpp@::tolower(int)
extern "C" {
U32 tolower__21_esc__2_unnamed_esc__2_xString_cpp_esc__2_Fi(U32 param_1)
namespace
{
U32 tolower(char param_1)
{
return tolower((S32)param_1);
}

U32 tolower(S32 param_1)
{
return param_1 | ((param_1 >> 1) & 32);
}
}
} // End anonymous namespace

S32 icompare(const substr& s1, const substr& s2)
{
Expand Down
9 changes: 2 additions & 7 deletions src/SB/Core/x/xString.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ struct substr
U32 xStrHash(const char* str);
U32 xStrHash(const char* str, size_t size);
U32 xStrHashCat(U32 prefix, const char* str);
char* xStrupr(char* string);
S32 xStricmp(const char* string1, const char* string2);
char* xStrTok(char* string, const char* control, char** nextoken);
char* xStrTokBuffer(const char* string, const char* control, void* buffer);
S32 xStricmp(const char* string1, const char* string2);
char* xStrupr(char* string);
S32 xStrParseFloatList(F32* dest, const char* strbuf, S32 max);

S32 imemcmp(void const* d1, void const* d2, size_t size);
Expand All @@ -39,9 +39,4 @@ size_t atox(const substr& s, size_t& read_size);
size_t trim_ws(substr& s);
size_t trim_ws(const char*& text, size_t& size);

extern "C" {
U32 tolower__21_esc__2_unnamed_esc__2_xString_cpp_esc__2_Fc(U32 param_1);
U32 tolower__21_esc__2_unnamed_esc__2_xString_cpp_esc__2_Fi(U32 param_1);
}

#endif