Fix uninitialised variable compile warning, and also fix unused-when-used warning

This commit is contained in:
Stuart Walsh
2015-03-31 12:23:03 +01:00
parent cbedf2f7ca
commit 75d7409c4e

View File

@@ -344,8 +344,8 @@ extern void json_object_object_del(struct json_object* obj, const char *key);
#if defined(__GNUC__) && !defined(__STRICT_ANSI__) && __STDC_VERSION__ >= 199901L
# define json_object_object_foreach(obj,key,val) \
char *key; \
struct json_object *val __attribute__((__unused__)); \
char *key = NULL; \
struct json_object *val = NULL; \
for(struct lh_entry *entry ## key = json_object_get_object(obj)->head, *entry_next ## key = NULL; \
({ if(entry ## key) { \
key = (char*)entry ## key->k; \