Make one-bit bit fields unsigned.
VC++ 2015 gives the following warning when compiling jsoncpp:
json_value.cpp(480): warning C4463: overflow; assigning 1 to bit-field
that can only hold values from -1 to 0
This warning is correct. A signed one-bit value can only hold 0 and -1.
This is true on gcc and clang, but only VC++ 2015 warns about it.
The code works because the stored value is never compared against 1 or
printed, but the current code is likely to cause surprises or bugs in the
future and should be fixed.
Review URL: https://codereview.chromium.org/1060383002
3 files changed