Source-Changes-HG archive

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

[src/trunk]: src/lib/libc/time Don't depend on implicit rounding from non-int...



details:   https://anonhg.NetBSD.org/src/rev/3697af40316c
branches:  trunk
changeset: 788946:3697af40316c
user:      joerg <joerg%NetBSD.org@localhost>
date:      Tue Jul 30 15:30:37 2013 +0000

description:
Don't depend on implicit rounding from non-integral float constant.

diffstat:

 lib/libc/time/localtime.c |  6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diffs (27 lines):

diff -r e9c2ab9f6408 -r 3697af40316c lib/libc/time/localtime.c
--- a/lib/libc/time/localtime.c Tue Jul 30 15:28:47 2013 +0000
+++ b/lib/libc/time/localtime.c Tue Jul 30 15:30:37 2013 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: localtime.c,v 1.76 2013/07/22 04:55:09 msaitoh Exp $   */
+/*     $NetBSD: localtime.c,v 1.77 2013/07/30 15:30:37 joerg Exp $     */
 
 /*
 ** This file is in the public domain, so clarified as of
@@ -10,7 +10,7 @@
 #if 0
 static char    elsieid[] = "@(#)localtime.c    8.17";
 #else
-__RCSID("$NetBSD: localtime.c,v 1.76 2013/07/22 04:55:09 msaitoh Exp $");
+__RCSID("$NetBSD: localtime.c,v 1.77 2013/07/30 15:30:37 joerg Exp $");
 #endif
 #endif /* LIBC_SCCS and not lint */
 
@@ -1643,7 +1643,7 @@
        }
        {
                int_fast32_t seconds;
-               const time_t half_second = 0.5;
+               const time_t half_second = (time_t)0.5;
 
                seconds = (int_fast32_t)(tdays * SECSPERDAY + half_second);
                tdays = (time_t)(seconds / SECSPERDAY);



Home | Main Index | Thread Index | Old Index