1
0
mirror of https://frontier.innolan.net/rainlance/amiga-tz.git synced 2025-11-20 03:11:52 +00:00

363 Commits

Author SHA1 Message Date
f0133dd86a Port to NetBSD, where, e.g., 'time_t' is wider than 'long'.
I audited the code and fixed as many width-asssumptions as I could
find, including several places where the code assumed that 'time_t'
was no wider than 'long'; this assumption is not true on 32-bit
NetBSD platforms.  This caught every problem that is already fixed
in the NetBSD zic.c, and caught quite a few more.
* Makefile: Add comments re HAVE_DOS_FILE_NAMES and HAVE_INTTYPES_H.
* date.c (checkfinal, netsettime): Don't use 'long' where 'int' will do.
* difftime.c (difftime): Mark with ATTRIBUTE_CONST.
Use uintmax_t, not unsigned long, for the widest unsigned integer type.
Use long double, not double, if time_t is wider than uintmax_t;
this can in theory help on nonstandard platforms, such as GCC
with 64-bit uintmax_t and 128-bit __int128_t.
* localtime.c (struct ttinfo.tt_gmtoff, struct rule.r_time)
(detzcode, getsecs, getoffset, gmtsub, localsub, increment_overflow32)
(normalize_overflow32, time1, time2, timesub, transtime, tzparse)
(time2sub, timeoff, gtime):
* tzfile.h (SECSPERDAY):
* zdump.c (SECSPERDAY):
* zic.c (convert, puttzcode):
Use int_fast32_t, not long, when all we care is that values up to
2**31 can be stored.  This doesn't fix any bugs, but it allows
more opportunity for compiler optimization.
(struct lsinfo.ls_corr, timesub, leapcorr):
Use int_fast64_t, not long, when values up to 2**63 can be stored.
(timesub): Make it clearer when we are truncating 0.5 to 0.
(increment_overflow32): Rename from long_increment_overflow.
All uses changed.
(normalize_overflow32): Rename from long_normalize_overflow.
All uses changed.
* private.h (HAVE_INTTYPES_H, ATTRIBUTE_CONST): New macros.
Include <inttypes.h> if HAVE_INTTYPES_H.
(INT_FAST64_MIN, INT_FAST64_MAX, SCNdFAST64, int_fast32_t, PRIdMAX)
(uintmax_t, PRIuMAX, _Noreturn):
Define to reasonable values if it's an older compiler.
* scheck.c (scheck): Add support for arbitrary formats, such as
those that SCNdFAST64 can expand to, at the price of no longer
supporting weird conversion specs like "%[%]".
* strftime.c (_fmt): Use intmax_t and uintmax_t to format time_t,
not long and unsigned long.
* zdump.c (int_fast32_t, intmax_t, PRIdMAX, SCNdMAX):
Define for pre-C99 compilers, like private.h does.
(delta, yeartot, main): Use intmax_t, not long.
(hunt): Use time_t, not long, since the diff must be nonnegative.
(tformat): Allow for time_t wider than long.
* zic.c (ZIC_MIN, ZIC_MAX, SCNdZIC): New macros.
(OFFSET_STRLEN_MAXIMUM, RULE_STRLEN_MAXIMUM): Remove.
(struct rule): Make r_loyear, r_hiyear, r_tod, r_stdoff, z_gmtoff,
z_stdoff zic_t, not long.
(addtype, gethms, oadd, rpytime, tadd, gmtoffs, corr, inleap)
(stringoffset, stringrule, outzone, addtype, adjleap, rpytime)
(LDAYSPERWEEK):
Use zic_t, not long.
(leapminyear, leapmaxyear, min_year, max_year, rulesub, updateminmax)
(outzone, rpytime):
Use zic_t, not int.
(usage): Now _Noreturn.
(main): Use S_IWGRP, not 'unix', to determine whether to call umask.
(writezone): Omit unnecessary cast.
(mkdirs): Use HAVE_DOS_FILE_NAMES, not 'unix', to determine
whether to parse DOS file anmes.
(eitol): Remove; no longer needed.
2013-05-27 21:26:18 -07:00
4c43a92919 Add tests for 32- and 64-bit signed and unsigned time_t.
* Makefile (TIME_T_ALTERNATIVES): New macro.
(check_time_t_alternatives, clean_misc): New rules.
(clean): Split out into clean_misc and removing tzpublic.
(public): Add check_time_t.
2013-05-27 14:59:14 -07:00
8a883a64cb Add support for testing time_t types other than the system's.
This makes it easier to test on (say) Debian, even if we're
testing the time_t type on (say) NetBSD.  NetBSD uses 64-bit
time_t on 32-bit hosts, and this lets us test a NetBSD-style
implementation (32-bit 'long', 64-bit time_t) on a 32-bit Debian host.
* Makefile: Update comments to talk about TIME_T_FLOATING and time_tz.
Sort the comments.
* private.h (restrict): Define to empty with older compilers.
'restrict' is now needed, to define gmtime_r and localtime_r in
standard ways when time_tz is defined.
Make the following changes if time_tz is defined:
(sys_time, time): New static functions.  The former is the system
'time' function that applies to the system time_t, the latter
our function that applies to our time_t.
(time_t, ctime, ctime_r, difftime, gmtime, gmtime_r, localtime)
(localtime_r, mktime): Rename to tz_time_t, tz_ctime, etc.,
via macros.  Declare the renamed versions.
* zdump.8: Document new options -V, -t.
* zdump.c: Include private.h if time_tz is defined.
(INITIALIZE): Remove; no longer needed.
(absolute_min_time, absolute_max_time): Work even if time_t
is wider than intmax_t, which can be true with GCC and __int128_t.
Use the new TIME_T_FLOATING macro for this.
(usage): Document new flags.
(main): Support them.
2013-05-27 14:59:09 -07:00
13d50f6f74 * Makefile: Remove obsolete NOID comment.
See <http://mm.icann.org/pipermail/tz/2013-May/019291.html>.
2013-05-23 13:01:02 -07:00
f599ad15ce Release tzcode2013c and tzdata2013c.
* Makefile (VERSION): Increase to 2013c.
2013-04-19 16:17:40 -07:00
014d6f775d Release tzcode2013b and tzdata2013b.
* Makefile (VERSION): Increase to 2013b.
2013-03-10 22:33:40 -07:00
0fdbcdc252 Release tzcode2013a and tzdata2013a.
* Makefile (VERSION): Increase to 2013a.
2013-02-27 09:20:35 -08:00
78d0395d95 Move 'make check' to Ubuntu 12.10.
* Makefile (SGML_DTDDIR): New macro, for easier porting.
Update to file name used in Ubuntu 12.10.
(SGML_SEARCH_PATH): Use SGML_DTDDIR.
2013-01-11 12:02:22 -08:00
daadd70793 Check that the distributed files use a safe ASCII subset.
* Makefile (TAB_CHAR, INVALID_CHAR1, INVALID_CHAR2, INVALID_CHAR3)
(INVALID_CHAR): New macros.
(check_character_set): New rule.
(check): Use it.
2012-12-13 17:19:47 -08:00
a435f9f0ec Make bug-reporting address more configurable.
Based on a patch by Joseph S. Myers in
<http://mm.icann.org/pipermail/tz/2012-November/018452.html>.
* Makefile (BUGEMAIL): New macro.
(version.h, tzselect): Use it to define REPORT_BUGS_TO.
* tzselect.ksh (REPORT_BUGS_TO): New variable, used for --help.
* zdump.c, zic.c (usage): Use REPORT_BUGS_TO for --help.
2012-11-12 21:52:35 -08:00
dec96c09a2 Release tzcode2012j and tzdata2012j.
* Makefile (VERSION): Increase to 2012j.
2012-11-12 18:34:49 -08:00
89a60086d3 Output version info in a more-typical format.
E.g., "zic (tzcode) 2012i" instead of "tzcode2012i".
Thread started by Joseph S. Myers in
<http://mm.icann.org/pipermail/tz/2012-November/018439.html>.
* Makefile (PACKAGE): New macro.
(version.h, tzselect): New constant PKGVERSION, derived from PACKAGE.
(tzselect): TZVERSION is now simply VERSION, since PACKAGE is also
output.
* tzselect.ksh (PKGVERSION): New var, which Makefile substitutes for.
(--usage, --version): Exit with nonzero status if we can't
output the help or version number.
* tzselect.ksh (--version):
* zdump.c, zic.c (main):
Output versions like this: "zdump (tzcode) 2012i".
2012-11-09 18:12:22 -08:00
cb66ad8326 Check 'public' more carefully.
* Makefile (ZFLAGS): Remove obsolete comment.
(check_public): Put temporary directory under this directory, not
under /tmp, as that's better if one is doing multiple builds in
parallel.  Also, use the just-built zic rather than the system zic.
(clean): Remove temporary directory.
2012-11-03 19:39:56 -07:00
4fc4c4cf40 Use .asc and not .sign for PGP signatures.
* Makefile (maintainer-clean): Clean *.asc files and *.tar.gz files.
(signatures): Use .asc instead of .sign as the extension for signatures
as this works better with other software.  Reported by Phil Pennock.
* .gitignore: Also ignore .asc files.
2012-11-03 17:41:16 -07:00
a1752133a1 Release tzcode2012i and tzdata2012i.
* Makefile (VERSION): Increase to 2012i.
2012-11-03 12:57:09 -07:00
d31d208f7e Automate the building of tarball signatures.
* Makefile (public): Rewrite in terms of new rules, below.
(check_public): New rule, containing the old checking part of
'make public'.
(tarballs): New rule, containing the old tarball-making part of
'make public'.  Do not run checktab twice.
(signatures, tzcode$(VERSION).tar.gz.sign, tzdata$(VERSION).tar.gz.sign):
New rules.
2012-11-03 12:56:05 -07:00
6daf83cd40 Have tzselect.ksh use Bash by default; this can be overridden.
* Makefile (KSHELL): New macro.
(tzselect): Use it.
* tzselect.ksh: Use "#!/bin/bash", not "#! /bin/ksh".  The Makefile
can override this.  No need for a space after "!'; that was put in
years ago only because of an urban legend.
2012-10-27 13:54:13 -07:00
540e58b0aa Makefile portability improvements.
* Makefile (LDFLAGS): Rename from LFLAGS, with backwards compatibility.
All uses changed.  Suggested by Mike Frysinger in
<http://mm.icann.org/pipermail/tz/2012-October/018396.html>.
(zdump, zic, date): Use $(CC) -o $@ ... rather than $(CC) ... -o $@,
for portability to strict older POSIX hosts.
($(TZLIB)): Don't use [ ... -o ... ], as it's not portable.
2012-10-27 13:19:45 -07:00
cff2e6fb6e * Makefile (AWK): Default to 'awk'; this is more portable these days.
Suggested by Mike Frysinger in
<http://mm.icann.org/pipermail/tz/2012-October/018397.html>.
2012-10-27 12:36:00 -07:00
001a626d31 Release tzcode2012h and tzdata2012h.
* Makefile (VERSION): Increase to 2012h.
2012-10-26 22:49:10 -07:00
c350bfd55f More C modernization.
* Makefile (typecheck): Add -D__time_t_defined to CFLAGS,
for glibc 2.15.
* asctime.c (asctime_r, asctime):
* date.c (main, dogmt, reset, nondigit, sametm, convert, checkfinal):
* ialloc.c (icatalloc):
* localtime.c (detzcode, detzcode64, settzname, tzload)
(typesequiv, getzname, getqzname, getnum, getsecs, getoffset)
(getrule, transtime, tzparse, tzset, localsub, gmtsub)
(leaps_thru_end_of, timesub, increment_overflow)
(long_increment_overflow, normalize_overflow)
(long_normalize_overflow, tmcomp, time2sub, time1, leapcorr):
* scheck.c (scheck):
* strftime.c (_yconv):
* zdump.c (my_localtime, abbrok, main, yeartot, hunt)
(delta, show, abbr, dumptime):
* zic.c (main, dolink, itsdir, associate, infile, inrule)
(inzone, inzcont, inzsub, inleap, inlink, rulesub, convert64)
(writezone, doabbr, stringoffset, stringrule, stringzone)
(outzone, addtype, leapadd, adjleap, ciequal, itsabbr, byword)
(getfields, rpytime, newabbr, mkdirs):
Omit 'register', as it adds no value these days.  See Christos Zoulas in
<http://mm.icann.org/pipermail/tz/2012-October/018376.html>.
* date.c (netsettime) [TSP_SETDATE]: Add forward decl.
Don't rely on implicit int.  Now static.  Use NULL, not 0.
* zdump.c: Include "limits.h".
(absolute_min_time, absolute_max_time): Compute at compile-time,
as the run-time tests relied on undefined behavior.
(checkabsolutes): Rename from setabsolutes.  Just check, since
there's nothing to set now.  All uses changed.
2012-10-26 00:48:01 -07:00
ec6a124c84 Release tzcode2012g and tzdata2012g.
* Makefile (VERSION): Increase to 2012g.
(COMMON): New macro.
(DOCS): Remove Makefile.
(ENCHILADA): Adjust to above changes.
(public): Put $(COMMON) in both tarballs, so that the version
number is in both distributions.
2012-10-17 20:59:45 -07:00
400ecf36bb Assume C89.
* Makefile (GCC_DEBUG_FLAGS): Modernize for GCC 4.6.3 x86.
* asctime.c (asctime_r, asctime):
* date.c (main, dogmt, reset, wildinput, nondigit, oops, display)
(timeout, sametm, netsettime):
* difftime.c (difftime):
* ialloc.c (icatalloc, icpyalloc):
* localtime.c (detzcode, detzcode64, differ_by_repeat)
(tzload, typesequiv, getzname, getnum, getsecs, getoffset)
(getrule, transtime, tzparse, gmtload, tzsetwall, tzset)
(localsub, localtime, localtime_r, gmtsub, gmtime, gmtime_r)
(offtime, leaps_thru_end_of, timesub, ctime, ctime_r)
(increment_overflow, long_increment_overflow)
(normalize_overflow, long_normalize_overflow, tmcomp, time2sub)
(time2, time1, mktime, timelocal, timegm, timeoff, gtime)
(leapcorr, time2posix, posix2time):
* scheck.c (scheck):
* strftime.c (strftime, _fmt, _conv, _add, _yconv, _loc):
* zdump.c (my_localtime, abbrok, usage, main, yeartot)
(delta, abbr, dumptime):
* zic.c (memcheck, eats, eat, error, warning, main)
(dolink, itsdir, rcomp, associate, infile, gethms, inrule)
(inzone, inzcont, inzsub, inleap, inlink, rulesub, convert)
(convert64, puttzcode, puttzcode64, atcomp, is32, writezone, DO)
(doabbr, updateminmax, stringoffset, stringrule, stringzone)
(outzone, addtt, addtype, leapadd, yearistype, lowerit, ciequal)
(itsabbr, byword, getfields, oadd, tadd, rpytime, newabbr)
(mkdirs, eitol):
Assume C89 or better.  Mostly this consists of using function
prototypes.  In a few places, prototypes are required for
portability to hosts where time_t does not promote to itself and
where a preceding prototype does not override a definition.  But
while we're at it we might as well be consistent: it's safe to
assume at-least-C89 these days.
* ialloc.c (nonzero, imalloc, icalloc, irealloc, ifree, icfree):
Remove; no longer needed now that we assume C89 or better.
All callers changed to use malloc, calloc, realloc, free.
* localtime.c (getzname, getqzname, leaps_thru_end_of, transtime):
* zdump.c (delta, yeartot):
* zic.c (eitol):
Now pure.
* private.h, zdump.c (ATTRIBUTE_PURE): New macro.
* private.h (icalloc, imalloc, irealloc, icfree, ifree): Remove decls.
* zic.c: Remove no-longer-necessary forward decls.
(max_time, min_time): Now const.
(setboundaries): Remove.
2012-10-12 07:53:12 -07:00
66f0c30ddc Release tzdata2012f.
* Makefile (VERSION): Increase to 2012f.
2012-09-12 23:17:03 -07:00
60e612c3f4 Release tzcode2012e and tzdata2012e.
* Makefile (VERSION): Increase to 2012e.
2012-08-02 20:44:55 -07:00
33232258ad Use a single version number for both code and data.
* Makefile (VERSION): New macro, superseding ...
(TZCODE_VERSION, TZDATA_VERSION): Remove.  All uses changed.
(version.h): Call the variable TZVERSION, not TZCODE_VERSION.
All uses changed.
(tzselect): Interpolate TZVERSION, not TZCODE_VERSION.
(public): Adjust to new versioning scheme.
* tzselect.ksh (TZVERSION): Rename from TZCODE_VERSION.
* zdump.c, zic.c (main): Use TZVERSION, not TZCODE_VERSION.
2012-07-25 07:46:06 -07:00
ee42236d51 Release tzcode2012c and tzdata2012d.
* Makefile (TZCODE_VERSION): Increase to tzcode2012c.
(TZDATA_VERSION, GNUTARFLAGS, TARFLAGS, GZIPFLAGS): New macros.
(maintainer-clean): Remove all the old tar.gz files.
(set-timestamps): New rule.
(public): Use it.  Create distribution files that are more
reproducible, by omitting irrelevant information such as the time
of checkout or build, the builder's user name, the builder's
locale, and so forth.  Be more careful about file permissions in /tmp.
2012-07-19 16:35:33 -07:00
8a52da39ed Fix HTML validation issues.
* Makefile (SGML_TOPDIR): New macro, with default for Ubuntu
(SGML_SEARCH_DIR): Use it.
* tz-art.htm: Fix HTML typos uncovered by validator.
2012-07-18 19:23:31 -07:00
dccd5a16af Switch from SCCS to git.
Remove the SCCS keyword '%W%' from all files.
Mostly this just remove comments.
Remove trailing white space, too.
* Makefile (TZCODE_VERSION): New macro.
(version.h): New rule.
(tzselect): Interpolate TZCODE_VERSION.
(clean): Remove version.h.
(zdump.o, zic.o): Depend on version.h.
* asctime.c, date.c, difftime.c, ialloc.c, localtime.c, scheck.c:
* strftime.c, zdump.c, zic.c: Remove elsieid.
* private.h: Remove privatehid.
* tzfile.h: Remove tzfilehid.
* tzselect.h (TZCODE_VERSION): Rename from VERSION.
* zdump.c, zic.c: Include "version.h",
and use TZCODE_VERSION instead of elsieid.
2012-07-18 17:30:38 -07:00
300b05dba1 2012b revert Makefile to 8.11
SCCS-file: Makefile
SCCS-SID: 8.13
2012-07-18 03:03:15 -04:00
a61bc0b2e2 2012a KREified version of Makefile
SCCS-file: Makefile
SCCS-SID: 8.12
2012-07-18 03:03:15 -04:00
b203274e2f remove itca.jpg from distribution
SCCS-file: Makefile
SCCS-SID: 8.11
2012-07-18 03:03:13 -04:00
9846f4d541 goose GCC_DEBUG_FLAGS
SCCS-file: Makefile
SCCS-SID: 8.10
2012-07-18 03:03:12 -04:00
1ae13499b8 abandon factory; make GMT default
SCCS-file: Makefile
SCCS-SID: 8.9
2012-07-18 03:03:10 -04:00
d79e87ddad public domain
SCCS-file: Makefile
SCCS-SID: 8.8
2012-07-18 03:03:07 -04:00
8d6eadc36b logwtmp.c goes
SCCS-file: Makefile
SCCS-SID: 8.7
2012-07-18 03:03:05 -04:00
3661fc971c HAVE_STRERROR goes
SCCS-file: Makefile
SCCS-SID: 8.6
2012-07-18 03:03:03 -04:00
a64f25d483 noncontroversial changes
SCCS-file: Makefile
SCCS-SID: 8.5
2012-07-18 03:03:02 -04:00
5c2f9241b4 Eggert mods
SCCS-file: Makefile
SCCS-SID: 8.4
2012-07-18 03:02:59 -04:00
da4516f8fb Eggert mods
SCCS-file: Makefile
SCCS-SID: 8.3
2012-07-18 03:02:58 -04:00
e89d1def9d zon*.pl in release
SCCS-file: Makefile
SCCS-SID: 8.2
2012-07-18 03:02:58 -04:00
8f6eb92ace 64-bit version
SCCS-file: Makefile
SCCS-SID: 8.1
2012-07-18 03:02:52 -04:00
7a82175910 abbreviation warnings
SCCS-file: Makefile
SCCS-SID: 7.109
2012-07-18 03:02:48 -04:00
c8c1aae947 SCCS-file: Makefile
SCCS-SID: 7.108
2012-07-18 03:02:48 -04:00
1d38e56f43 delinted
SCCS-file: Makefile
SCCS-SID: 7.107
2012-07-18 03:02:47 -04:00
1b61fdd2bb public: rule change
SCCS-file: Makefile
SCCS-SID: 7.106
2012-07-18 03:02:47 -04:00
087a386621 improved link-to-link checking
SCCS-file: Makefile
SCCS-SID: 7.105
2012-07-18 03:02:47 -04:00
381dcaf4a7 better public rule
SCCS-file: Makefile
SCCS-SID: 7.104
2012-07-18 03:02:47 -04:00
81fd631361 define TYPECHECK when doing make typecheck
SCCS-file: Makefile
SCCS-SID: 7.103
2012-07-18 03:02:46 -04:00
fdde3842e1 improved typecheck
SCCS-file: Makefile
SCCS-SID: 7.102
2012-07-18 03:02:46 -04:00