Module Name: src Committed By: joerg Date: Tue Jul 30 15:30:37 UTC 2013
Modified Files: src/lib/libc/time: localtime.c Log Message: Don't depend on implicit rounding from non-integral float constant. To generate a diff of this commit: cvs rdiff -u -r1.76 -r1.77 src/lib/libc/time/localtime.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/localtime.c diff -u src/lib/libc/time/localtime.c:1.76 src/lib/libc/time/localtime.c:1.77 --- src/lib/libc/time/localtime.c:1.76 Mon Jul 22 04:55:09 2013 +++ src/lib/libc/time/localtime.c Tue Jul 30 15:30:37 2013 @@ -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 @@ timesub(const timezone_t sp, const time_ } { 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);