Sfoglia il codice sorgente

reformatting: cJSON_InitHooks

Max Bruckner 8 anni fa
parent
commit
8db7e6d320
1 ha cambiato i file con 5 aggiunte e 3 eliminazioni
  1. 5 3
      cJSON.c

+ 5 - 3
cJSON.c

@@ -81,14 +81,16 @@ static char* cJSON_strdup(const char* str)
 
 void cJSON_InitHooks(cJSON_Hooks* hooks)
 {
-    if (!hooks) { /* Reset hooks */
+    if (!hooks)
+    {
+        /* Reset hooks */
         cJSON_malloc = malloc;
         cJSON_free = free;
         return;
     }
 
-	cJSON_malloc = (hooks->malloc_fn)?hooks->malloc_fn:malloc;
-	cJSON_free	 = (hooks->free_fn)?hooks->free_fn:free;
+    cJSON_malloc = (hooks->malloc_fn) ? hooks->malloc_fn : malloc;
+    cJSON_free = (hooks->free_fn) ? hooks->free_fn : free;
 }
 
 /* Internal constructor. */