mirror of
https://github.com/DaveGamble/cJSON.git
synced 2026-10-30 12:56:01 +00:00
reformatting: cJSON_CreateObject
This commit is contained in:
1 parent
e241081020
commit
21a0a88f19
1 file changed
+10
-1
@@ -1927,7 +1927,16 @@ cJSON *cJSON_CreateArray(void)
|
|||||||
return item;
|
return item;
|
||||||
}
|
}
|
||||||
|
|
||||||
cJSON *cJSON_CreateObject(void) {cJSON *item=cJSON_New_Item();if(item)item->type=cJSON_Object;return item;}
|
cJSON *cJSON_CreateObject(void)
|
||||||
|
{
|
||||||
|
cJSON *item = cJSON_New_Item();
|
||||||
|
if (item)
|
||||||
|
{
|
||||||
|
item->type = cJSON_Object;
|
||||||
|
}
|
||||||
|
|
||||||
|
return item;
|
||||||
|
}
|
||||||
|
|
||||||
/* Create Arrays: */
|
/* Create Arrays: */
|
||||||
cJSON *cJSON_CreateIntArray(const int *numbers,int count) {int i;cJSON *n=0,*p=0,*a=cJSON_CreateArray();for(i=0;a && i<count;i++){n=cJSON_CreateNumber(numbers[i]);if(!n){cJSON_Delete(a);return 0;}if(!i)a->child=n;else suffix_object(p,n);p=n;}return a;}
|
cJSON *cJSON_CreateIntArray(const int *numbers,int count) {int i;cJSON *n=0,*p=0,*a=cJSON_CreateArray();for(i=0;a && i<count;i++){n=cJSON_CreateNumber(numbers[i]);if(!n){cJSON_Delete(a);return 0;}if(!i)a->child=n;else suffix_object(p,n);p=n;}return a;}
|
||||||
|
|||||||
Reference in new issue
Block a user