fix: shadowed local variable (-Wshadow)
authorMichael Jeanson <mjeanson@efficios.com>
Thu, 1 Apr 2021 17:46:18 +0000 (13:46 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Tue, 13 Apr 2021 19:06:42 +0000 (15:06 -0400)
Rename local variables that are shadowed by global variables.

Change-Id: Ic60e880cb6e98d6111e6b747d9668731a156e4fa
Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
tests/benchmark/test_urcu_hash.c
tests/benchmark/test_urcu_lfq.c
tests/benchmark/test_urcu_lfs.c
tests/benchmark/test_urcu_lfs_rcu.c
tests/benchmark/test_urcu_wfcq.c
tests/benchmark/test_urcu_wfq.c
tests/benchmark/test_urcu_wfs.c

index 896fb32be4393c62785cc98107a1e0bb89d45bee..8c97bd92aeb49039287bc142397c3160524a3e45 100644 (file)
@@ -695,11 +695,11 @@ end_pthread_join:
        }
        {
                char msg[1] = { 0x42 };
-               ssize_t ret;
+               ssize_t sret;
 
                do {
-                       ret = write(count_pipe[1], msg, 1);     /* wakeup thread */
-               } while (ret == -1L && errno == EINTR);
+                       sret = write(count_pipe[1], msg, 1);    /* wakeup thread */
+               } while (sret == -1L && errno == EINTR);
        }
        err = pthread_join(tid_count, &tret);
        if (err != 0) {
index 26b18135e7052d9bfa17cf23b023f64976dc2869..7830529370b73c94652801726028898d8a4825a3 100644 (file)
@@ -246,18 +246,18 @@ void *thr_dequeuer(void *_count)
 }
 
 static
-void test_end(struct cds_lfq_queue_rcu *q, unsigned long long *nr_dequeues)
+void test_end(unsigned long long *nr_dequeues_l)
 {
        struct cds_lfq_node_rcu *snode;
 
        do {
-               snode = cds_lfq_dequeue_rcu(q);
+               snode = cds_lfq_dequeue_rcu(&q);
                if (snode) {
                        struct test *node;
 
                        node = caa_container_of(snode, struct test, list);
                        free(node);     /* no more concurrent access */
-                       (*nr_dequeues)++;
+                       (*nr_dequeues_l)++;
                }
        } while (snode);
 }
@@ -407,7 +407,7 @@ int main(int argc, char **argv)
                tot_successful_dequeues += count_dequeuer[2 * i_thr + 1];
        }
 
-       test_end(&q, &end_dequeues);
+       test_end(&end_dequeues);
        err = cds_lfq_destroy_rcu(&q);
        assert(!err);
 
index 2f6ee25a4266c7af2372a5151144f2e9f8b526c0..49a8953258b1990a42552d0afbfac64ffab2857d 100644 (file)
@@ -306,18 +306,18 @@ static void *thr_dequeuer(void *_count)
        return ((void*)2);
 }
 
-static void test_end(struct cds_lfs_stack *s, unsigned long long *nr_dequeues)
+static void test_end(unsigned long long *nr_dequeues_l)
 {
        struct cds_lfs_node *snode;
 
        do {
-               snode = __cds_lfs_pop(s);
+               snode = __cds_lfs_pop(&s);
                if (snode) {
                        struct test *node;
 
                        node = caa_container_of(snode, struct test, list);
                        free(node);
-                       (*nr_dequeues)++;
+                       (*nr_dequeues_l)++;
                }
        } while (snode);
 }
@@ -491,7 +491,7 @@ int main(int argc, char **argv)
                tot_successful_dequeues += count_dequeuer[2 * i_thr + 1];
        }
 
-       test_end(&s, &end_dequeues);
+       test_end(&end_dequeues);
 
        printf_verbose("total number of enqueues : %llu, dequeues %llu\n",
                       tot_enqueues, tot_dequeues);
index d700b87d2d88bec76e3d5ce910bbc2dc3259cfb7..d929ea30e1d3513b4187124d4279af43867100ba 100644 (file)
@@ -248,18 +248,18 @@ void *thr_dequeuer(void *_count)
 }
 
 static
-void test_end(struct cds_lfs_stack_rcu *s, unsigned long long *nr_dequeues)
+void test_end(unsigned long long *nr_dequeues_l)
 {
        struct cds_lfs_node_rcu *snode;
 
        do {
-               snode = cds_lfs_pop_rcu(s);
+               snode = cds_lfs_pop_rcu(&s);
                if (snode) {
                        struct test *node;
 
                        node = caa_container_of(snode, struct test, list);
                        free(node);
-                       (*nr_dequeues)++;
+                       (*nr_dequeues_l)++;
                }
        } while (snode);
 }
@@ -409,7 +409,7 @@ int main(int argc, char **argv)
                tot_successful_dequeues += count_dequeuer[2 * i_thr + 1];
        }
 
-       test_end(&s, &end_dequeues);
+       test_end(&end_dequeues);
 
        printf_verbose("total number of enqueues : %llu, dequeues %llu\n",
                       tot_enqueues, tot_dequeues);
index 6b5e9331ab7ab2b01aaaee9a66a0d25fc5441aa0..96045c7ed7535038a6fb66541f0c2302ec08b69f 100644 (file)
@@ -308,8 +308,8 @@ static void *thr_dequeuer(void *_count)
        return ((void*)2);
 }
 
-static void test_end(unsigned long long *nr_dequeues,
-               unsigned long long *nr_dequeue_last)
+static void test_end(unsigned long long *nr_dequeues_l,
+               unsigned long long *nr_dequeue_last_l)
 {
        struct cds_wfcq_node *node;
        int state;
@@ -319,9 +319,9 @@ static void test_end(unsigned long long *nr_dequeues,
                                &state);
                if (node) {
                        if (state & CDS_WFCQ_STATE_LAST)
-                               (*nr_dequeue_last)++;
+                               (*nr_dequeue_last_l)++;
                        free(node);
-                       (*nr_dequeues)++;
+                       (*nr_dequeues_l)++;
                }
        } while (node);
 }
index 07a684825f982bad6e0b5d77993eaf195f33d3ec..bd733fe2bf74f1c924d15f0d7d87b4111b4db7ea 100644 (file)
@@ -221,15 +221,15 @@ void *thr_dequeuer(void *_count)
 }
 
 static
-void test_end(struct cds_wfq_queue *q, unsigned long long *nr_dequeues)
+void test_end(unsigned long long *nr_dequeues_l)
 {
        struct cds_wfq_node *node;
 
        do {
-               node = cds_wfq_dequeue_blocking(q);
+               node = cds_wfq_dequeue_blocking(&q);
                if (node) {
                        free(node);
-                       (*nr_dequeues)++;
+                       (*nr_dequeues_l)++;
                }
        } while (node);
 }
@@ -375,7 +375,7 @@ int main(int argc, char **argv)
                tot_successful_dequeues += count_dequeuer[2 * i_thr + 1];
        }
 
-       test_end(&q, &end_dequeues);
+       test_end(&end_dequeues);
 
        printf_verbose("total number of enqueues : %llu, dequeues %llu\n",
                       tot_enqueues, tot_dequeues);
index 2c82c019577a5454fef2047c1c570b5813d26465..beade9a9b370b7444b76de8435c28a96cc1741f4 100644 (file)
@@ -296,19 +296,19 @@ static void *thr_dequeuer(void *_count)
        return ((void*)2);
 }
 
-static void test_end(struct cds_wfs_stack *s, unsigned long long *nr_dequeues,
-               unsigned long long *nr_pop_last)
+static void test_end(unsigned long long *nr_dequeues_l,
+               unsigned long long *nr_pop_last_l)
 {
        struct cds_wfs_node *node;
        int state;
 
        do {
-               node = cds_wfs_pop_with_state_blocking(s, &state);
+               node = cds_wfs_pop_with_state_blocking(&s, &state);
                if (node) {
                        if (state & CDS_WFS_STATE_LAST)
-                               (*nr_pop_last)++;
+                               (*nr_pop_last_l)++;
                        free(node);
-                       (*nr_dequeues)++;
+                       (*nr_dequeues_l)++;
                }
        } while (node);
 }
@@ -515,7 +515,7 @@ int main(int argc, char **argv)
                tot_pop_last += count_dequeuer[4 * i_thr + 3];
        }
 
-       test_end(&s, &end_dequeues, &tot_pop_last);
+       test_end(&end_dequeues, &tot_pop_last);
 
        printf_verbose("total number of enqueues : %llu, dequeues %llu\n",
                       tot_enqueues, tot_dequeues);
This page took 0.030507 seconds and 4 git commands to generate.