diff --git a/cJSON.c b/cJSON.c index 0dd373d814694cf878855ebb29baec2cd9d6b49b_Y0pTT04uYw==..29641daa261d1c9b505f05bde93ea098028a5494_Y0pTT04uYw== 100644 --- a/cJSON.c +++ b/cJSON.c @@ -92,7 +92,7 @@ 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)) { @@ -102,7 +102,7 @@ return item->valuestring; } -CJSON_PUBLIC(double) cJSON_GetNumberValue(cJSON *item) +CJSON_PUBLIC(double) cJSON_GetNumberValue(const cJSON * const item) { if (!cJSON_IsNumber(item)) { diff --git a/cJSON.h b/cJSON.h index 0dd373d814694cf878855ebb29baec2cd9d6b49b_Y0pTT04uaA==..29641daa261d1c9b505f05bde93ea098028a5494_Y0pTT04uaA== 100644 --- a/cJSON.h +++ b/cJSON.h @@ -176,8 +176,8 @@ CJSON_PUBLIC(const char *) cJSON_GetErrorPtr(void); /* Check item type and return its value */ -CJSON_PUBLIC(char *) cJSON_GetStringValue(cJSON *item); -CJSON_PUBLIC(double) cJSON_GetNumberValue(cJSON *item); +CJSON_PUBLIC(char *) cJSON_GetStringValue(const cJSON * const item); +CJSON_PUBLIC(double) cJSON_GetNumberValue(const cJSON * const item); /* These functions check the type of an item */ CJSON_PUBLIC(cJSON_bool) cJSON_IsInvalid(const cJSON * const item);