@@ -107,15 +107,15 @@ static bool typesequiv(struct state const *, int, int);
107107
108108static struct pg_tm tm ;
109109
110- /* Initialize *S to a value based onGMTOFF , ISDST, andABBRIND . */
110+ /* Initialize *S to a value based onUTOFF , ISDST, andDESIGIDX . */
111111static void
112- init_ttinfo (struct ttinfo * s ,int32 gmtoff ,bool isdst ,int abbrind )
112+ init_ttinfo (struct ttinfo * s ,int32 utoff ,bool isdst ,int desigidx )
113113{
114- s -> tt_gmtoff = gmtoff ;
114+ s -> tt_utoff = utoff ;
115115s -> tt_isdst = isdst ;
116- s -> tt_abbrind = abbrind ;
116+ s -> tt_desigidx = desigidx ;
117117s -> tt_ttisstd = false;
118- s -> tt_ttisgmt = false;
118+ s -> tt_ttisut = false;
119119}
120120
121121static int32
@@ -251,7 +251,7 @@ tzloadbody(char const *name, char *canonname, struct state *sp, bool doextend,
251251for (stored = 4 ;stored <=8 ;stored *=2 )
252252{
253253int32 ttisstdcnt = detzcode (up -> tzhead .tzh_ttisstdcnt );
254- int32 ttisgmtcnt = detzcode (up -> tzhead .tzh_ttisgmtcnt );
254+ int32 ttisutcnt = detzcode (up -> tzhead .tzh_ttisutcnt );
255255int64 prevtr = 0 ;
256256int32 prevcorr = 0 ;
257257int32 leapcnt = detzcode (up -> tzhead .tzh_leapcnt );
@@ -270,7 +270,7 @@ tzloadbody(char const *name, char *canonname, struct state *sp, bool doextend,
270270&& 0 <=timecnt && timecnt < TZ_MAX_TIMES
271271&& 0 <=charcnt && charcnt < TZ_MAX_CHARS
272272&& (ttisstdcnt == typecnt || ttisstdcnt == 0 )
273- && (ttisgmtcnt == typecnt || ttisgmtcnt == 0 )))
273+ && (ttisutcnt == typecnt || ttisutcnt == 0 )))
274274return EINVAL ;
275275if (nread
276276< (tzheadsize /* struct tzhead */
@@ -280,7 +280,7 @@ tzloadbody(char const *name, char *canonname, struct state *sp, bool doextend,
280280+ charcnt /* chars */
281281+ leapcnt * (stored + 4 )/* lsinfos */
282282+ ttisstdcnt /* ttisstds */
283- + ttisgmtcnt ))/*ttisgmts */
283+ + ttisutcnt ))/*ttisuts */
284284return EINVAL ;
285285sp -> leapcnt = leapcnt ;
286286sp -> timecnt = timecnt ;
@@ -332,19 +332,19 @@ tzloadbody(char const *name, char *canonname, struct state *sp, bool doextend,
332332{
333333struct ttinfo * ttisp ;
334334unsignedchar isdst ,
335- abbrind ;
335+ desigidx ;
336336
337337ttisp = & sp -> ttis [i ];
338- ttisp -> tt_gmtoff = detzcode (p );
338+ ttisp -> tt_utoff = detzcode (p );
339339p += 4 ;
340340isdst = * p ++ ;
341341if (!(isdst < 2 ))
342342return EINVAL ;
343343ttisp -> tt_isdst = isdst ;
344- abbrind = * p ++ ;
345- if (!(abbrind < sp -> charcnt ))
344+ desigidx = * p ++ ;
345+ if (!(desigidx < sp -> charcnt ))
346346return EINVAL ;
347- ttisp -> tt_abbrind = abbrind ;
347+ ttisp -> tt_desigidx = desigidx ;
348348}
349349for (i = 0 ;i < sp -> charcnt ;++ i )
350350sp -> chars [i ]= * p ++ ;
@@ -398,13 +398,13 @@ tzloadbody(char const *name, char *canonname, struct state *sp, bool doextend,
398398struct ttinfo * ttisp ;
399399
400400ttisp = & sp -> ttis [i ];
401- if (ttisgmtcnt == 0 )
402- ttisp -> tt_ttisgmt = false;
401+ if (ttisutcnt == 0 )
402+ ttisp -> tt_ttisut = false;
403403else
404404{
405405if (* p != true&& * p != false)
406406return EINVAL ;
407- ttisp -> tt_ttisgmt = * p ++ ;
407+ ttisp -> tt_ttisut = * p ++ ;
408408}
409409}
410410
@@ -438,13 +438,13 @@ tzloadbody(char const *name, char *canonname, struct state *sp, bool doextend,
438438
439439for (i = 0 ;i < ts -> typecnt ;i ++ )
440440{
441- char * tsabbr = ts -> chars + ts -> ttis [i ].tt_abbrind ;
441+ char * tsabbr = ts -> chars + ts -> ttis [i ].tt_desigidx ;
442442int j ;
443443
444444for (j = 0 ;j < charcnt ;j ++ )
445445if (strcmp (sp -> chars + j ,tsabbr )== 0 )
446446{
447- ts -> ttis [i ].tt_abbrind = j ;
447+ ts -> ttis [i ].tt_desigidx = j ;
448448gotabbr ++ ;
449449break ;
450450}
@@ -456,7 +456,7 @@ tzloadbody(char const *name, char *canonname, struct state *sp, bool doextend,
456456{
457457strcpy (sp -> chars + j ,tsabbr );
458458charcnt = j + tsabbrlen + 1 ;
459- ts -> ttis [i ].tt_abbrind = j ;
459+ ts -> ttis [i ].tt_desigidx = j ;
460460gotabbr ++ ;
461461}
462462}
@@ -614,12 +614,13 @@ typesequiv(const struct state *sp, int a, int b)
614614const struct ttinfo * ap = & sp -> ttis [a ];
615615const struct ttinfo * bp = & sp -> ttis [b ];
616616
617- result = ap -> tt_gmtoff == bp -> tt_gmtoff &&
618- ap -> tt_isdst == bp -> tt_isdst &&
619- ap -> tt_ttisstd == bp -> tt_ttisstd &&
620- ap -> tt_ttisgmt == bp -> tt_ttisgmt &&
621- strcmp (& sp -> chars [ap -> tt_abbrind ],
622- & sp -> chars [bp -> tt_abbrind ])== 0 ;
617+ result = (ap -> tt_utoff == bp -> tt_utoff
618+ && ap -> tt_isdst == bp -> tt_isdst
619+ && ap -> tt_ttisstd == bp -> tt_ttisstd
620+ && ap -> tt_ttisut == bp -> tt_ttisut
621+ && (strcmp (& sp -> chars [ap -> tt_desigidx ],
622+ & sp -> chars [bp -> tt_desigidx ])
623+ == 0 ));
623624}
624625return result ;
625626}
@@ -1176,7 +1177,7 @@ tzparse(const char *name, struct state *sp, bool lastditch)
11761177if (!sp -> ttis [j ].tt_isdst )
11771178{
11781179theirstdoffset =
1179- - sp -> ttis [j ].tt_gmtoff ;
1180+ - sp -> ttis [j ].tt_utoff ;
11801181break ;
11811182}
11821183}
@@ -1187,7 +1188,7 @@ tzparse(const char *name, struct state *sp, bool lastditch)
11871188if (sp -> ttis [j ].tt_isdst )
11881189{
11891190theirdstoffset =
1190- - sp -> ttis [j ].tt_gmtoff ;
1191+ - sp -> ttis [j ].tt_utoff ;
11911192break ;
11921193}
11931194}
@@ -1206,7 +1207,7 @@ tzparse(const char *name, struct state *sp, bool lastditch)
12061207{
12071208j = sp -> types [i ];
12081209sp -> types [i ]= sp -> ttis [j ].tt_isdst ;
1209- if (sp -> ttis [j ].tt_ttisgmt )
1210+ if (sp -> ttis [j ].tt_ttisut )
12101211{
12111212/* No adjustment to transition time */
12121213}
@@ -1234,7 +1235,7 @@ tzparse(const char *name, struct state *sp, bool lastditch)
12341235theirstdoffset ;
12351236}
12361237}
1237- theiroffset = - sp -> ttis [j ].tt_gmtoff ;
1238+ theiroffset = - sp -> ttis [j ].tt_utoff ;
12381239if (sp -> ttis [j ].tt_isdst )
12391240theirdstoffset = theiroffset ;
12401241else
@@ -1357,14 +1358,14 @@ localsub(struct state const *sp, pg_time_t const *timep,
13571358
13581359/*
13591360 * To get (wrong) behavior that's compatible with System V Release 2.0
1360- * you'd replace the statement below with t += ttisp->tt_gmtoff ;
1361+ * you'd replace the statement below with t += ttisp->tt_utoff ;
13611362 * timesub(&t, 0L, sp, tmp);
13621363 */
1363- result = timesub (& t ,ttisp -> tt_gmtoff ,sp ,tmp );
1364+ result = timesub (& t ,ttisp -> tt_utoff ,sp ,tmp );
13641365if (result )
13651366{
13661367result -> tm_isdst = ttisp -> tt_isdst ;
1367- result -> tm_zone = (char * )& sp -> chars [ttisp -> tt_abbrind ];
1368+ result -> tm_zone = (char * )& sp -> chars [ttisp -> tt_desigidx ];
13681369}
13691370return result ;
13701371}
@@ -1647,7 +1648,7 @@ pg_next_dst_boundary(const pg_time_t *timep,
16471648break ;
16481649}
16491650ttisp = & sp -> ttis [i ];
1650- * before_gmtoff = ttisp -> tt_gmtoff ;
1651+ * before_gmtoff = ttisp -> tt_utoff ;
16511652* before_isdst = ttisp -> tt_isdst ;
16521653return 0 ;
16531654}
@@ -1700,7 +1701,7 @@ pg_next_dst_boundary(const pg_time_t *timep,
17001701/* No known transition > t, so use last known segment's type */
17011702i = sp -> types [sp -> timecnt - 1 ];
17021703ttisp = & sp -> ttis [i ];
1703- * before_gmtoff = ttisp -> tt_gmtoff ;
1704+ * before_gmtoff = ttisp -> tt_utoff ;
17041705* before_isdst = ttisp -> tt_isdst ;
17051706return 0 ;
17061707}
@@ -1715,13 +1716,13 @@ pg_next_dst_boundary(const pg_time_t *timep,
17151716break ;
17161717}
17171718ttisp = & sp -> ttis [i ];
1718- * before_gmtoff = ttisp -> tt_gmtoff ;
1719+ * before_gmtoff = ttisp -> tt_utoff ;
17191720* before_isdst = ttisp -> tt_isdst ;
17201721* boundary = sp -> ats [0 ];
17211722/* And for "after", use the first segment's type */
17221723i = sp -> types [0 ];
17231724ttisp = & sp -> ttis [i ];
1724- * after_gmtoff = ttisp -> tt_gmtoff ;
1725+ * after_gmtoff = ttisp -> tt_utoff ;
17251726* after_isdst = ttisp -> tt_isdst ;
17261727return 1 ;
17271728}
@@ -1743,12 +1744,12 @@ pg_next_dst_boundary(const pg_time_t *timep,
17431744}
17441745j = sp -> types [i - 1 ];
17451746ttisp = & sp -> ttis [j ];
1746- * before_gmtoff = ttisp -> tt_gmtoff ;
1747+ * before_gmtoff = ttisp -> tt_utoff ;
17471748* before_isdst = ttisp -> tt_isdst ;
17481749* boundary = sp -> ats [i ];
17491750j = sp -> types [i ];
17501751ttisp = & sp -> ttis [j ];
1751- * after_gmtoff = ttisp -> tt_gmtoff ;
1752+ * after_gmtoff = ttisp -> tt_utoff ;
17521753* after_isdst = ttisp -> tt_isdst ;
17531754return 1 ;
17541755}
@@ -1832,9 +1833,9 @@ pg_interpret_timezone_abbrev(const char *abbrev,
18321833for (i = cutoff - 1 ;i >=0 ;i -- )
18331834{
18341835ttisp = & sp -> ttis [sp -> types [i ]];
1835- if (ttisp -> tt_abbrind == abbrind )
1836+ if (ttisp -> tt_desigidx == abbrind )
18361837{
1837- * gmtoff = ttisp -> tt_gmtoff ;
1838+ * gmtoff = ttisp -> tt_utoff ;
18381839* isdst = ttisp -> tt_isdst ;
18391840return true;
18401841}
@@ -1846,9 +1847,9 @@ pg_interpret_timezone_abbrev(const char *abbrev,
18461847for (i = cutoff ;i < sp -> timecnt ;i ++ )
18471848{
18481849ttisp = & sp -> ttis [sp -> types [i ]];
1849- if (ttisp -> tt_abbrind == abbrind )
1850+ if (ttisp -> tt_desigidx == abbrind )
18501851{
1851- * gmtoff = ttisp -> tt_gmtoff ;
1852+ * gmtoff = ttisp -> tt_utoff ;
18521853* isdst = ttisp -> tt_isdst ;
18531854return true;
18541855}
@@ -1875,10 +1876,10 @@ pg_get_timezone_offset(const pg_tz *tz, long int *gmtoff)
18751876sp = & tz -> state ;
18761877for (i = 1 ;i < sp -> typecnt ;i ++ )
18771878{
1878- if (sp -> ttis [i ].tt_gmtoff != sp -> ttis [0 ].tt_gmtoff )
1879+ if (sp -> ttis [i ].tt_utoff != sp -> ttis [0 ].tt_utoff )
18791880return false;
18801881}
1881- * gmtoff = sp -> ttis [0 ].tt_gmtoff ;
1882+ * gmtoff = sp -> ttis [0 ].tt_utoff ;
18821883return true;
18831884}
18841885