Source-Changes-HG archive

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

[src/trunk]: src/lib/libc/time Turns out that the previous fix is incorrect, ...



details:   https://anonhg.NetBSD.org/src/rev/3d4aef1c76ce
branches:  trunk
changeset: 823824:3d4aef1c76ce
user:      kre <kre%NetBSD.org@localhost>
date:      Wed May 10 10:34:30 2017 +0000

description:
Turns out that the previous fix is incorrect, we were not doing ++hit
to change the boolean hit from false to true, but to change it from 1 to 2
which in a sense should have been obvious from the context:
        if (hit)
                /* more tests */
                        ++hit;
The real problem was that hit was (in the imported tzcode) incorrectly
changed from int to bool in a previous update.

Not that it matters, this code is never actually executed - it was there
to deal with the mythical double leapseconds, which simply never exist
(hit counted the number of leapseconds in an adjustment) and it will all
be gone in the next tzcode update.

For now, just turn hit back into an int, which should satisfy gcc 8,
I hope.

diffstat:

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

diffs (36 lines):

diff -r de4de6f3a1da -r 3d4aef1c76ce lib/libc/time/localtime.c
--- a/lib/libc/time/localtime.c Wed May 10 09:45:51 2017 +0000
+++ b/lib/libc/time/localtime.c Wed May 10 10:34:30 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: localtime.c,v 1.107 2017/05/09 02:30:49 maya Exp $     */
+/*     $NetBSD: localtime.c,v 1.108 2017/05/10 10:34:30 kre 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.107 2017/05/09 02:30:49 maya Exp $");
+__RCSID("$NetBSD: localtime.c,v 1.108 2017/05/10 10:34:30 kre Exp $");
 #endif
 #endif /* LIBC_SCCS and not lint */
 
@@ -1698,7 +1698,7 @@
        int                     y;
        const int *             ip;
        int_fast64_t            corr;
-       bool                    hit;
+       int                     hit;
        int                     i;
 
        corr = 0;
@@ -1716,7 +1716,7 @@
                                                sp->lsis[i - 1].ls_trans + 1 &&
                                                sp->lsis[i].ls_corr ==
                                                sp->lsis[i - 1].ls_corr + 1) {
-                                                       hit = true;
+                                                       ++hit;
                                                        --i;
                                        }
                        }



Home | Main Index | Thread Index | Old Index