Fix warning: enumeration value not handled in switch

./src/json.hpp:9339:21: warning: enumeration values 'number_integer', 'number_unsigned',
      and 'number_float' not explicitly handled in switch [-Wswitch-enum]
This commit is contained in:
Cristian Maglie 2017-04-15 13:13:36 +02:00
parent cdecd1b162
commit 523cc21514
2 changed files with 36 additions and 34 deletions

View File

@ -9334,7 +9334,6 @@ class basic_json
@since version 1.0.0, public since 2.1.0 @since version 1.0.0, public since 2.1.0
*/ */
std::string type_name() const std::string type_name() const
{
{ {
switch (m_type) switch (m_type)
{ {
@ -9350,10 +9349,12 @@ class basic_json
return "boolean"; return "boolean";
case value_t::discarded: case value_t::discarded:
return "discarded"; return "discarded";
default: case value_t::number_unsigned:
case value_t::number_integer:
case value_t::number_float:
return "number"; return "number";
} }
} assert(false);
} }

View File

@ -9334,7 +9334,6 @@ class basic_json
@since version 1.0.0, public since 2.1.0 @since version 1.0.0, public since 2.1.0
*/ */
std::string type_name() const std::string type_name() const
{
{ {
switch (m_type) switch (m_type)
{ {
@ -9350,10 +9349,12 @@ class basic_json
return "boolean"; return "boolean";
case value_t::discarded: case value_t::discarded:
return "discarded"; return "discarded";
default: case value_t::number_unsigned:
case value_t::number_integer:
case value_t::number_float:
return "number"; return "number";
} }
} assert(false);
} }