[tz] zic changes (2/2)

Arthur David Olson arthurdavidolson at gmail.com
Thu May 1 19:10:41 UTC 2014


And now, the update. These changes arrange things so that binary files
include "transition" entries for minimum time values; these entries
eliminate localtime guesswork in handling low-valued time stamps.

The bad news: binary files grow slightly as a result of these changes.
The good news: there are no changes in the output of "zdump -v" applied to
before-and-after versions of all the binary files generated by a "make
install."

Changes are attached and appear in mangled form below; these are relative
to the github version of zic.c after the rollback in the earlier message
today.

    @dashdashado

1.2
2805 lines
1.4
2813 lines
*** /tmp/,azic.c    2014-05-01 01:51:36.998933800 -0400
--- /tmp/,bzic.c    2014-05-01 01:51:37.092534000 -0400
***************
*** 1480,1493 ****
          fromi = 0;
          while (fromi < timecnt && attypes[fromi].at < min_time)
              ++fromi;
-         if (isdsts[0] == 0)
-             while (fromi < timecnt && attypes[fromi].type == 0)
-                 ++fromi;    /* handled by default rule */
          for ( ; fromi < timecnt; ++fromi) {
!             if (toi != 0 && ((attypes[fromi].at +
                  gmtoffs[attypes[toi - 1].type]) <=
!                 (attypes[toi - 1].at + gmtoffs[toi == 1 ? 0
!                 : attypes[toi - 2].type]))) {
                      attypes[toi - 1].type =
                          attypes[fromi].type;
                      continue;
--- 1480,1490 ----
          fromi = 0;
          while (fromi < timecnt && attypes[fromi].at < min_time)
              ++fromi;
          for ( ; fromi < timecnt; ++fromi) {
!             if (toi > 1 && ((attypes[fromi].at +
                  gmtoffs[attypes[toi - 1].type]) <=
!                 (attypes[toi - 1].at +
!                 gmtoffs[attypes[toi - 2].type]))) {
                      attypes[toi - 1].type =
                          attypes[fromi].type;
                      continue;
***************
*** 1532,1537 ****
--- 1529,1541 ----
          --timecnt32;
          ++timei32;
      }
+     /*
+     ** Output an INT32_MIN "transition" if appropriate--see below.
+     */
+     if (timei32 > 0 && ats[timei32] > INT32_MIN) {
+         --timei32;
+         ++timecnt32;
+     }
      while (leapcnt32 > 0 && !is32(trans[leapcnt32 - 1]))
          --leapcnt32;
      while (leapcnt32 > 0 && !is32(trans[leapi32])) {
***************
*** 1698,1704 ****
  #undef DO
          for (i = thistimei; i < thistimelim; ++i)
              if (pass == 1)
!                 puttzcode(ats[i], fp);
              else    puttzcode64(ats[i], fp);
          for (i = thistimei; i < thistimelim; ++i) {
              unsigned char    uc;
--- 1702,1713 ----
  #undef DO
          for (i = thistimei; i < thistimelim; ++i)
              if (pass == 1)
!                 /*
!                 ** Output an INT32_MIN "transition"
!                 ** if appropriate--see above.
!                 */
!                 puttzcode(((ats[i] < INT32_MIN) ?
!                     INT32_MIN : ats[i]), fp);
              else    puttzcode64(ats[i], fp);
          for (i = thistimei; i < thistimelim; ++i) {
              unsigned char    uc;
***************
*** 2176,2183 ****
              if (usestart) {
                  addtt(starttime, type);
                  usestart = FALSE;
!             } else if (stdoff != 0)
!                 addtt(min_time, type);
          } else for (year = min_year; year <= max_year; ++year) {
              if (useuntil && year > zp->z_untilrule.r_hiyear)
                  break;
--- 2185,2191 ----
              if (usestart) {
                  addtt(starttime, type);
                  usestart = FALSE;
!             } else    addtt(min_time, type);
          } else for (year = min_year; year <= max_year; ++year) {
              if (useuntil && year > zp->z_untilrule.r_hiyear)
                  break;
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mm.icann.org/pipermail/tz/attachments/20140501/704f3c40/attachment.htm>
-------------- next part --------------
1.2
2805 lines
1.4
2813 lines
*** /tmp/,azic.c	2014-05-01 01:51:36.998933800 -0400
--- /tmp/,bzic.c	2014-05-01 01:51:37.092534000 -0400
***************
*** 1480,1493 ****
  		fromi = 0;
  		while (fromi < timecnt && attypes[fromi].at < min_time)
  			++fromi;
- 		if (isdsts[0] == 0)
- 			while (fromi < timecnt && attypes[fromi].type == 0)
- 				++fromi;	/* handled by default rule */
  		for ( ; fromi < timecnt; ++fromi) {
! 			if (toi != 0 && ((attypes[fromi].at +
  				gmtoffs[attypes[toi - 1].type]) <=
! 				(attypes[toi - 1].at + gmtoffs[toi == 1 ? 0
! 				: attypes[toi - 2].type]))) {
  					attypes[toi - 1].type =
  						attypes[fromi].type;
  					continue;
--- 1480,1490 ----
  		fromi = 0;
  		while (fromi < timecnt && attypes[fromi].at < min_time)
  			++fromi;
  		for ( ; fromi < timecnt; ++fromi) {
! 			if (toi > 1 && ((attypes[fromi].at +
  				gmtoffs[attypes[toi - 1].type]) <=
! 				(attypes[toi - 1].at +
! 				gmtoffs[attypes[toi - 2].type]))) {
  					attypes[toi - 1].type =
  						attypes[fromi].type;
  					continue;
***************
*** 1532,1537 ****
--- 1529,1541 ----
  		--timecnt32;
  		++timei32;
  	}
+ 	/*
+ 	** Output an INT32_MIN "transition" if appropriate--see below.
+ 	*/
+ 	if (timei32 > 0 && ats[timei32] > INT32_MIN) {
+ 		--timei32;
+ 		++timecnt32;
+ 	}
  	while (leapcnt32 > 0 && !is32(trans[leapcnt32 - 1]))
  		--leapcnt32;
  	while (leapcnt32 > 0 && !is32(trans[leapi32])) {
***************
*** 1698,1704 ****
  #undef DO
  		for (i = thistimei; i < thistimelim; ++i)
  			if (pass == 1)
! 				puttzcode(ats[i], fp);
  			else	puttzcode64(ats[i], fp);
  		for (i = thistimei; i < thistimelim; ++i) {
  			unsigned char	uc;
--- 1702,1713 ----
  #undef DO
  		for (i = thistimei; i < thistimelim; ++i)
  			if (pass == 1)
! 				/*
! 				** Output an INT32_MIN "transition"
! 				** if appropriate--see above.
! 				*/
! 				puttzcode(((ats[i] < INT32_MIN) ?
! 					INT32_MIN : ats[i]), fp);
  			else	puttzcode64(ats[i], fp);
  		for (i = thistimei; i < thistimelim; ++i) {
  			unsigned char	uc;
***************
*** 2176,2183 ****
  			if (usestart) {
  				addtt(starttime, type);
  				usestart = FALSE;
! 			} else if (stdoff != 0)
! 				addtt(min_time, type);
  		} else for (year = min_year; year <= max_year; ++year) {
  			if (useuntil && year > zp->z_untilrule.r_hiyear)
  				break;
--- 2185,2191 ----
  			if (usestart) {
  				addtt(starttime, type);
  				usestart = FALSE;
! 			} else	addtt(min_time, type);
  		} else for (year = min_year; year <= max_year; ++year) {
  			if (useuntil && year > zp->z_untilrule.r_hiyear)
  				break;


More information about the tz mailing list