mirror of
https://github.com/decompals/wibo.git
synced 2025-12-19 09:55:41 +00:00
Cleanup various lints and warnings
This commit is contained in:
@@ -36,14 +36,26 @@ uint16_t wcharToLower(uint16_t ch) {
|
||||
if (ch >= 'A' && ch <= 'Z') {
|
||||
return static_cast<uint16_t>(ch + ('a' - 'A'));
|
||||
}
|
||||
wchar_t wide = static_cast<wchar_t>(ch);
|
||||
wchar_t lowered = std::towlower(wide);
|
||||
if (lowered < 0 || lowered > 0xFFFF) {
|
||||
wint_t wide = static_cast<wint_t>(ch);
|
||||
wint_t lowered = std::towlower(wide);
|
||||
if (lowered > 0xFFFF) {
|
||||
return ch;
|
||||
}
|
||||
return static_cast<uint16_t>(lowered);
|
||||
}
|
||||
|
||||
uint16_t wcharToUpper(uint16_t ch) {
|
||||
if (ch >= 'a' && ch <= 'z') {
|
||||
return static_cast<uint16_t>(ch - ('a' - 'A'));
|
||||
}
|
||||
wint_t wide = static_cast<wint_t>(ch);
|
||||
wint_t uppered = std::towupper(wide);
|
||||
if (uppered > 0xFFFF) {
|
||||
return ch;
|
||||
}
|
||||
return static_cast<uint16_t>(uppered);
|
||||
}
|
||||
|
||||
size_t wstrlen(const uint16_t *str) {
|
||||
if (!str)
|
||||
return 0;
|
||||
|
||||
Reference in New Issue
Block a user