Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions cJSON.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
2 changes: 1 addition & 1 deletion cJSON_Utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
4 changes: 2 additions & 2 deletions tests/misc_tests.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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;
Expand Down