Source-Changes-HG archive

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

[src/trunk]: src/lib/libc/time Reduce diffs with upstream by automatically de...



details:   https://anonhg.NetBSD.org/src/rev/032af706d1ac
branches:  trunk
changeset: 331613:032af706d1ac
user:      christos <christos%NetBSD.org@localhost>
date:      Sat Aug 16 16:22:21 2014 +0000

description:
Reduce diffs with upstream by automatically defining INITIALIZE as it was
intended.

diffstat:

 lib/libc/time/localtime.c |  11 ++---------
 lib/libc/time/private.h   |   4 ++--
 lib/libc/time/zdump.c     |  10 +++++-----
 lib/libc/time/zic.c       |  10 ++++------
 4 files changed, 13 insertions(+), 22 deletions(-)

diffs (128 lines):

diff -r 35a675961c6d -r 032af706d1ac lib/libc/time/localtime.c
--- a/lib/libc/time/localtime.c Sat Aug 16 16:19:41 2014 +0000
+++ b/lib/libc/time/localtime.c Sat Aug 16 16:22:21 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: localtime.c,v 1.84 2014/08/15 13:20:29 martin Exp $    */
+/*     $NetBSD: localtime.c,v 1.85 2014/08/16 16:22:21 christos 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.84 2014/08/15 13:20:29 martin Exp $");
+__RCSID("$NetBSD: localtime.c,v 1.85 2014/08/16 16:22:21 christos Exp $");
 #endif
 #endif /* LIBC_SCCS and not lint */
 
@@ -962,13 +962,6 @@
                for (i = 0; i < rulep->r_mon - 1; ++i)
                        value += mon_lengths[leapyear][i] * SECSPERDAY;
                break;
-       default:
-               _DIAGASSERT(
-                   rulep->r_type == JULIAN_DAY ||
-                   rulep->r_type == DAY_OF_YEAR ||
-                   rulep->r_type == MONTH_NTH_DAY_OF_WEEK);
-               value = 0;
-               break;
        }
 
        /*
diff -r 35a675961c6d -r 032af706d1ac lib/libc/time/private.h
--- a/lib/libc/time/private.h   Sat Aug 16 16:19:41 2014 +0000
+++ b/lib/libc/time/private.h   Sat Aug 16 16:22:21 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: private.h,v 1.34 2014/08/15 11:04:07 christos Exp $    */
+/*     $NetBSD: private.h,v 1.35 2014/08/16 16:22:21 christos Exp $    */
 
 #ifndef PRIVATE_H
 #define PRIVATE_H
@@ -354,7 +354,7 @@
 ** INITIALIZE(x)
 */
 
-#ifdef lint
+#if defined(__GNUC__) || defined(__lint__)
 # define INITIALIZE(x) ((x) = 0)
 #else
 # define INITIALIZE(x)
diff -r 35a675961c6d -r 032af706d1ac lib/libc/time/zdump.c
--- a/lib/libc/time/zdump.c     Sat Aug 16 16:19:41 2014 +0000
+++ b/lib/libc/time/zdump.c     Sat Aug 16 16:22:21 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: zdump.c,v 1.34 2014/08/15 11:04:07 christos Exp $      */
+/*     $NetBSD: zdump.c,v 1.35 2014/08/16 16:22:21 christos Exp $      */
 /*
 ** This file is in the public domain, so clarified as of
 ** 2009-05-17 by Arthur David Olson.
@@ -6,7 +6,7 @@
 
 #include <sys/cdefs.h>
 #ifndef lint
-__RCSID("$NetBSD: zdump.c,v 1.34 2014/08/15 11:04:07 christos Exp $");
+__RCSID("$NetBSD: zdump.c,v 1.35 2014/08/16 16:22:21 christos Exp $");
 #endif /* !defined lint */
 
 #include "version.h"
@@ -175,11 +175,11 @@
 #endif
 
 #ifndef INITIALIZE
-#ifdef GNUC_or_lint
+#if defined(__GNUC__) || defined(__lint__)
 #define INITIALIZE(x)  ((x) = 0)
-#else /* !defined GNUC_or_lint */
+#else /* !defined GNUC || lint */
 #define INITIALIZE(x)
-#endif /* !defined GNUC_or_lint */
+#endif /* !defined GNUC || lint */
 #endif /* !defined INITIALIZE */
 
 /*
diff -r 35a675961c6d -r 032af706d1ac lib/libc/time/zic.c
--- a/lib/libc/time/zic.c       Sat Aug 16 16:19:41 2014 +0000
+++ b/lib/libc/time/zic.c       Sat Aug 16 16:22:21 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: zic.c,v 1.48 2014/08/16 10:38:43 christos Exp $        */
+/*     $NetBSD: zic.c,v 1.49 2014/08/16 16:22:21 christos Exp $        */
 /*
 ** This file is in the public domain, so clarified as of
 ** 2006-07-17 by Arthur David Olson.
@@ -10,7 +10,7 @@
 
 #include <sys/cdefs.h>
 #ifndef lint
-__RCSID("$NetBSD: zic.c,v 1.48 2014/08/16 10:38:43 christos Exp $");
+__RCSID("$NetBSD: zic.c,v 1.49 2014/08/16 16:22:21 christos Exp $");
 #endif /* !defined lint */
 
 #include "version.h"
@@ -2176,7 +2176,6 @@
        envvar = emalloc(max_envvar_len + 1);
        INITIALIZE(untiltime);
        INITIALIZE(starttime);
-       starttime = 0; /* XXX: gcc */
        /*
        ** Now. . .finally. . .generate some useful data!
        */
@@ -2318,7 +2317,7 @@
                                zic_t   offset;
 
                                INITIALIZE(ktime);
-                               ktime = 0; /* XXX: gcc */
+                               ktime = 0;
                                if (useuntil) {
                                        /*
                                        ** Turn untiltime into UT
@@ -2332,8 +2331,7 @@
                                        if (!zp->z_untilrule.r_todisstd)
                                                untiltime = tadd(untiltime,
                                                        -stdoff);
-                               } else
-                                       untiltime = 0;  /* XXX: gcc */
+                               }
                                /*
                                ** Find the rule (of those to do, if any)
                                ** that takes effect earliest in the year.



Home | Main Index | Thread Index | Old Index