From 42da5c8b2cdd53427145b623293bc5b915fb5f05 Mon Sep 17 00:00:00 2001 From: Jens Axboe Date: Wed, 12 Nov 2014 11:11:20 -0700 Subject: [PATCH] Fix some shadow warnings for some gcc variants Signed-off-by: Jens Axboe --- filesetup.c | 10 +++++----- io_ddir.h | 8 ++++---- stat.c | 8 ++++---- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/filesetup.c b/filesetup.c index 4026f4de..cc6d4409 100644 --- a/filesetup.c +++ b/filesetup.c @@ -991,12 +991,12 @@ static int __init_rand_distribution(struct thread_data *td, struct fio_file *f) { unsigned int range_size, seed; unsigned long nranges; - uint64_t file_size; + uint64_t fsize; range_size = min(td->o.min_bs[DDIR_READ], td->o.min_bs[DDIR_WRITE]); - file_size = min(f->real_file_size, f->io_size); + fsize = min(f->real_file_size, f->io_size); - nranges = (file_size + range_size - 1) / range_size; + nranges = (fsize + range_size - 1) / range_size; seed = jhash(f->file_name, strlen(f->file_name), 0) * td->thread_number; if (!td->o.rand_repeatable) @@ -1041,9 +1041,9 @@ int init_random_map(struct thread_data *td) return 0; for_each_file(td, f, i) { - uint64_t file_size = min(f->real_file_size, f->io_size); + uint64_t fsize = min(f->real_file_size, f->io_size); - blocks = file_size / (unsigned long long) td->o.rw_min_bs; + blocks = fsize / (unsigned long long) td->o.rw_min_bs; if (td->o.random_generator == FIO_RAND_GEN_LFSR) { unsigned long seed; diff --git a/io_ddir.h b/io_ddir.h index 795ceccc..269768ec 100644 --- a/io_ddir.h +++ b/io_ddir.h @@ -57,11 +57,11 @@ static inline int ddir_rw(enum fio_ddir ddir) static inline const char *ddir_str(enum td_ddir ddir) { - const char *ddir_str[] = { NULL, "read", "write", "rw", NULL, - "randread", "randwrite", "randrw", - "trim", NULL, NULL, NULL, "randtrim" }; + const char *__str[] = { NULL, "read", "write", "rw", NULL, + "randread", "randwrite", "randrw", + "trim", NULL, NULL, NULL, "randtrim" }; - return ddir_str[ddir]; + return __str[ddir]; } #define ddir_rw_sum(arr) \ diff --git a/stat.c b/stat.c index 1bfbbebe..9d816d4f 100644 --- a/stat.c +++ b/stat.c @@ -263,7 +263,7 @@ int calc_lat(struct io_stat *is, unsigned long *min, unsigned long *max, void show_group_stats(struct group_run_stats *rs) { char *p1, *p2, *p3, *p4; - const char *ddir_str[] = { " READ", " WRITE" , " TRIM"}; + const char *str[] = { " READ", " WRITE" , " TRIM"}; int i; log_info("\nRun status group %d (all jobs):\n", rs->groupid); @@ -281,7 +281,7 @@ void show_group_stats(struct group_run_stats *rs) log_info("%s: io=%s, aggrb=%s/s, minb=%s/s, maxb=%s/s," " mint=%llumsec, maxt=%llumsec\n", - rs->unified_rw_rep ? " MIXED" : ddir_str[i], + rs->unified_rw_rep ? " MIXED" : str[i], p1, p2, p3, p4, (unsigned long long) rs->min_run[i], (unsigned long long) rs->max_run[i]); @@ -363,7 +363,7 @@ static void display_lat(const char *name, unsigned long min, unsigned long max, static void show_ddir_status(struct group_run_stats *rs, struct thread_stat *ts, int ddir) { - const char *ddir_str[] = { "read ", "write", "trim" }; + const char *str[] = { "read ", "write", "trim" }; unsigned long min, max, runt; unsigned long long bw, iops; double mean, dev; @@ -386,7 +386,7 @@ static void show_ddir_status(struct group_run_stats *rs, struct thread_stat *ts, iops_p = num2str(iops, 6, 1, 0, 0); log_info(" %s: io=%s, bw=%s/s, iops=%s, runt=%6llumsec\n", - rs->unified_rw_rep ? "mixed" : ddir_str[ddir], + rs->unified_rw_rep ? "mixed" : str[ddir], io_p, bw_p, iops_p, (unsigned long long) ts->runtime[ddir]); -- 2.25.1