This commit is contained in:
Alanscut 2020-06-22 11:23:24 +08:00
parent 7db005e028
commit b95a4c56b0
2 changed files with 4 additions and 4 deletions

View File

@ -92,7 +92,7 @@ CJSON_PUBLIC(const char *) cJSON_GetErrorPtr(void)
return (const char*) (global_error.json + global_error.position); return (const char*) (global_error.json + global_error.position);
} }
CJSON_PUBLIC(char *) cJSON_GetStringValue(cJSON *item) CJSON_PUBLIC(char *) cJSON_GetStringValue(const cJSON * const item)
{ {
if (!cJSON_IsString(item)) if (!cJSON_IsString(item))
{ {
@ -102,7 +102,7 @@ CJSON_PUBLIC(char *) cJSON_GetStringValue(cJSON *item)
return item->valuestring; return item->valuestring;
} }
CJSON_PUBLIC(double) cJSON_GetNumberValue(cJSON *item) CJSON_PUBLIC(double) cJSON_GetNumberValue(const cJSON * const item)
{ {
if (!cJSON_IsNumber(item)) if (!cJSON_IsNumber(item))
{ {

View File

@ -176,8 +176,8 @@ CJSON_PUBLIC(cJSON_bool) cJSON_HasObjectItem(const cJSON *object, const char *st
CJSON_PUBLIC(const char *) cJSON_GetErrorPtr(void); CJSON_PUBLIC(const char *) cJSON_GetErrorPtr(void);
/* Check item type and return its value */ /* Check item type and return its value */
CJSON_PUBLIC(char *) cJSON_GetStringValue(cJSON *item); CJSON_PUBLIC(char *) cJSON_GetStringValue(const cJSON * const item);
CJSON_PUBLIC(double) cJSON_GetNumberValue(cJSON *item); CJSON_PUBLIC(double) cJSON_GetNumberValue(const cJSON * const item);
/* These functions check the type of an item */ /* These functions check the type of an item */
CJSON_PUBLIC(cJSON_bool) cJSON_IsInvalid(const cJSON * const item); CJSON_PUBLIC(cJSON_bool) cJSON_IsInvalid(const cJSON * const item);