NandPaths: Resolve Android tautological comparison warning

Android interprets char as unsigned char, so comparing with 0 triggers a
tautological-unsigned-char-zero-compare warning.

Casting c to an unsigned char and removing the comparison with 0
resolves the warning while needing one less comparison on all platforms.
This commit is contained in:
Dentomologist 2023-08-12 12:53:57 -07:00
parent bc47a28653
commit 9955a06dbd
1 changed files with 1 additions and 1 deletions

View File

@ -107,7 +107,7 @@ static bool IsIllegalCharacter(char c)
{
static const std::unordered_set<char> illegal_chars = {'\"', '*', '/', ':', '<',
'>', '?', '\\', '|', '\x7f'};
return (c >= 0 && c <= 0x1F) || illegal_chars.find(c) != illegal_chars.end();
return static_cast<unsigned char>(c) <= 0x1F || illegal_chars.find(c) != illegal_chars.end();
}
std::string EscapeFileName(const std::string& filename)