Module Name: src
Committed By: christos
Date: Sun Oct 28 17:11:33 UTC 2012
Modified Files:
src/lib/libc/time: Makefile Theory asctime.c localtime.c
Log Message:
welcome to tzcode2012h via patch.
To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/lib/libc/time/Makefile
cvs rdiff -u -r1.11 -r1.12 src/lib/libc/time/Theory
cvs rdiff -u -r1.17 -r1.18 src/lib/libc/time/asctime.c
cvs rdiff -u -r1.70 -r1.71 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/Makefile
diff -u src/lib/libc/time/Makefile:1.7 src/lib/libc/time/Makefile:1.8
--- src/lib/libc/time/Makefile:1.7 Tue Oct 23 20:10:03 2012
+++ src/lib/libc/time/Makefile Sun Oct 28 13:11:33 2012
@@ -3,7 +3,7 @@
# 2009-05-17 by Arthur David Olson.
# Version numbers of the code and data distributions.
-VERSION = 2012g
+VERSION = 2012h
# Change the line below for your time zone (after finding the zone you want in
# the time zone files, or adding it to a time zone file).
@@ -457,7 +457,7 @@ typecheck:
make clean
for i in "long long" unsigned double; \
do \
- make CFLAGS="-DTYPECHECK -D_TIME_T \"-Dtime_t=$$i\"" ; \
+ make CFLAGS="-DTYPECHECK -D__time_t_defined -D_TIME_T \"-Dtime_t=$$i\"" ; \
./zdump -v Europe/Rome ; \
make clean ; \
done
Index: src/lib/libc/time/Theory
diff -u src/lib/libc/time/Theory:1.11 src/lib/libc/time/Theory:1.12
--- src/lib/libc/time/Theory:1.11 Thu Aug 9 08:38:25 2012
+++ src/lib/libc/time/Theory Sun Oct 28 13:11:33 2012
@@ -226,7 +226,7 @@ among the following goals:
agreed since 1970. This is essential for the intended use: static
clocks keeping local civil time.
- * Indicate to humans as to where that region is. This simplifes use.
+ * Indicate to humans as to where that region is. This simplifies use.
* Be robust in the presence of political changes. This reduces the
number of updates and backward-compatibility hacks. For example,
Index: src/lib/libc/time/asctime.c
diff -u src/lib/libc/time/asctime.c:1.17 src/lib/libc/time/asctime.c:1.18
--- src/lib/libc/time/asctime.c:1.17 Fri Oct 26 14:29:49 2012
+++ src/lib/libc/time/asctime.c Sun Oct 28 13:11:33 2012
@@ -1,4 +1,4 @@
-/* $NetBSD: asctime.c,v 1.17 2012/10/26 18:29:49 christos Exp $ */
+/* $NetBSD: asctime.c,v 1.18 2012/10/28 17:11:33 christos Exp $ */
/*
** This file is in the public domain, so clarified as of
@@ -16,7 +16,7 @@
#if 0
static char elsieid[] = "@(#)asctime.c 8.5";
#else
-__RCSID("$NetBSD: asctime.c,v 1.17 2012/10/26 18:29:49 christos Exp $");
+__RCSID("$NetBSD: asctime.c,v 1.18 2012/10/28 17:11:33 christos Exp $");
#endif
#endif /* LIBC_SCCS and not lint */
@@ -87,15 +87,15 @@ static char buf_asctime[MAX_ASCTIME_BUF_
char *
asctime_r(const struct tm *timeptr, char *buf)
{
- static const char *wday_name[7] = {
+ static const char wday_name[][3] = {
"Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"
};
- static const char *mon_name[12] = {
+ static const char mon_name[][3] = {
"Jan", "Feb", "Mar", "Apr", "May", "Jun",
"Jul", "Aug", "Sep", "Oct", "Nov", "Dec"
};
- register const char * wn;
- register const char * mn;
+ const char * wn;
+ const char * mn;
char year[INT_STRLEN_MAXIMUM(int) + 2];
char result[MAX_ASCTIME_BUF_SIZE];
Index: src/lib/libc/time/localtime.c
diff -u src/lib/libc/time/localtime.c:1.70 src/lib/libc/time/localtime.c:1.71
--- src/lib/libc/time/localtime.c:1.70 Fri Oct 26 19:23:23 2012
+++ src/lib/libc/time/localtime.c Sun Oct 28 13:11:33 2012
@@ -1,4 +1,4 @@
-/* $NetBSD: localtime.c,v 1.70 2012/10/26 23:23:23 christos Exp $ */
+/* $NetBSD: localtime.c,v 1.71 2012/10/28 17:11:33 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.70 2012/10/26 23:23:23 christos Exp $");
+__RCSID("$NetBSD: localtime.c,v 1.71 2012/10/28 17:11:33 christos Exp $");
#endif
#endif /* LIBC_SCCS and not lint */
@@ -83,7 +83,7 @@ __weak_alias(tzname,_tzname)
static const char wildabbr[] = WILDABBR;
-static char gmt[] = "GMT";
+static const char gmt[] = "GMT";
/*
** The DST rules to use if TZ has no rules and we can't load TZDEFRULES.
@@ -268,7 +268,7 @@ detzcode64(const char *const codep)
time_t result;
int i;
- result = (codep[0] & 0x80) ? -1 : 0;
+ result = (codep[0] & 0x80) ? (~(int_fast64_t) 0) : 0;
for (i = 0; i < 8; ++i)
result = result * 256 + (codep[i] & 0xff);
return result;
@@ -346,7 +346,7 @@ settzname(void)
timezone = -(ttisp->tt_gmtoff);
#endif /* defined USG_COMPAT */
#ifdef ALTZONE
- if (i == 0 || ttisp->tt_isdst)
+ if (ttisp->tt_isdst)
altzone = -(ttisp->tt_gmtoff);
#endif /* defined ALTZONE */
}