From f5202bedef766b68141e20bba3489b4a3aebaf3d Mon Sep 17 00:00:00 2001 From: Petri Lehtinen Date: Mon, 21 Dec 2009 14:01:59 +0200 Subject: [PATCH] Remove const qualifier from the json_t parameter in json_*_set() functions. It's incorrect as these functions modify the value. --- src/jansson.h | 6 +++--- src/value.c | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/jansson.h b/src/jansson.h index ac6736f..28401b4 100644 --- a/src/jansson.h +++ b/src/jansson.h @@ -123,9 +123,9 @@ int json_integer_value(const json_t *integer); double json_real_value(const json_t *real); double json_number_value(const json_t *json); -int json_string_set(const json_t *string, const char *value); -int json_integer_set(const json_t *integer, int value); -int json_real_set(const json_t *real, double value); +int json_string_set(json_t *string, const char *value); +int json_integer_set(json_t *integer, int value); +int json_real_set(json_t *real, double value); /* loading, printing */ diff --git a/src/value.c b/src/value.c index 6497f85..ccf9f06 100644 --- a/src/value.c +++ b/src/value.c @@ -508,7 +508,7 @@ const char *json_string_value(const json_t *json) return json_to_string(json)->value; } -int json_string_set(const json_t *json, const char *value) +int json_string_set(json_t *json, const char *value) { char *dup; json_string_t *string; @@ -555,7 +555,7 @@ int json_integer_value(const json_t *json) return json_to_integer(json)->value; } -int json_integer_set(const json_t *json, int value) +int json_integer_set(json_t *json, int value) { if(!json_is_integer(json)) return -1; @@ -592,7 +592,7 @@ double json_real_value(const json_t *json) return json_to_real(json)->value; } -int json_real_set(const json_t *json, double value) +int json_real_set(json_t *json, double value) { if(!json_is_real(json)) return 0; -- 2.1.4