Source-Changes-HG archive

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

[src/trunk]: src/sys/sys define constants as being wider than int when needed...



details:   https://anonhg.NetBSD.org/src/rev/571aa8485063
branches:  trunk
changeset: 820978:571aa8485063
user:      maya <maya%NetBSD.org@localhost>
date:      Tue Jan 17 13:13:07 2017 +0000

description:
define constants as being wider than int when needed, instead of casting
them at use. makes compilers happier.

diffstat:

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

diffs (27 lines):

diff -r b82cd047d3a5 -r 571aa8485063 sys/sys/time.h
--- a/sys/sys/time.h    Tue Jan 17 12:49:26 2017 +0000
+++ b/sys/sys/time.h    Tue Jan 17 13:13:07 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: time.h,v 1.77 2017/01/06 03:33:19 pgoyette Exp $       */
+/*     $NetBSD: time.h,v 1.78 2017/01/17 13:13:07 maya Exp $   */
 
 /*
  * Copyright (c) 1982, 1986, 1993
@@ -177,7 +177,7 @@
 
        ts->tv_sec = bt->sec;
        ts->tv_nsec =
-           (long)(((uint64_t)1000000000 * (uint32_t)(bt->frac >> 32)) >> 32);
+           (long)((1000000000ULL * (uint32_t)(bt->frac >> 32)) >> 32);
 }
 
 static __inline void
@@ -194,7 +194,7 @@
 
        tv->tv_sec = bt->sec;
        tv->tv_usec =
-           (suseconds_t)(((uint64_t)1000000 * (uint32_t)(bt->frac >> 32)) >> 32);
+           (suseconds_t)((1000000UL * (uint32_t)(bt->frac >> 32)) >> 32);
 }
 
 static __inline void



Home | Main Index | Thread Index | Old Index