From 4de237a42e0b79c87aeaf37792be6458b5437f7b Mon Sep 17 00:00:00 2001 From: Ian Campbell Date: Mon, 17 Sep 2012 11:17:00 +0100 Subject: 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 Acked-by: Ian Jackson Committed-by: Ian Campbell --- tools/libxl/flexarray.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'tools/libxl/flexarray.c') 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; } -- cgit v1.2.3