Sfoglia il codice sorgente

reformatting: cJSON_CreateObject

Max Bruckner 8 anni fa
parent
commit
21a0a88f19
1 ha cambiato i file con 10 aggiunte e 1 eliminazioni
  1. 10 1
      cJSON.c

+ 10 - 1
cJSON.c

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