mirror of
https://github.com/dropbox/json11.git
synced 2024-12-15 08:50:05 +08:00
Fixes warning C4800: 'int': forcing value to bool 'true' or 'false' on MSVC 14
This commit is contained in:
parent
913269c7a4
commit
467dc6ae05
14
json11.cpp
14
json11.cpp
@ -375,38 +375,38 @@ struct JsonParser final {
|
||||
if (str[i] == '/') {
|
||||
i++;
|
||||
if (i == str.size())
|
||||
return fail("unexpected end of input inside comment", 0);
|
||||
return !!fail("unexpected end of input inside comment", 0);
|
||||
if (str[i] == '/') { // inline comment
|
||||
i++;
|
||||
if (i == str.size())
|
||||
return fail("unexpected end of input inside inline comment", 0);
|
||||
return !!fail("unexpected end of input inside inline comment", 0);
|
||||
// advance until next line
|
||||
while (str[i] != '\n') {
|
||||
i++;
|
||||
if (i == str.size())
|
||||
return fail("unexpected end of input inside inline comment", 0);
|
||||
return !!fail("unexpected end of input inside inline comment", 0);
|
||||
}
|
||||
comment_found = true;
|
||||
}
|
||||
else if (str[i] == '*') { // multiline comment
|
||||
i++;
|
||||
if (i > str.size()-2)
|
||||
return fail("unexpected end of input inside multi-line comment", 0);
|
||||
return !!fail("unexpected end of input inside multi-line comment", 0);
|
||||
// advance until closing tokens
|
||||
while (!(str[i] == '*' && str[i+1] == '/')) {
|
||||
i++;
|
||||
if (i > str.size()-2)
|
||||
return fail(
|
||||
return !!fail(
|
||||
"unexpected end of input inside multi-line comment", 0);
|
||||
}
|
||||
i += 2;
|
||||
if (i == str.size())
|
||||
return fail(
|
||||
return !!fail(
|
||||
"unexpected end of input inside multi-line comment", 0);
|
||||
comment_found = true;
|
||||
}
|
||||
else
|
||||
return fail("malformed comment", 0);
|
||||
return !!fail("malformed comment", 0);
|
||||
}
|
||||
return comment_found;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user