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:
parent
bc47a28653
commit
9955a06dbd
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue