mirror of https://github.com/OpenTTD/OpenTTD
Codechange: remove StrEmpty
parent
d037dbb42a
commit
6a9f694158
|
@ -97,7 +97,7 @@ struct FileStringReader : StringReader {
|
||||||
{
|
{
|
||||||
this->StringReader::ParseFile();
|
this->StringReader::ParseFile();
|
||||||
|
|
||||||
if (StrEmpty(_strgen.lang.name) || StrEmpty(_strgen.lang.own_name) || StrEmpty(_strgen.lang.isocode)) {
|
if (*_strgen.lang.name == '\0' || *_strgen.lang.own_name == '\0' || *_strgen.lang.isocode == '\0') {
|
||||||
FatalError("Language must include ##name, ##ownname and ##isocode");
|
FatalError("Language must include ##name, ##ownname and ##isocode");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -58,18 +58,6 @@ struct CaseInsensitiveComparator {
|
||||||
bool operator()(std::string_view s1, std::string_view s2) const { return StrCompareIgnoreCase(s1, s2) < 0; }
|
bool operator()(std::string_view s1, std::string_view s2) const { return StrCompareIgnoreCase(s1, s2) < 0; }
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
|
||||||
* Check if a string buffer is empty.
|
|
||||||
*
|
|
||||||
* @param s The pointer to the first element of the buffer
|
|
||||||
* @return true if the buffer starts with the terminating null-character or
|
|
||||||
* if the given pointer points to nullptr else return false
|
|
||||||
*/
|
|
||||||
inline bool StrEmpty(const char *s)
|
|
||||||
{
|
|
||||||
return s == nullptr || s[0] == '\0';
|
|
||||||
}
|
|
||||||
|
|
||||||
bool IsValidChar(char32_t key, CharSetFilter afilter);
|
bool IsValidChar(char32_t key, CharSetFilter afilter);
|
||||||
|
|
||||||
size_t Utf8StringLength(std::string_view str);
|
size_t Utf8StringLength(std::string_view str);
|
||||||
|
|
Loading…
Reference in New Issue