mirror of
https://github.com/json-c/json-c.git
synced 2026-04-05 05:19:07 +08:00
Avoid uninitialized variable warnings
Fix json_object_object_foreach to avoid uninitialized variable warnings using ANSI C or MSC.
This commit is contained in:
committed by
Eric Haszlakiewicz
parent
4d814600d7
commit
d222b13758
@@ -529,8 +529,8 @@ JSON_EXPORT void json_object_object_del(struct json_object* obj, const char *key
|
|||||||
#else /* ANSI C or MSC */
|
#else /* ANSI C or MSC */
|
||||||
|
|
||||||
# define json_object_object_foreach(obj,key,val) \
|
# define json_object_object_foreach(obj,key,val) \
|
||||||
char *key;\
|
char *key = NULL;\
|
||||||
struct json_object *val; \
|
struct json_object *val = NULL; \
|
||||||
struct lh_entry *entry ## key; \
|
struct lh_entry *entry ## key; \
|
||||||
struct lh_entry *entry_next ## key = NULL; \
|
struct lh_entry *entry_next ## key = NULL; \
|
||||||
for(entry ## key = json_object_get_object(obj)->head; \
|
for(entry ## key = json_object_get_object(obj)->head; \
|
||||||
|
|||||||
Reference in New Issue
Block a user