Source-Changes-HG archive

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

[src/simonb-timecounters]: src/sys/sys - add casts to time_t for tv_sec as st...



details:   https://anonhg.NetBSD.org/src/rev/c2b0ec4bec2d
branches:  simonb-timecounters
changeset: 587876:c2b0ec4bec2d
user:      kardel <kardel%NetBSD.org@localhost>
date:      Sun Apr 30 18:09:04 2006 +0000

description:
- add casts to time_t for tv_sec as struct timeval
  is currently NOT SUS compliant

diffstat:

 sys/sys/time.h |  10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diffs (38 lines):

diff -r 1fc933270d49 -r c2b0ec4bec2d sys/sys/time.h
--- a/sys/sys/time.h    Sun Apr 30 18:06:31 2006 +0000
+++ b/sys/sys/time.h    Sun Apr 30 18:09:04 2006 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: time.h,v 1.52.6.2 2006/04/22 11:40:21 simonb Exp $     */
+/*     $NetBSD: time.h,v 1.52.6.3 2006/04/30 18:09:04 kardel Exp $     */
 
 /*
  * Copyright (c) 1982, 1986, 1993
@@ -42,8 +42,8 @@
  * and used in other calls.
  */
 struct timeval {
-       long    tv_sec;         /* seconds */
-       long    tv_usec;        /* and microseconds */
+       long    tv_sec;         /* seconds */
+       long    tv_usec;        /* and microseconds */
 };
 
 /*
@@ -158,7 +158,7 @@
 bintime2timespec(const struct bintime *bt, struct timespec *ts)
 {
 
-       ts->tv_sec = bt->sec;
+       ts->tv_sec = (/* XXX NetBSD not SUS compliant - MUST FIX */time_t)bt->sec;
        ts->tv_nsec =
            (long)(((uint64_t)1000000000 * (uint32_t)(bt->frac >> 32)) >> 32);
 }
@@ -185,7 +185,7 @@
 timeval2bintime(const struct timeval *tv, struct bintime *bt)
 {
 
-       bt->sec = tv->tv_sec;
+       bt->sec = (/* XXX NetBSD not SUS compliant - MUST FIX */time_t)tv->tv_sec;
        /* 18446744073709 = int(2^64 / 1000000) */
        bt->frac = tv->tv_usec * (uint64_t)18446744073709LL;
 }



Home | Main Index | Thread Index | Old Index