reformatting: cJSON_CreateObject

This commit is contained in:
Max Bruckner 2016-09-30 10:51:00 +07:00
parent e241081020
commit 21a0a88f19
1 changed files with 10 additions and 1 deletions

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;}