From 9b64c05ff9feb1cdb1e5ae5e134e5e6ff85dbb1b Mon Sep 17 00:00:00 2001 From: Eric Haszlakiewicz Date: Thu, 21 Feb 2013 12:32:29 -0600 Subject: [PATCH] Mark the "val" variable in json_object_object_foreach as unused so the compiler doesn't complain. Fix warnings in the testReplaceExisting test. --- json_object.h | 2 +- tests/testReplaceExisting.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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; } -- 2.47.2