mirror of
https://github.com/DaveGamble/cJSON.git
synced 2023-08-10 21:13:26 +03:00
reformatting: cJSON_CreateTrue
This commit is contained in:
parent
cf7835b67d
commit
fdfb9fff86
12
cJSON.c
12
cJSON.c
@ -1853,7 +1853,17 @@ cJSON *cJSON_CreateNull(void)
|
||||
return item;
|
||||
}
|
||||
|
||||
cJSON *cJSON_CreateTrue(void) {cJSON *item=cJSON_New_Item();if(item)item->type=cJSON_True;return item;}
|
||||
cJSON *cJSON_CreateTrue(void)
|
||||
{
|
||||
cJSON *item = cJSON_New_Item();
|
||||
if(item)
|
||||
{
|
||||
item->type = cJSON_True;
|
||||
}
|
||||
|
||||
return item;
|
||||
}
|
||||
|
||||
cJSON *cJSON_CreateFalse(void) {cJSON *item=cJSON_New_Item();if(item)item->type=cJSON_False;return item;}
|
||||
cJSON *cJSON_CreateBool(int b) {cJSON *item=cJSON_New_Item();if(item)item->type=b?cJSON_True:cJSON_False;return item;}
|
||||
cJSON *cJSON_CreateNumber(double num) {cJSON *item=cJSON_New_Item();if(item){item->type=cJSON_Number;item->valuedouble=num;item->valueint=(int)num;}return item;}
|
||||
|
Loading…
Reference in New Issue
Block a user