Date: Sat, 28 Mar 2009 07:44:08 +0000 (UTC) From: Xin LI <delphij@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r190500 - in head/lib/libc/db: hash mpool Message-ID: <200903280744.n2S7i8CY088808@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: delphij Date: Sat Mar 28 07:44:08 2009 New Revision: 190500 URL: http://svn.freebsd.org/changeset/base/190500 Log: Add some casts to silence compiler warning about signedness. Modified: head/lib/libc/db/hash/hash_page.c head/lib/libc/db/mpool/mpool.c Modified: head/lib/libc/db/hash/hash_page.c ============================================================================== --- head/lib/libc/db/hash/hash_page.c Sat Mar 28 07:39:35 2009 (r190499) +++ head/lib/libc/db/hash/hash_page.c Sat Mar 28 07:44:08 2009 (r190500) @@ -854,7 +854,7 @@ open_temp(HTAB *hashp) envtmp = getenv("TMPDIR"); len = snprintf(path, sizeof(path), "%s/_hash.XXXXXX", envtmp ? envtmp : "/tmp"); - if (len < 0 || len >= sizeof(path)) { + if (len < 0 || len >= (int)sizeof(path)) { errno = ENAMETOOLONG; return (-1); } Modified: head/lib/libc/db/mpool/mpool.c ============================================================================== --- head/lib/libc/db/mpool/mpool.c Sat Mar 28 07:39:35 2009 (r190499) +++ head/lib/libc/db/mpool/mpool.c Sat Mar 28 07:44:08 2009 (r190500) @@ -217,7 +217,7 @@ mpool_get(MPOOL *mp, pgno_t pgno, /* Read in the contents. */ off = mp->pagesize * pgno; - if ((nr = pread(mp->fd, bp->page, mp->pagesize, off)) != mp->pagesize) { + if ((nr = pread(mp->fd, bp->page, mp->pagesize, off)) != (ssize_t)mp->pagesize) { switch (nr) { case -1: /* errno is set for us by pread(). */ @@ -404,7 +404,7 @@ mpool_write(MPOOL *mp, BKT *bp) (mp->pgout)(mp->pgcookie, bp->pgno, bp->page); off = mp->pagesize * bp->pgno; - if (pwrite(mp->fd, bp->page, mp->pagesize, off) != mp->pagesize) + if (pwrite(mp->fd, bp->page, mp->pagesize, off) != (ssize_t)mp->pagesize) return (RET_ERROR); /*
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200903280744.n2S7i8CY088808>