From 488d1ffa5d0fb8e671942c4b2d04df8de48554bd Mon Sep 17 00:00:00 2001 From: Andrea Mazzoleni Date: Mon, 18 Jan 2016 22:38:01 +0100 Subject: [PATCH] Rename handle_map() to avoid a shadow variable --- cmdline/check.c | 2 +- cmdline/dry.c | 2 +- cmdline/handle.c | 2 +- cmdline/handle.h | 2 +- cmdline/scrub.c | 2 +- cmdline/sync.c | 4 ++-- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/cmdline/check.c b/cmdline/check.c index f20bc05e..9431efa0 100644 --- a/cmdline/check.c +++ b/cmdline/check.c @@ -862,7 +862,7 @@ static int state_check_process(struct snapraid_state* state, int fix, struct sna unsigned* failed_map; unsigned l; - handle = handle_map(state, &diskmax); + handle = handle_mapping(state, &diskmax); /* we need 1 * data + 2 * parity + 1 * zero */ buffermax = diskmax + 2 * state->level + 1; diff --git a/cmdline/dry.c b/cmdline/dry.c index 1062e991..44a06a56 100644 --- a/cmdline/dry.c +++ b/cmdline/dry.c @@ -180,7 +180,7 @@ static int state_dry_process(struct snapraid_state* state, struct snapraid_parit unsigned io_error; unsigned l; - handle = handle_map(state, &diskmax); + handle = handle_mapping(state, &diskmax); /* we need 1 * data + 2 * parity */ buffermax = diskmax + 2 * state->level; diff --git a/cmdline/handle.c b/cmdline/handle.c index 69e9f386..1ebedf8f 100644 --- a/cmdline/handle.c +++ b/cmdline/handle.c @@ -357,7 +357,7 @@ int handle_utime(struct snapraid_handle* handle) return 0; } -struct snapraid_handle* handle_map(struct snapraid_state* state, unsigned* handlemax) +struct snapraid_handle* handle_mapping(struct snapraid_state* state, unsigned* handlemax) { tommy_node* i; unsigned j; diff --git a/cmdline/handle.h b/cmdline/handle.h index 20a5e77a..c8ca750b 100644 --- a/cmdline/handle.h +++ b/cmdline/handle.h @@ -81,7 +81,7 @@ int handle_utime(struct snapraid_handle* handle); * \param diskmax The size of the vector. * \return The allocated vector of pointers. */ -struct snapraid_handle* handle_map(struct snapraid_state* state, unsigned* diskmax); +struct snapraid_handle* handle_mapping(struct snapraid_state* state, unsigned* diskmax); #endif diff --git a/cmdline/scrub.c b/cmdline/scrub.c index c0c83f14..a5914cf6 100644 --- a/cmdline/scrub.c +++ b/cmdline/scrub.c @@ -266,7 +266,7 @@ static int state_scrub_process(struct snapraid_state* state, struct snapraid_par unsigned l; /* maps the disks to handles */ - handle = handle_map(state, &diskmax); + handle = handle_mapping(state, &diskmax); /* rehash buffers */ rehandle = malloc_nofail_align(diskmax * sizeof(struct snapraid_rehash), &rehandle_alloc); diff --git a/cmdline/sync.c b/cmdline/sync.c index ff479f5a..67230a3e 100644 --- a/cmdline/sync.c +++ b/cmdline/sync.c @@ -44,7 +44,7 @@ static int state_hash_process(struct snapraid_state* state, block_off_t blocksta unsigned io_error; /* maps the disks to handles */ - handle = handle_map(state, &diskmax); + handle = handle_mapping(state, &diskmax); /* buffer for reading */ buffer = malloc_nofail(state->block_size); @@ -690,7 +690,7 @@ static int state_sync_process(struct snapraid_state* state, struct snapraid_pari now = time(0); /* maps the disks to handles */ - handle = handle_map(state, &diskmax); + handle = handle_mapping(state, &diskmax); /* rehash buffers */ rehandle = malloc_nofail_align(diskmax * sizeof(struct snapraid_rehash), &rehandle_alloc);