add casts

This commit is contained in:
christos 2018-01-07 20:02:52 +00:00
parent dd5857855f
commit bacfdb6969
2 changed files with 8 additions and 7 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: time.h,v 1.7 2016/04/28 11:45:02 christos Exp $ */
/* $NetBSD: time.h,v 1.8 2018/01/07 20:02:52 christos Exp $ */
/*-
* Copyright (c) 2007 Pawel Jakub Dawidek <pjd@FreeBSD.org>
@ -80,11 +80,12 @@ static __inline hrtime_t gethrtime(void) {
#ifdef CLOCK_REALTIME
struct timespec ts;
clock_gettime(CLOCK_REALTIME,&ts);
return (((u_int64_t) ts.tv_sec) * NANOSEC + ts.tv_nsec);
return (hrtime_t)(((int64_t) ts.tv_sec) * NANOSEC + ts.tv_nsec);
#else
struct timeval tv;
gettimeofday(&tv, NULL);
return (((u_int64_t) tv.tv_sec) * MICROSEC + tv.tv_usec) * 1000;
return (hrtime_t)
((((int64_t) tv.tv_sec) * MICROSEC + tv.tv_usec) * 1000);
#endif
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: uio.h,v 1.9 2015/09/26 03:32:17 christos Exp $ */
/* $NetBSD: uio.h,v 1.10 2018/01/07 20:02:52 christos Exp $ */
/*-
* Copyright (c) 2009 The NetBSD Foundation, Inc.
@ -119,7 +119,7 @@ zfs_uiocopy(void *cp, size_t n, enum uio_rw dir, uio_t *uio, size_t *cbytes)
if ((err = uiomove(cp, n, &uio2)) != 0)
return err;
*cbytes = uio->uio_resid - uio2.uio_resid;
*cbytes = (size_t)(uio->uio_resid - uio2.uio_resid);
return (0);
}
@ -139,9 +139,9 @@ zfs_uioskip(uio_t *uiop, size_t n)
continue;
}
iovp->iov_base = (char *)iovp->iov_base + niovb;
uiop->uio_offset += niovb;
uiop->uio_offset += (off_t)niovb;
iovp->iov_len -= niovb;
uiop->uio_resid -= niovb;
uiop->uio_resid -= (int)niovb;
n -= niovb;
}