summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Haszlakiewicz <erh+git@nimenees.com>2013-02-21 12:32:29 -0600
committerEric Haszlakiewicz <erh+git@nimenees.com>2013-02-21 12:32:29 -0600
commit9b64c05ff9feb1cdb1e5ae5e134e5e6ff85dbb1b (patch)
treeed5600266771b5386bb647183dd6826621d2f8d8
parentbfb329223aecf7f47da2b8ece4bd8e421c7bfc6d (diff)
Mark the "val" variable in json_object_object_foreach as unused so the compiler doesn't complain. Fix warnings in the testReplaceExisting test.
-rw-r--r--json_object.h2
-rw-r--r--tests/testReplaceExisting.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/json_object.h b/json_object.h
index c97850a..e18af8a 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 8cc6924..6db7b98 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;
}