diff options
author | Ian Campbell <Ian.Campbell@citrix.com> | 2012-09-17 11:17:00 +0100 |
---|---|---|
committer | Ian Campbell <Ian.Campbell@citrix.com> | 2012-09-17 11:17:00 +0100 |
commit | 4de237a42e0b79c87aeaf37792be6458b5437f7b (patch) | |
tree | 0f1b0d38881aee575bdcd3ee65a0ebe500db5f81 /tools/libxl/libxl_json.c | |
parent | 5e61076e8f6e48856dacbd65499d6cb69d31976b (diff) | |
download | xen-4de237a42e0b79c87aeaf37792be6458b5437f7b.tar.gz xen-4de237a42e0b79c87aeaf37792be6458b5437f7b.tar.bz2 xen-4de237a42e0b79c87aeaf37792be6458b5437f7b.zip |
libxl: Enable -Wshadow.
It was convenient to invent $(CFLAGS_LIBXL) to do this.
Various renamings to avoid shadowing standard functions:
- index(3)
- listen(2)
- link(2)
- abort(3)
- abs(3)
Reduced the scope of some variables to avoid conflicts.
Change to libxc is due to the nested hypercall buf macros in
set_xen_guest_handle (used in libxl) using the same local private vars.
Build tested only.
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
Diffstat (limited to 'tools/libxl/libxl_json.c')
-rw-r--r-- | tools/libxl/libxl_json.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/tools/libxl/libxl_json.c b/tools/libxl/libxl_json.c index caa831234e..8e17842e41 100644 --- a/tools/libxl/libxl_json.c +++ b/tools/libxl/libxl_json.c @@ -275,7 +275,7 @@ static int json_object_append_to(libxl__gc *gc, void libxl__json_object_free(libxl__gc *gc, libxl__json_object *obj) { - int index = 0; + int idx = 0; if (obj == NULL) return; @@ -287,8 +287,8 @@ void libxl__json_object_free(libxl__gc *gc, libxl__json_object *obj) case JSON_MAP: { libxl__json_map_node *node = NULL; - for (index = 0; index < obj->u.map->count; index++) { - if (flexarray_get(obj->u.map, index, (void**)&node) != 0) + for (idx = 0; idx < obj->u.map->count; idx++) { + if (flexarray_get(obj->u.map, idx, (void**)&node) != 0) break; libxl__json_object_free(gc, node->obj); free(node->map_key); @@ -302,8 +302,8 @@ void libxl__json_object_free(libxl__gc *gc, libxl__json_object *obj) libxl__json_object *node = NULL; break; - for (index = 0; index < obj->u.array->count; index++) { - if (flexarray_get(obj->u.array, index, (void**)&node) != 0) + for (idx = 0; idx < obj->u.array->count; idx++) { + if (flexarray_get(obj->u.array, idx, (void**)&node) != 0) break; libxl__json_object_free(gc, node); node = NULL; @@ -359,14 +359,14 @@ const libxl__json_object *libxl__json_map_get(const char *key, libxl__json_node_type expected_type) { flexarray_t *maps = NULL; - int index = 0; + int idx = 0; if (libxl__json_object_is_map(o)) { libxl__json_map_node *node = NULL; maps = o->u.map; - for (index = 0; index < maps->count; index++) { - if (flexarray_get(maps, index, (void**)&node) != 0) + for (idx = 0; idx < maps->count; idx++) { + if (flexarray_get(maps, idx, (void**)&node) != 0) return NULL; if (strcmp(key, node->map_key) == 0) { if (expected_type == JSON_ANY |