1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-16 03:23:15 +01:00

Replace str_is_null_or_empty() with String::IsNullOrEmpty()

This commit is contained in:
Gymnasiast
2023-01-07 15:41:38 +01:00
parent 24247e9c6b
commit a516dc507e
5 changed files with 4 additions and 11 deletions

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);

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;
}

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);
}

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{}());

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();