]> git.lttng.org Git - userspace-rcu.git/commitdiff
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:04:51 +0000 (15:04 -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 2410ff72058a15b48c2132408a6a785e40df42cc..d7e09b325f58f5b3641bb2e5354b8b82f58d63d9 100644 (file)
@@ -691,11 +691,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 77ccb85b0e777714b624547b0d7a0986c1188fc7..454481e729ee713b7216b583b5e6002b805dc28d 100644 (file)
@@ -241,18 +241,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);
 }
@@ -402,7 +402,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 84c33f86242aed3be20f6925e33048aad39c3dc3..8265735363fef778a36a5cdeded6af7253081219 100644 (file)
@@ -301,18 +301,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);
 }
@@ -486,7 +486,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 a26460a420721f55265bd969b8efbe11da0043cc..13d9e5e812e040bf9892a3fbb430e64bf8950a80 100644 (file)
@@ -243,18 +243,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);
 }
@@ -404,7 +404,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 221f7c337b49b123a8e9da723a5daaa3c2ba136f..9f879253862e3f22cdf6eb21a615b37df7dbbadc 100644 (file)
@@ -303,8 +303,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;
@@ -314,9 +314,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 c68a45380a4a0e1c4f1106bb9b122f688d769ac8..bc9e89fb9bb29601734892b4b1f3dea0a01f7c9d 100644 (file)
@@ -216,15 +216,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);
 }
@@ -370,7 +370,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 25c12b7a2dbb385485187a520c72683077278c97..982be197976352ca0a5c47fa6eeb508572045b97 100644 (file)
@@ -291,19 +291,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);
 }
@@ -510,7 +510,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.034085 seconds and 4 git commands to generate.