|
@@ -1886,7 +1886,19 @@ cJSON *cJSON_CreateBool(int b)
|
|
|
return item;
|
|
|
}
|
|
|
|
|
|
-cJSON *cJSON_CreateNumber(double num) {cJSON *item=cJSON_New_Item();if(item){item->type=cJSON_Number;item->valuedouble=num;item->valueint=(int)num;}return item;}
|
|
|
+cJSON *cJSON_CreateNumber(double num)
|
|
|
+{
|
|
|
+ cJSON *item = cJSON_New_Item();
|
|
|
+ if(item)
|
|
|
+ {
|
|
|
+ item->type = cJSON_Number;
|
|
|
+ item->valuedouble = num;
|
|
|
+ item->valueint = (int)num;
|
|
|
+ }
|
|
|
+
|
|
|
+ return item;
|
|
|
+}
|
|
|
+
|
|
|
cJSON *cJSON_CreateString(const char *string) {cJSON *item=cJSON_New_Item();if(item){item->type=cJSON_String;item->valuestring=cJSON_strdup(string);if(!item->valuestring){cJSON_Delete(item);return 0;}}return item;}
|
|
|
cJSON *cJSON_CreateArray(void) {cJSON *item=cJSON_New_Item();if(item)item->type=cJSON_Array;return item;}
|
|
|
cJSON *cJSON_CreateObject(void) {cJSON *item=cJSON_New_Item();if(item)item->type=cJSON_Object;return item;}
|