Fixup -Wshadow warnings
authorJens Axboe <axboe@fb.com>
Tue, 27 Oct 2015 12:30:40 +0000 (21:30 +0900)
committerJens Axboe <axboe@fb.com>
Tue, 27 Oct 2015 12:30:40 +0000 (21:30 +0900)
Usually harmless, but some of them we can actually kill
variables.

Signed-off-by: Jens Axboe <axboe@fb.com>
engines/mmap.c
engines/mtd.c
filesetup.c
stat.c
t/btrace2fio.c

index 69add78a2f95b9d72dea9f093ef174667f09958c..14e4013de83cac82d09a1eafe013c18797b08970 100644 (file)
@@ -242,8 +242,8 @@ static int fio_mmapio_open_file(struct thread_data *td, struct fio_file *f)
 
        fmd = calloc(1, sizeof(*fmd));
        if (!fmd) {
-               int fio_unused ret;
-               ret = generic_close_file(td, f);
+               int fio_unused __ret;
+               __ret = generic_close_file(td, f);
                return 1;
        }
 
index db9c539ea202e16a2f9f405df0236440a8eb2fa4..9381089aa57eb3b8a2997e6b0f29b4c53b695d57 100644 (file)
@@ -152,8 +152,8 @@ err_free:
        free(fmd);
 err_close:
        {
-               int fio_unused ret;
-               ret = generic_close_file(td, f);
+               int fio_unused __ret;
+               __ret = generic_close_file(td, f);
                return 1;
        }
 }
index 634d556e9107420fa1b57acfbccb56b6d0766fca..b5628ce65bdb7d52d59e0da46a87439bacbdca50 100644 (file)
@@ -917,7 +917,7 @@ int setup_files(struct thread_data *td)
                }
 
                td->ts.nr_block_infos = len;
-               for (int i = 0; i < len; i++)
+               for (i = 0; i < len; i++)
                        td->ts.block_infos[i] =
                                BLOCK_INFO(0, BLOCK_STATE_UNINIT);
        } else
diff --git a/stat.c b/stat.c
index 2a65fed8fc2ebd61a8c4de3df97fff463fe3e23c..091d6fb1dd1e6a66daa7c0c306737fa2f8312e64 100644 (file)
--- a/stat.c
+++ b/stat.c
@@ -1173,7 +1173,7 @@ static struct json_object *show_thread_status_json(struct thread_stat *ts,
 
                if (len) {
                        struct json_object *block, *percentile_object, *states;
-                       int state, i;
+                       int state;
                        block = json_create_object();
                        json_object_add_value_object(root, "block", block);
 
index d0b7e091aa9bbff6dd2d61bc220e265d72d52c6e..04b6abedb8428fda2c0712f627a5749d1fd85185 100644 (file)
@@ -937,14 +937,14 @@ static int merge_entries(struct btrace_pid *pida, struct btrace_pid *pidb)
        return 1;
 }
 
-static void check_merges(struct btrace_pid *p, struct flist_head *pid_list)
+static void check_merges(struct btrace_pid *p, struct flist_head *pidlist)
 {
        struct flist_head *e, *tmp;
 
        if (p->ignore)
                return;
 
-       flist_for_each_safe(e, tmp, pid_list) {
+       flist_for_each_safe(e, tmp, pidlist) {
                struct btrace_pid *pidb;
 
                pidb = flist_entry(e, struct btrace_pid, pid_list);