Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/external/cddl/osnet/sys/sys add casts



details:   https://anonhg.NetBSD.org/src/rev/cef46147be7e
branches:  trunk
changeset: 828858:cef46147be7e
user:      christos <christos%NetBSD.org@localhost>
date:      Sun Jan 07 20:02:52 2018 +0000

description:
add casts

diffstat:

 external/cddl/osnet/sys/sys/time.h |  7 ++++---
 external/cddl/osnet/sys/sys/uio.h  |  8 ++++----
 2 files changed, 8 insertions(+), 7 deletions(-)

diffs (54 lines):

diff -r 8e23e350c684 -r cef46147be7e external/cddl/osnet/sys/sys/time.h
--- a/external/cddl/osnet/sys/sys/time.h        Sun Jan 07 18:11:35 2018 +0000
+++ b/external/cddl/osnet/sys/sys/time.h        Sun Jan 07 20:02:52 2018 +0000
@@ -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@localhost>
@@ -80,11 +80,12 @@
 #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
 }
 
diff -r 8e23e350c684 -r cef46147be7e external/cddl/osnet/sys/sys/uio.h
--- a/external/cddl/osnet/sys/sys/uio.h Sun Jan 07 18:11:35 2018 +0000
+++ b/external/cddl/osnet/sys/sys/uio.h Sun Jan 07 20:02:52 2018 +0000
@@ -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 @@
        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 @@
                        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;
        }
        



Home | Main Index | Thread Index | Old Index