Date: Sat, 4 Feb 2017 16:58:06 +0000 (UTC) From: Ngie Cooper <ngie@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r313233 - stable/11/tests/sys/vm Message-ID: <201702041658.v14Gw6sk079401@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: ngie Date: Sat Feb 4 16:58:06 2017 New Revision: 313233 URL: https://svnweb.freebsd.org/changeset/base/313233 Log: MFC r312110: Fix -Wsign-compare warnings The loop index (i) doesn't need to be size_t as its comparison is signed Modified: stable/11/tests/sys/vm/mmap_test.c Directory Properties: stable/11/ (props changed) Modified: stable/11/tests/sys/vm/mmap_test.c ============================================================================== --- stable/11/tests/sys/vm/mmap_test.c Sat Feb 4 16:56:51 2017 (r313232) +++ stable/11/tests/sys/vm/mmap_test.c Sat Feb 4 16:58:06 2017 (r313233) @@ -184,8 +184,7 @@ ATF_TC_WITHOUT_HEAD(mmap__dev_zero_priva 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); @@ -197,7 +196,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); @@ -224,8 +223,7 @@ ATF_TC_WITHOUT_HEAD(mmap__dev_zero_share 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); @@ -237,7 +235,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);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201702041658.v14Gw6sk079401>