[Xcb] [PATCH] Rename index to idx to avoid shadowing
Barton C Massey
bart at cs.pdx.edu
Wed Aug 27 09:30:02 PDT 2008
I'm fine with these patches, but in general I'm quite
ambivalent about eliminating shadowing; the point of
static scoping, to some extent, is to make shadowing
OK. Do others on this list have an opinion?
Bart
In message <1219838188-8908-5-git-send-email-julien at danjou.info> you wrote:
> Signed-off-by: Julien Danjou <julien at danjou.info>
> ---
> src/xcb_ext.c | 8 ++++----
> 1 files changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/src/xcb_ext.c b/src/xcb_ext.c
> index 12cb164..68bb29b 100644
> --- a/src/xcb_ext.c
> +++ b/src/xcb_ext.c
> @@ -40,11 +40,11 @@ typedef struct lazyreply {
> } value;
> } lazyreply;
>
> -static lazyreply *get_index(xcb_connection_t *c, int index)
> +static lazyreply *get_index(xcb_connection_t *c, int idx)
> {
> - if(index > c->ext.extensions_size)
> + if(idx > c->ext.extensions_size)
> {
> - int new_size = index << 1;
> + int new_size = idx << 1;
> lazyreply *new_extensions = realloc(c->ext.extensions, sizeof(lazyreply) * new_size);
> if(!new_extensions)
> return 0;
> @@ -52,7 +52,7 @@ static lazyreply *get_index(xcb_connection_t *c, int index)
> c->ext.extensions = new_extensions;
> c->ext.extensions_size = new_size;
> }
> - return c->ext.extensions + index - 1;
> + return c->ext.extensions + idx - 1;
> }
>
> static lazyreply *get_lazyreply(xcb_connection_t *c, xcb_extension_t *ext)
> --
> 1.5.6.3
>
> _______________________________________________
> Xcb mailing list
> Xcb at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/xcb
More information about the Xcb
mailing list