Handle all enum cases in switch
This commit is contained in:
parent
88ddb12afc
commit
b8db20e5f6
30
src/json.hpp
30
src/json.hpp
@ -3251,6 +3251,20 @@ class parser
|
|||||||
break; // LCOV_EXCL_LINE
|
break; // LCOV_EXCL_LINE
|
||||||
}
|
}
|
||||||
|
|
||||||
|
case token_type::uninitialized:
|
||||||
|
|
||||||
|
case token_type::end_array:
|
||||||
|
|
||||||
|
case token_type::end_object:
|
||||||
|
|
||||||
|
case token_type::name_separator:
|
||||||
|
|
||||||
|
case token_type::value_separator:
|
||||||
|
|
||||||
|
case token_type::end_of_input:
|
||||||
|
|
||||||
|
case token_type::literal_or_value:
|
||||||
|
|
||||||
default:
|
default:
|
||||||
{
|
{
|
||||||
// the last token was unexpected; we expected a value
|
// the last token was unexpected; we expected a value
|
||||||
@ -6564,7 +6578,7 @@ class serializer
|
|||||||
// check that the additional bytes are present
|
// check that the additional bytes are present
|
||||||
assert(i + bytes < s.size());
|
assert(i + bytes < s.size());
|
||||||
|
|
||||||
// to use \uxxxx escaping, we first need to calculate
|
// to use \uxxxx escaping, we first need to caluclate
|
||||||
// the codepoint from the UTF-8 bytes
|
// the codepoint from the UTF-8 bytes
|
||||||
int codepoint = 0;
|
int codepoint = 0;
|
||||||
|
|
||||||
@ -8114,6 +8128,8 @@ class basic_json
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
case value_t::discarded:
|
||||||
|
|
||||||
default:
|
default:
|
||||||
{
|
{
|
||||||
object = nullptr; // silence warning, see #821
|
object = nullptr; // silence warning, see #821
|
||||||
@ -8190,6 +8206,18 @@ class basic_json
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
case value_t::null:
|
||||||
|
|
||||||
|
case value_t::boolean:
|
||||||
|
|
||||||
|
case value_t::number_integer:
|
||||||
|
|
||||||
|
case value_t::number_unsigned:
|
||||||
|
|
||||||
|
case value_t::number_float:
|
||||||
|
|
||||||
|
case value_t::discarded:
|
||||||
|
|
||||||
default:
|
default:
|
||||||
{
|
{
|
||||||
break;
|
break;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user