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/flexarray.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/flexarray.c')
-rw-r--r-- | tools/libxl/flexarray.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/tools/libxl/flexarray.c b/tools/libxl/flexarray.c index 64d5b020e9..edf616ca9a 100644 --- a/tools/libxl/flexarray.c +++ b/tools/libxl/flexarray.c @@ -48,19 +48,19 @@ int flexarray_grow(flexarray_t *array, int extents) return 0; } -int flexarray_set(flexarray_t *array, unsigned int index, void *ptr) +int flexarray_set(flexarray_t *array, unsigned int idx, void *ptr) { - if (index >= array->size) { + if (idx >= array->size) { int newsize; if (!array->autogrow) return 1; - newsize = (array->size * 2 < index) ? index + 1 : array->size * 2; + newsize = (array->size * 2 < idx) ? idx + 1 : array->size * 2; if (flexarray_grow(array, newsize - array->size)) return 2; } - if ( index + 1 > array->count ) - array->count = index + 1; - array->data[index] = ptr; + if ( idx + 1 > array->count ) + array->count = idx + 1; + array->data[idx] = ptr; return 0; } @@ -92,11 +92,11 @@ int flexarray_vappend(flexarray_t *array, ...) return ret; } -int flexarray_get(flexarray_t *array, int index, void **ptr) +int flexarray_get(flexarray_t *array, int idx, void **ptr) { - if (index >= array->size) + if (idx >= array->size) return 1; - *ptr = array->data[index]; + *ptr = array->data[idx]; return 0; } |