|
@@ -1580,6 +1580,10 @@ CJSON_PUBLIC(void) cJSON_AddItemToObject(cJSON *object, const char *string, cJSO
|
|
item->type &= ~cJSON_StringIsConst;
|
|
item->type &= ~cJSON_StringIsConst;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+#if defined (__clang__) || ((__GNUC__) && ((__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ > 5))))
|
|
|
|
+ #pragma GCC diagnostic push
|
|
|
|
+#endif
|
|
|
|
+#pragma GCC diagnostic ignored "-Wcast-qual"
|
|
/* Add an item to an object with constant string as key */
|
|
/* Add an item to an object with constant string as key */
|
|
CJSON_PUBLIC(void) cJSON_AddItemToObjectCS(cJSON *object, const char *string, cJSON *item)
|
|
CJSON_PUBLIC(void) cJSON_AddItemToObjectCS(cJSON *object, const char *string, cJSON *item)
|
|
{
|
|
{
|
|
@@ -1591,13 +1595,13 @@ CJSON_PUBLIC(void) cJSON_AddItemToObjectCS(cJSON *object, const char *string, cJ
|
|
{
|
|
{
|
|
global_hooks.deallocate(item->string);
|
|
global_hooks.deallocate(item->string);
|
|
}
|
|
}
|
|
-#pragma GCC diagnostic push
|
|
|
|
-#pragma GCC diagnostic ignored "-Wcast-qual"
|
|
|
|
item->string = (char*)string;
|
|
item->string = (char*)string;
|
|
-#pragma GCC diagnostic pop
|
|
|
|
item->type |= cJSON_StringIsConst;
|
|
item->type |= cJSON_StringIsConst;
|
|
cJSON_AddItemToArray(object, item);
|
|
cJSON_AddItemToArray(object, item);
|
|
}
|
|
}
|
|
|
|
+#if defined (__clang__) || ((__GNUC__) && ((__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ > 5))))
|
|
|
|
+ #pragma GCC diagnostic pop
|
|
|
|
+#endif
|
|
|
|
|
|
CJSON_PUBLIC(void) cJSON_AddItemReferenceToArray(cJSON *array, cJSON *item)
|
|
CJSON_PUBLIC(void) cJSON_AddItemReferenceToArray(cJSON *array, cJSON *item)
|
|
{
|
|
{
|