]> granicus.if.org Git - strace/commitdiff
tests: fix "comparison between signed and unsigned" compilation warnings
authorDmitry V. Levin <ldv@altlinux.org>
Mon, 28 Nov 2016 20:55:10 +0000 (20:55 +0000)
committerDmitry V. Levin <ldv@altlinux.org>
Mon, 28 Nov 2016 20:55:10 +0000 (20:55 +0000)
* tests/readv.c (main): Cast r_len to int.
* tests/preadv2-pwritev2.c (dumpio): Likewise.

tests/preadv.c
tests/preadv2-pwritev2.c

index 2243eb87ecd657bb4f0cedef053a5ba0cccf9380..fb5d3ad782cff6b5c225f6f8e80c7548c5b6b4c9 100644 (file)
@@ -141,7 +141,7 @@ main(void)
        r_iov = tail_memdup(r1_iov_, sizeof(r1_iov_));
 
        rc = preadv(fd, r_iov, ARRAY_SIZE(r1_iov_), r_len);
-       if (rc != (int) LENGTH_OF(w) - r_len)
+       if (rc != (int) LENGTH_OF(w) - (int) r_len)
                perror_msg_and_fail("preadv: expected %d, returned %ld",
                                    (int) LENGTH_OF(w) - r_len, rc);
        printf("preadv(%d, [{iov_base=\"%s\", iov_len=%u}"
index 032ac03548e44eab2125e431d838761d19a07502..40604b29573f92a852af7b42b6633415d47e8ef3 100644 (file)
@@ -163,7 +163,7 @@ dumpio(void)
        r_iov = tail_memdup(r1_iov_, sizeof(r1_iov_));
 
        rc = pr(0, r_iov, ARRAY_SIZE(r1_iov_), r_len);
-       if (rc != (int) w_len - r_len)
+       if (rc != (int) w_len - (int) r_len)
                perror_msg_and_fail("preadv2: expected %d, returned %ld",
                                    (int) w_len - r_len, rc);
        tprintf("preadv2(0, [{iov_base=\"%s\", iov_len=%u}"