From: Eric Haszlakiewicz Date: Thu, 21 Feb 2013 18:32:29 +0000 (-0600) Subject: Mark the "val" variable in json_object_object_foreach as unused so the compiler doesn... X-Git-Tag: json-c-0.11-20130402~15 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9b64c05ff9feb1cdb1e5ae5e134e5e6ff85dbb1b;p=thirdparty%2Fjson-c.git Mark the "val" variable in json_object_object_foreach as unused so the compiler doesn't complain. Fix warnings in the testReplaceExisting test. --- diff --git a/json_object.h b/json_object.h index c97850a2..e18af8a8 100644 --- a/json_object.h +++ b/json_object.h @@ -309,7 +309,7 @@ extern void json_object_object_del(struct json_object* obj, const char *key); # define json_object_object_foreach(obj,key,val) \ char *key; \ - struct json_object *val; \ + struct json_object *val __attribute__((__unused__)); \ for(struct lh_entry *entry ## key = json_object_get_object(obj)->head, *entry_next ## key = NULL; \ ({ if(entry ## key) { \ key = (char*)entry ## key->k; \ diff --git a/tests/testReplaceExisting.c b/tests/testReplaceExisting.c index 8cc69244..6db7b98e 100644 --- a/tests/testReplaceExisting.c +++ b/tests/testReplaceExisting.c @@ -74,5 +74,5 @@ int main(int argc, char **argv) json_object_put( my_object ); - return 0; + return retval; }