1
0
mirror of https://frontier.innolan.net/rainlance/amiga-tz.git synced 2025-11-21 08:01:07 +00:00

Use bool for boolean.

The tz source code predates C99 and so used int, 0 and 1 for boolean,
but nowadays bool is available and makes the code clearer.
Include backwards-compatibility definitions for pre-C99 platforms,
and don't go beyond what the backwards-compatibility defintions support.
* date.c (main, reset, sametm, convert, checkfinal, iffy, netsettime):
* localtime.c (struct ttinfo, struct state, gmt_is_set)
(differ_by_repeat, tzload, typesequiv, getoffset, transtime)
(tzparse, gmtload, tzsetwall_unlocked, tzset_unlocked, gmtcheck)
(localtime_tzset, timesub, increment_overflow)
(increment_overflow32, increment_overflow_time)
(normalize_overflow, normalize_overflow32, time2sub, time2)
(time1):
* strftime.c (_fmt, _yconv, _loc):
* zdump.c (warned, errout, is_alpha, my_localtime, abbrok)
(main, hunt, show):
* zic.c (struct rule, errors, warnings, leapseen, noise)
(leap_types, ttisstds, ttisgmts, error, warning, main, dolink)
(associate, infile, gethms, inzone, inzcont, inzsub, inleap)
(rulesub, is32, writezone, doabbr, stringoffset, stringrule)
(stringzone, outzone, addtype, leapadd, yearistype, is_space)
(is_alpha, ciequal, itsabbr, mkdirs):
Use bool for boolean.
* localtime.c (tzload, tzparse):
* zic.c (stringoffset, mkdirs):
Return true for success and false for failure instead of 0 and -1.
All callers changed.
* private.h, zdump.c (TRUE, FALSE): Remove, replacing by ...
(true, false, bool): Define by <stdbool.h> if C99 or later,
by macros otherwise.
* tzfile.h: Remove mention of TRUE and FALSE from commentary.
* zic.c (addtype): Remove now-unnecessary checks that a bool is a
boolean.
This commit is contained in:
Paul Eggert
2014-08-20 08:13:31 -07:00
parent 96eff14f85
commit 7eb7c7349c
7 changed files with 304 additions and 320 deletions

View File

@ -62,13 +62,13 @@ struct tzhead {
** tzh_leapcnt repetitions of
** one (char [4]) coded leap second transition times
** one (char [4]) total correction after above
** tzh_ttisstdcnt (char)s indexed by type; if TRUE, transition
** time is standard time, if FALSE,
** tzh_ttisstdcnt (char)s indexed by type; if 1, transition
** time is standard time, if 0,
** transition time is wall clock time
** if absent, transition times are
** assumed to be wall clock time
** tzh_ttisgmtcnt (char)s indexed by type; if TRUE, transition
** time is UT, if FALSE,
** tzh_ttisgmtcnt (char)s indexed by type; if 1, transition
** time is UT, if 0,
** transition time is local time
** if absent, transition times are
** assumed to be local time