From c66ae61c98b7ca676670af7c9d9065df35cf502c Mon Sep 17 00:00:00 2001 From: Mike Sharkey Date: Sat, 13 Feb 2021 00:21:06 -0500 Subject: [PATCH] fixed prototype (double) --- cJSON.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cJSON.h b/cJSON.h index 214d2a3..3505663 100644 --- a/cJSON.h +++ b/cJSON.h @@ -184,7 +184,7 @@ CJSON_PUBLIC(const char *) cJSON_GetErrorPtr(void); /* Check item type and return its value */ CJSON_PUBLIC(char *) cJSON_GetStringValue(const cJSON * const item); -CJSON_PUBLIC(double) cJSON_GetNumberValue(const cJSON * const item); +CJSON_PUBLIC(real_t) cJSON_GetNumberValue(const cJSON * const item); /* These functions check the type of an item */ CJSON_PUBLIC(cJSON_bool) cJSON_IsInvalid(const cJSON * const item); @@ -281,8 +281,8 @@ CJSON_PUBLIC(cJSON*) cJSON_AddArrayToObject(cJSON * const object, const char * c /* When assigning an integer value, it needs to be propagated to valuedouble too. */ #define cJSON_SetIntValue(object, number) ((object) ? (object)->valueint = (object)->valuedouble = (number) : (number)) /* helper for the cJSON_SetNumberValue macro */ -CJSON_PUBLIC(double) cJSON_SetNumberHelper(cJSON *object, real_t number); -#define cJSON_SetNumberValue(object, number) ((object != NULL) ? cJSON_SetNumberHelper(object, (double)number) : (number)) +CJSON_PUBLIC(real_t) cJSON_SetNumberHelper(cJSON *object, real_t number); +#define cJSON_SetNumberValue(object, number) ((object != NULL) ? cJSON_SetNumberHelper(object, (real_t)number) : (number)) /* Change the valuestring of a cJSON_String object, only takes effect when type of object is cJSON_String */ CJSON_PUBLIC(char*) cJSON_SetValuestring(cJSON *object, const char *valuestring);