Add some casts to silence compiler warning about signedness.
This commit is contained in:
parent
06ca18c161
commit
e8ee08bad8
@ -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);
|
||||
}
|
||||
|
@ -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);
|
||||
|
||||
/*
|
||||
|
Loading…
Reference in New Issue
Block a user