[tz] suggestions for potential code improvements?

Paul Eggert eggert at cs.ucla.edu
Thu Jul 30 20:09:57 UTC 2015


Kees Dekker wrote:
> I think the two files that were not correctly patched are the Makefile and date.c. So my comments on date.c may be related to an outdated version.

Yes, that's correct.  I suggest getting the latest version from github.

> Remarks for zdump.c:
> You said that tzcode supplies its own gmtime_r(). Do you mean the onze in zdump.c itself? That one is only supplied if HAVE_LOCALTIME_R was not set/defined.

tzcode supplies two gmtime_r implementations.  One in localtime.c, the other in 
zdump.c.  zdump is supposed to be independent of the rest of the code, so it 
needs its own gmtime_r replacement if the system lacks gmtime_r and localtime.c 
is not being used.

It's OK that zdump's gmtime_r is compiled when !HAVE_LOCALTIME_R, because every 
system that defines localtime_r also defines gmtime_r and vice versa.

> Remarks for zic.c:
> There are still some inconsistent prototypes: inleap(),inlink(),rulesub(),outzone(),addtt(),yearistype(),byword(), oadd(),tadd(),rpytime(),newabbr(). If you can make them consistent (declaration & definition) it would be great.

Thanks, fixed in the attached patch (installed on github).

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Pacify-Visual-Studio-2013-const-in-zic.patch
Type: text/x-diff
Size: 3617 bytes
Desc: not available
URL: <http://mm.icann.org/pipermail/tz/attachments/20150730/d602d309/0001-Pacify-Visual-Studio-2013-const-in-zic.patch>


More information about the tz mailing list