MFC r312110:

Fix -Wsign-compare warnings

The loop index (i) doesn't need to be size_t as its comparison is signed
This commit is contained in:
Enji Cooper 2017-02-04 16:16:41 +00:00
parent eedcca3466
commit d1d4d810d4
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/stable/10/; revision=313217

View File

@ -192,8 +192,7 @@ ATF_TC_WITHOUT_HEAD(mmap__dev_zero_private);
ATF_TC_BODY(mmap__dev_zero_private, tc)
{
char *p1, *p2, *p3;
size_t i;
int fd, pagesize;
int fd, i, pagesize;
ATF_REQUIRE((pagesize = getpagesize()) > 0);
ATF_REQUIRE((fd = open("/dev/zero", O_RDONLY)) >= 0);
@ -205,7 +204,7 @@ ATF_TC_BODY(mmap__dev_zero_private, tc)
ATF_REQUIRE(p2 != MAP_FAILED);
for (i = 0; i < pagesize; i++)
ATF_REQUIRE_EQ_MSG(0, p1[i], "byte at p1[%zu] is %x", i, p1[i]);
ATF_REQUIRE_EQ_MSG(0, p1[i], "byte at p1[%d] is %x", i, p1[i]);
ATF_REQUIRE(memcmp(p1, p2, pagesize) == 0);
@ -232,8 +231,7 @@ ATF_TC_WITHOUT_HEAD(mmap__dev_zero_shared);
ATF_TC_BODY(mmap__dev_zero_shared, tc)
{
char *p1, *p2, *p3;
size_t i;
int fd, pagesize;
int fd, i, pagesize;
ATF_REQUIRE((pagesize = getpagesize()) > 0);
ATF_REQUIRE((fd = open("/dev/zero", O_RDWR)) >= 0);
@ -245,7 +243,7 @@ ATF_TC_BODY(mmap__dev_zero_shared, tc)
ATF_REQUIRE(p2 != MAP_FAILED);
for (i = 0; i < pagesize; i++)
ATF_REQUIRE_EQ_MSG(0, p1[i], "byte at p1[%zu] is %x", i, p1[i]);
ATF_REQUIRE_EQ_MSG(0, p1[i], "byte at p1[%d] is %x", i, p1[i]);
ATF_REQUIRE(memcmp(p1, p2, pagesize) == 0);