Browse Source

Mark the "val" variable in json_object_object_foreach as unused so the compiler doesn't complain. Fix warnings in the testReplaceExisting test.

tags/json-c-0.11-20130402
Eric Haszlakiewicz 12 years ago
parent
commit
9b64c05ff9
2 changed files with 2 additions and 2 deletions
  1. +1
    -1
      json_object.h
  2. +1
    -1
      tests/testReplaceExisting.c

+ 1
- 1
json_object.h View File

@@ -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) \ # define json_object_object_foreach(obj,key,val) \
char *key; \ 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; \ for(struct lh_entry *entry ## key = json_object_get_object(obj)->head, *entry_next ## key = NULL; \
({ if(entry ## key) { \ ({ if(entry ## key) { \
key = (char*)entry ## key->k; \ key = (char*)entry ## key->k; \


+ 1
- 1
tests/testReplaceExisting.c View File

@@ -74,5 +74,5 @@ int main(int argc, char **argv)


json_object_put( my_object ); json_object_put( my_object );


return 0;
return retval;
} }

Loading…
Cancel
Save