]> git.feebdaed.xyz Git - 0xmirror/cJSON.git/commitdiff
false has been redefined to cJSON_False
authorAlanscut <wp_scut@163.com>
Wed, 1 Apr 2020 11:19:00 +0000 (19:19 +0800)
committerAlanscut <wp_scut@163.com>
Wed, 1 Apr 2020 11:19:00 +0000 (19:19 +0800)
cJSON.c
tests/misc_tests.c

diff --git a/cJSON.c b/cJSON.c
index acb28b12f7dfb9961b481d5ef4401f82efcde736..95cbc8ba8a11770826c00e3765ed5f5794eabbd8 100644 (file)
--- a/cJSON.c
+++ b/cJSON.c
@@ -1977,7 +1977,7 @@ CJSON_PUBLIC(cJSON_bool) cJSON_AddItemReferenceToArray(cJSON *array, cJSON *item
 {
     if (array == NULL)
     {
-        return cJSON_False;
+        return false;
     }
 
     return add_item_to_array(array, create_reference(item, &global_hooks));
@@ -1987,7 +1987,7 @@ CJSON_PUBLIC(cJSON_bool) cJSON_AddItemReferenceToObject(cJSON *object, const cha
 {
     if ((object == NULL) || (string == NULL))
     {
-        return cJSON_False;
+        return false;
     }
 
     return add_item_to_object(object, string, create_reference(item, &global_hooks), &global_hooks, false);
index 161407e2898530eac68aa868bdb28ec6c789ac34..d8c2a375ac779d385b4b8677fa1f5b55833dfe59 100644 (file)
@@ -332,7 +332,7 @@ static void cjson_replace_item_in_object_should_preserve_name(void)
     cJSON root[1] = {{ NULL, NULL, NULL, 0, NULL, 0, 0, NULL }};
     cJSON *child = NULL;
     cJSON *replacement = NULL;
-    cJSON_bool flag = cJSON_False;
+    cJSON_bool flag = false;
 
     child = cJSON_CreateNumber(1);
     TEST_ASSERT_NOT_NULL(child);
@@ -537,7 +537,7 @@ static void cjson_add_item_to_object_or_array_should_not_add_itself(void)
 {
     cJSON *object = cJSON_CreateObject();
     cJSON *array = cJSON_CreateArray();
-    cJSON_bool flag = cJSON_False;
+    cJSON_bool flag = false;
 
     flag = cJSON_AddItemToObject(object, "key", object);
     TEST_ASSERT_FALSE_MESSAGE(flag, "add an object to itself should fail");