Replace str_is_null_or_empty() with String::IsNullOrEmpty()

This commit is contained in:
Gymnasiast committed 2023-01-08 16:19:18 +01:00
1 parent 24247e9c6b
commit a516dc507e
5 files changed
+4 -11

No files matched your search

+1 -1
View File
@@ -589,7 +589,7 @@ public:
}
// Disable the Up button if the current directory is the root directory
if (str_is_null_or_empty(_parentDirectory) && !drives)
if (String::IsNullOrEmpty(_parentDirectory) && !drives)
disabled_widgets |= (1uLL << WIDX_UP);
else
disabled_widgets &= ~(1uLL << WIDX_UP);
+2 -2
View File
@@ -540,7 +540,7 @@ static void WindowScenarioselectPaint(rct_window* w, rct_drawpixelinfo* dpi)
{
// TODO: Should probably be translatable
const utf8* completedByName = "???";
if (!str_is_null_or_empty(scenario->highscore->name))
if (!String::IsNullOrEmpty(scenario->highscore->name))
{
completedByName = scenario->highscore->name;
}
@@ -624,7 +624,7 @@ static void WindowScenarioselectScrollpaint(rct_window* w, rct_drawpixelinfo* dp
// Draw completion score
const utf8* completedByName = "???";
if (!str_is_null_or_empty(scenario->highscore->name))
if (!String::IsNullOrEmpty(scenario->highscore->name))
{
completedByName = scenario->highscore->name;
}
+1 -1
View File
@@ -290,7 +290,7 @@ public:
}
// IME composition
if (!str_is_null_or_empty(gTextInput->ImeBuffer))
if (!String::IsNullOrEmpty(gTextInput->ImeBuffer))
{
DrawIMEComposition(dpi, cursorX, cursorY);
}
-5
View File
@@ -336,11 +336,6 @@ char* safe_strcat(char* destination, const char* source, size_t size)
return result;
}
bool str_is_null_or_empty(const char* str)
{
return str == nullptr || str[0] == 0;
}
uint32_t util_rand()
{
thread_local std::mt19937 _prng(std::random_device{}());
-2
View File
@@ -34,8 +34,6 @@ int32_t strlogicalcmp(char const* a, char const* b);
char* safe_strcpy(char* destination, const char* source, size_t num);
char* safe_strcat(char* destination, const char* source, size_t size);
bool str_is_null_or_empty(const char* str);
uint32_t util_rand();
float util_rand_normal_distributed();