fix compiler warnings

This commit is contained in:
Tim Aitken 2023-09-16 10:02:35 -07:00
parent eac2f9f6dd
commit de2778d939
2 changed files with 9 additions and 8 deletions

1
.gitignore vendored
View File

@ -11,6 +11,7 @@
/doc/doxyfile /doc/doxyfile
/dist/ /dist/
/.cache/ /.cache/
/.vscode/
# MSVC project files: # MSVC project files:
*.sln *.sln

View File

@ -1200,8 +1200,12 @@ bool OurReader::readToken(Token& token) {
token.type_ = tokenHexadecimal; token.type_ = tokenHexadecimal;
ok = features_.allowHexadecimal_; ok = features_.allowHexadecimal_;
readHexadecimal(); readHexadecimal();
break;
} }
else {
token.type_ = tokenNumber;
readNumber(false);
}
break;
case '1': case '1':
case '2': case '2':
case '3': case '3':
@ -1675,16 +1679,12 @@ bool OurReader::decodeHexadecimal(Token& token) {
bool OurReader::decodeHexadecimal(Token& token, Value& decoded) { bool OurReader::decodeHexadecimal(Token& token, Value& decoded) {
Json::LargestUInt value = 0; Json::LargestUInt value = 0;
constexpr Json::LargestUInt top = constexpr Json::LargestUInt top =
Json::LargestUInt(0xF) << (sizeof(top) * 8) - 4; Json::LargestUInt(0xF) << ((sizeof(top) * 8) - 4);
Location current = token.start_; Location current = token.start_ + 2;
while (current < token.end_) { while (current < token.end_) {
Char c = *current++; Char c = *current++;
static_assert('A' < 'a'); if (c >= 'a')
static_assert('0' < 'A');
if (c == 'x')
continue;
else if (c >= 'a')
c -= 'a' - 10; c -= 'a' - 10;
else if (c >= 'A') else if (c >= 'A')
c -= 'A' - 10; c -= 'A' - 10;