Fix some shadow warnings for some gcc variants
authorJens Axboe <axboe@fb.com>
Wed, 12 Nov 2014 18:11:20 +0000 (11:11 -0700)
committerJens Axboe <axboe@fb.com>
Wed, 12 Nov 2014 18:11:20 +0000 (11:11 -0700)
Signed-off-by: Jens Axboe <axboe@fb.com>
filesetup.c
io_ddir.h
stat.c

index 4026f4de1bdb9ddbec833e251c9e99309ec5d16d..cc6d44091736aeba9e6ba1ab5be7a3d56bc29c1b 100644 (file)
@@ -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;
 {
        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]);
 
        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)
 
        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) {
                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;
 
                if (td->o.random_generator == FIO_RAND_GEN_LFSR) {
                        unsigned long seed;
index 795ceccc43822f19d6bfaf10390cca804714a93a..269768ecac9e1b3da452d3279b17e5b8de496385 100644 (file)
--- 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)
 {
 
 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)       \
 }
 
 #define ddir_rw_sum(arr)       \
diff --git a/stat.c b/stat.c
index 1bfbbebefdfb68e62ad62f509c6008ae1b1f8f7d..9d816d4f18a07f35ecdd9fef8105403b5714dcda 100644 (file)
--- 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;
 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);
        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",
 
                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]);
                                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)
 {
 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;
        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",
        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]);
 
                                io_p, bw_p, iops_p,
                                (unsigned long long) ts->runtime[ddir]);