diff --git a/cJSON.h b/cJSON.h index e97e5f4c..f4c40b35 100644 --- a/cJSON.h +++ b/cJSON.h @@ -111,10 +111,10 @@ typedef struct cJSON /* The type of the item, as above. */ int type; - /* The item's string, if type==cJSON_String and type == cJSON_Raw */ - char *valuestring; /* writing to valueint is DEPRECATED, use cJSON_SetNumberValue instead */ int valueint; + /* The item's string, if type==cJSON_String and type == cJSON_Raw */ + char *valuestring; /* The item's number, if type==cJSON_Number */ double valuedouble; diff --git a/cJSON_Utils.c b/cJSON_Utils.c index c7c64391..92acd205 100644 --- a/cJSON_Utils.c +++ b/cJSON_Utils.c @@ -840,7 +840,7 @@ static int apply_patch(cJSON *object, const cJSON *patch, const cJSON_bool case_ { if (opcode == REMOVE) { - static const cJSON invalid = { NULL, NULL, NULL, cJSON_Invalid, NULL, 0, 0, NULL}; + static const cJSON invalid = { NULL, NULL, NULL, cJSON_Invalid, 0, NULL, 0, NULL}; overwrite_item(object, invalid); diff --git a/tests/misc_tests.c b/tests/misc_tests.c index 3bf0a1cc..0f9580b7 100644 --- a/tests/misc_tests.c +++ b/tests/misc_tests.c @@ -221,7 +221,7 @@ static void cjson_should_not_parse_to_deeply_nested_jsons(void) static void cjson_set_number_value_should_set_numbers(void) { - cJSON number[1] = {{NULL, NULL, NULL, cJSON_Number, NULL, 0, 0, NULL}}; + cJSON number[1] = {{NULL, NULL, NULL, cJSON_Number, 0, NULL, 0, NULL}}; cJSON_SetNumberValue(number, 1.5); TEST_ASSERT_EQUAL(1, number->valueint); @@ -329,7 +329,7 @@ static void cjson_replace_item_via_pointer_should_replace_items(void) static void cjson_replace_item_in_object_should_preserve_name(void) { - cJSON root[1] = {{ NULL, NULL, NULL, 0, NULL, 0, 0, NULL }}; + cJSON root[1] = {{ NULL, NULL, NULL, 0, 0, NULL, 0, NULL }}; cJSON *child = NULL; cJSON *replacement = NULL; cJSON_bool flag = false;