Module Name: src Committed By: christos Date: Tue Jan 10 17:44:51 UTC 2017
Modified Files: src/lib/libc/time: difftime.c Log Message: add constcond To generate a diff of this commit: cvs rdiff -u -r1.16 -r1.17 src/lib/libc/time/difftime.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/lib/libc/time/difftime.c diff -u src/lib/libc/time/difftime.c:1.16 src/lib/libc/time/difftime.c:1.17 --- src/lib/libc/time/difftime.c:1.16 Thu Aug 13 07:21:18 2015 +++ src/lib/libc/time/difftime.c Tue Jan 10 12:44:51 2017 @@ -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 @@ difftime(time_t time1, time_t time0) ** 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 @@ difftime(time_t time1, time_t time0) 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);