mirror of
https://github.com/DaveGamble/cJSON.git
synced 2024-12-27 14:14:07 +08:00
Merge pull request #408 from rolegic/patch-api-h-c
Fixed different argument between declaration and definition
This commit is contained in:
commit
6a848fce32
14
cJSON.c
14
cJSON.c
@ -1199,20 +1199,20 @@ CJSON_PUBLIC(char *) cJSON_PrintBuffered(const cJSON *item, int prebuffer, cJSON
|
|||||||
return (char*)p.buffer;
|
return (char*)p.buffer;
|
||||||
}
|
}
|
||||||
|
|
||||||
CJSON_PUBLIC(cJSON_bool) cJSON_PrintPreallocated(cJSON *item, char *buf, const int len, const cJSON_bool fmt)
|
CJSON_PUBLIC(cJSON_bool) cJSON_PrintPreallocated(cJSON *item, char *buffer, const int length, const cJSON_bool format)
|
||||||
{
|
{
|
||||||
printbuffer p = { 0, 0, 0, 0, 0, 0, { 0, 0, 0 } };
|
printbuffer p = { 0, 0, 0, 0, 0, 0, { 0, 0, 0 } };
|
||||||
|
|
||||||
if ((len < 0) || (buf == NULL))
|
if ((length < 0) || (buffer == NULL))
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
p.buffer = (unsigned char*)buf;
|
p.buffer = (unsigned char*)buffer;
|
||||||
p.length = (size_t)len;
|
p.length = (size_t)length;
|
||||||
p.offset = 0;
|
p.offset = 0;
|
||||||
p.noalloc = true;
|
p.noalloc = true;
|
||||||
p.format = fmt;
|
p.format = format;
|
||||||
p.hooks = global_hooks;
|
p.hooks = global_hooks;
|
||||||
|
|
||||||
return print_value(item, &p);
|
return print_value(item, &p);
|
||||||
@ -2290,12 +2290,12 @@ CJSON_PUBLIC(cJSON *) cJSON_CreateFalse(void)
|
|||||||
return item;
|
return item;
|
||||||
}
|
}
|
||||||
|
|
||||||
CJSON_PUBLIC(cJSON *) cJSON_CreateBool(cJSON_bool b)
|
CJSON_PUBLIC(cJSON *) cJSON_CreateBool(cJSON_bool boolean)
|
||||||
{
|
{
|
||||||
cJSON *item = cJSON_New_Item(&global_hooks);
|
cJSON *item = cJSON_New_Item(&global_hooks);
|
||||||
if(item)
|
if(item)
|
||||||
{
|
{
|
||||||
item->type = b ? cJSON_True : cJSON_False;
|
item->type = boolean ? cJSON_True : cJSON_False;
|
||||||
}
|
}
|
||||||
|
|
||||||
return item;
|
return item;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user