[tz] dead code in zic

Christos Zoulas christos at zoulas.com
Wed Mar 6 18:25:18 UTC 2013


On Mar 5,  9:18pm, eggert at cs.ucla.edu (Paul Eggert) wrote:
-- Subject: Re: [tz] dead code in zic

| I'd go further.  I expect the zic.c code would benefit
| by a uniform substitution of int_fast64_t for long -- but one would
| have to do considerably more than just a simple string substitution.

Thanks for the hint! I replaced:

    zic_t -> intmax_t
    long -> zic_t
    %ld -> %jd

changed (not necessary but cleaner):

    static const zic_t min_time = INTMAX_MIN;
    static const zic_t max_time = INTMAX_MAX;

and removed unused:

    #define OFFSET_STRLEN_MAXIMUM  (7 + INT_STRLEN_MAXIMUM(long))
    #define RULE_STRLEN_MAXIMUM    8       /* "Mdd.dd.d" */

Tested on both 32 and 64 bit hosts, same zone files produced by the old
and the new zic. No compiler warnings.

Best,

christos



More information about the tz mailing list