mirror of
https://github.com/DaveGamble/cJSON.git
synced 2023-08-10 21:13:26 +03:00
Compiler flag -Wswitch-default + add defaults
This commit is contained in:
9
cJSON.c
9
cJSON.c
@@ -645,6 +645,9 @@ static const char *parse_string(cJSON *item, const char *str, const char **ep)
|
||||
/* depending on the length in bytes this determines the
|
||||
* encoding ofthe first UTF8 byte */
|
||||
*--ptr2 = (uc | firstByteMark[len]);
|
||||
default:
|
||||
*ep = str;
|
||||
return NULL;
|
||||
}
|
||||
ptr2 += len;
|
||||
break;
|
||||
@@ -1032,6 +1035,9 @@ static char *print_value(const cJSON *item, int depth, cjbool fmt, printbuffer *
|
||||
case cJSON_Object:
|
||||
out = print_object(item, depth, fmt, p);
|
||||
break;
|
||||
default:
|
||||
out = NULL;
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -1062,6 +1068,9 @@ static char *print_value(const cJSON *item, int depth, cjbool fmt, printbuffer *
|
||||
case cJSON_Object:
|
||||
out = print_object(item, depth, fmt, 0);
|
||||
break;
|
||||
default:
|
||||
out = NULL;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user