1
0
mirror of https://github.com/DaveGamble/cJSON synced 2024-12-26 00:22:04 +00:00

reformatting: cJSON_CreateObject

This commit is contained in:
Max Bruckner 2016-09-30 10:51:00 +07:00
parent e241081020
commit 21a0a88f19

11
cJSON.c
View File

@ -1927,7 +1927,16 @@ cJSON *cJSON_CreateArray(void)
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: */
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;}