]> granicus.if.org Git - php/commitdiff
Use new structures for tzdb header here as well
authorDerick Rethans <github@derickrethans.nl>
Tue, 28 Apr 2015 23:28:50 +0000 (00:28 +0100)
committerDerick Rethans <github@derickrethans.nl>
Tue, 28 Apr 2015 23:28:50 +0000 (00:28 +0100)
ext/date/php_date.c

index 7f05bab99e46e823acc0ae6291393f42dae5efc8..12d9ea779ff3f2d5678fb0a36819a49848a12708 100644 (file)
@@ -3898,7 +3898,7 @@ PHP_FUNCTION(timezone_transitions_get)
                add_assoc_string(element, "abbr", &tzobj->tzi.tz->timezone_abbr[tzobj->tzi.tz->type[tzobj->tzi.tz->trans_idx[i]].abbr_idx], 1); \
                add_next_index_zval(return_value, element);
 
-#define add_last() add(tzobj->tzi.tz->timecnt - 1, timestamp_begin)
+#define add_last() add(tzobj->tzi.tz->bit32.timecnt - 1, timestamp_begin)
 
        array_init(return_value);
 
@@ -3909,7 +3909,7 @@ PHP_FUNCTION(timezone_transitions_get)
        } else {
                begin = 0;
                found = 0;
-               if (tzobj->tzi.tz->timecnt > 0) {
+               if (tzobj->tzi.tz->bit32.timecnt > 0) {
                        do {
                                if (tzobj->tzi.tz->trans[begin] > timestamp_begin) {
                                        if (begin > 0) {
@@ -3921,18 +3921,18 @@ PHP_FUNCTION(timezone_transitions_get)
                                        break;
                                }
                                begin++;
-                       } while (begin < tzobj->tzi.tz->timecnt);
+                       } while (begin < tzobj->tzi.tz->bit32.timecnt);
                }
        }
 
        if (!found) {
-               if (tzobj->tzi.tz->timecnt > 0) {
+               if (tzobj->tzi.tz->bit32.timecnt > 0) {
                        add_last();
                } else {
                        add_nominal();
                }
        } else {
-               for (i = begin; i < tzobj->tzi.tz->timecnt; ++i) {
+               for (i = begin; i < tzobj->tzi.tz->bit32.timecnt; ++i) {
                        if (tzobj->tzi.tz->trans[i] < timestamp_end) {
                                add(i, tzobj->tzi.tz->trans[i]);
                        }