Fix variable shadowing. 79/169579/1
authorMichal Bloch <m.bloch@samsung.com>
Wed, 7 Feb 2018 15:04:31 +0000 (16:04 +0100)
committerMichal Bloch <m.bloch@samsung.com>
Wed, 7 Feb 2018 15:13:09 +0000 (16:13 +0100)
Change-Id: Icb88cd9a624d0f1e85e784d716898b291c3b9608
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
src/libdlog/log_pipe.c
src/tests/test_ptrs_list.c

index de95eb1..86929d9 100644 (file)
@@ -24,7 +24,6 @@ static int connect_pipe(const char * path)
 {
        int r;
        int fd;
-       int pipe_fd;
        struct sockaddr_un sa = { .sun_family = AF_UNIX };
        struct dlog_control_msg ctrl_msg = DLOG_CTRL_REQ_PIPE;
 
@@ -51,10 +50,10 @@ static int connect_pipe(const char * path)
                return -errno;
        }
 
-       pipe_fd = recv_pipe(fd);
+       int ret = recv_pipe(fd);
        close(fd);
 
-       return pipe_fd;
+       return ret;
 }
 
 /**
index 4631ea3..3144ddd 100644 (file)
@@ -10,8 +10,7 @@ int main(int argc, char ** argv)
        assert(list_count(head) == 0);
 
        void *elems[] = {"a", "b", "c"};
-       int i = 0;
-       for (i = 0; i < NELEMS(elems); i++) {
+       for (int i = 0; i < NELEMS(elems); i++) {
                list_add(&head, elems[i]);
                assert(list_count(head) == i + 1);
        }
@@ -31,7 +30,7 @@ int main(int argc, char ** argv)
        assert(list_count(head) == 0);
        assert(head == 0);
 
-       for (i = 0; i < NELEMS(elems); i++) {
+       for (int i = 0; i < NELEMS(elems); i++) {
                list_add(&head, elems[i]);
                assert(list_count(head) == i + 1);
        }