diff options
| author | Dentomologist <dentomologist@gmail.com> | 2023-08-12 12:53:57 -0700 |
|---|---|---|
| committer | Dentomologist <dentomologist@gmail.com> | 2023-08-12 14:00:41 -0700 |
| commit | 9955a06dbd7effb451a67e09720222fac8ba9601 (patch) | |
| tree | 684cf82c572db5c4ef3678128ab0b49525d9434c /Source/Core | |
| parent | bc47a286535527f46569b8a0ec0a0b402c83ec3c (diff) | |
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.
Diffstat (limited to 'Source/Core')
| -rw-r--r-- | Source/Core/Common/NandPaths.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Source/Core/Common/NandPaths.cpp b/Source/Core/Common/NandPaths.cpp index c9217565bb..e6f2d2a88b 100644 --- a/Source/Core/Common/NandPaths.cpp +++ b/Source/Core/Common/NandPaths.cpp @@ -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) |
