return cJSON_ParseWithOpts(value, 0, 0);
}
+#ifndef min
#define min(a, b) ((a < b) ? a : b)
+#endif
static unsigned char *print(const cJSON * const item, cjbool format, const internal_hooks * const hooks)
{
{
global_hooks.deallocate(item->string);
}
+#ifdef __GNUC__
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wcast-qual"
+#endif
item->string = (char*)string;
+#ifdef __GNUC__
#pragma GCC diagnostic pop
+#endif
item->type |= cJSON_StringIsConst;
cJSON_AddItemToArray(object, item);
}
CJSON_PUBLIC(cJSON *) cJSON_GetArrayItem(const cJSON *array, int item);
/* Get item "string" from object. Case insensitive. */
CJSON_PUBLIC(cJSON *) cJSON_GetObjectItem(const cJSON *object, const char *string);
-CJSON_PUBLIC(cJSON *) cJSON_GetObjectItemCaseSensitive(const cJSON *object, const char *string);
+CJSON_PUBLIC(cJSON *) cJSON_GetObjectItemCaseSensitive(const cJSON * const object, const char * const string);
CJSON_PUBLIC(int) cJSON_HasObjectItem(const cJSON *object, const char *string);
/* For analysing failed parses. This returns a pointer to the parse error. You'll probably need to look a few chars back to make sense of it. Defined when cJSON_Parse() returns 0. 0 when cJSON_Parse() succeeds. */
CJSON_PUBLIC(const char *) cJSON_GetErrorPtr(void);