Source-Changes-HG archive

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

[src/trunk]: src/lib/libc/time add constcond



details:   https://anonhg.NetBSD.org/src/rev/0556588553a9
branches:  trunk
changeset: 820487:0556588553a9
user:      christos <christos%NetBSD.org@localhost>
date:      Tue Jan 10 17:44:51 2017 +0000

description:
add constcond

diffstat:

 lib/libc/time/difftime.c |  6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diffs (34 lines):

diff -r 4e4954dcc743 -r 0556588553a9 lib/libc/time/difftime.c
--- a/lib/libc/time/difftime.c  Tue Jan 10 17:44:28 2017 +0000
+++ b/lib/libc/time/difftime.c  Tue Jan 10 17:44:51 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: difftime.c,v 1.16 2015/08/13 11:21:18 christos Exp $   */
+/*     $NetBSD: difftime.c,v 1.17 2017/01/10 17:44:51 christos Exp $   */
 
 /*
 ** This file is in the public domain, so clarified as of
@@ -10,7 +10,7 @@
 #if 0
 static char    elsieid[] = "@(#)difftime.c     8.1";
 #else
-__RCSID("$NetBSD: difftime.c,v 1.16 2015/08/13 11:21:18 christos Exp $");
+__RCSID("$NetBSD: difftime.c,v 1.17 2017/01/10 17:44:51 christos Exp $");
 #endif
 #endif /* LIBC_SCCS and not lint */
 
@@ -32,6 +32,7 @@
        ** If double is large enough, simply convert and subtract
        ** (assuming that the larger type has more precision).
        */
+       /*CONSTCOND*/
        if (sizeof (time_t) < sizeof (double)) {
                double t1 = time1, t0 = time0;
                return t1 - t0;
@@ -45,6 +46,7 @@
                return time0 <= time1 ? time1 - time0 : dminus(time0 - time1);
 
        /* Use uintmax_t if wide enough.  */
+       /*CONSTCOND*/
        if (sizeof (time_t) <= sizeof (uintmax_t)) {
                uintmax_t t1 = time1, t0 = time0;
                return time0 <= time1 ? t1 - t0 : dminus(t0 - t1);



Home | Main Index | Thread Index | Old Index