summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authorAnatol Belski <ab@php.net>2014-08-26 09:27:55 +0200
committerAnatol Belski <ab@php.net>2014-08-26 09:27:55 +0200
commitc49cd84da92c411d9cabce05d09c1a4a345b6c04 (patch)
tree6cc2f1be07e94fa98341ab320de5f4f2267771bf /ext
parent6469339a5819856a68c719170a48c2f9c80e5b33 (diff)
downloadphp-git-c49cd84da92c411d9cabce05d09c1a4a345b6c04.tar.gz
make timelib independent from zend_long
Diffstat (limited to 'ext')
-rw-r--r--ext/date/lib/parse_date.c18
-rw-r--r--ext/date/lib/parse_date.re20
-rw-r--r--ext/date/lib/parse_iso_intervals.c120
-rw-r--r--ext/date/lib/parse_iso_intervals.re4
-rw-r--r--ext/date/lib/parse_tz.c12
-rw-r--r--ext/date/lib/timelib.c10
-rw-r--r--ext/date/lib/timelib.h11
-rw-r--r--ext/date/lib/timelib_structs.h18
8 files changed, 65 insertions, 148 deletions
diff --git a/ext/date/lib/parse_date.c b/ext/date/lib/parse_date.c
index ad9727d197..f1334e7826 100644
--- a/ext/date/lib/parse_date.c
+++ b/ext/date/lib/parse_date.c
@@ -566,11 +566,11 @@ static timelib_sll timelib_get_relative_text(char **ptr, int *behavior)
return timelib_lookup_relative_text(ptr, behavior);
}
-static long timelib_lookup_month(char **ptr)
+static timelib_long timelib_lookup_month(char **ptr)
{
char *word;
char *begin = *ptr, *end;
- long value = 0;
+ timelib_long value = 0;
const timelib_lookup_table *tp;
while ((**ptr >= 'A' && **ptr <= 'Z') || (**ptr >= 'a' && **ptr <= 'z')) {
@@ -590,7 +590,7 @@ static long timelib_lookup_month(char **ptr)
return value;
}
-static long timelib_get_month(char **ptr)
+static timelib_long timelib_get_month(char **ptr)
{
while (**ptr == ' ' || **ptr == '\t' || **ptr == '-' || **ptr == '.' || **ptr == '/') {
++*ptr;
@@ -670,7 +670,7 @@ static void timelib_set_relative(char **ptr, timelib_sll amount, int behavior, S
}
}
-const static timelib_tz_lookup_table* abbr_search(const char *word, long gmtoffset, int isdst)
+const static timelib_tz_lookup_table* abbr_search(const char *word, timelib_long gmtoffset, int isdst)
{
int first_found = 0;
const timelib_tz_lookup_table *tp, *first_found_elem = NULL;
@@ -708,11 +708,11 @@ const static timelib_tz_lookup_table* abbr_search(const char *word, long gmtoffs
return NULL;
}
-static long timelib_lookup_abbr(char **ptr, int *dst, char **tz_abbr, int *found)
+static timelib_long timelib_lookup_abbr(char **ptr, int *dst, char **tz_abbr, int *found)
{
char *word;
char *begin = *ptr, *end;
- long value = 0;
+ timelib_long value = 0;
const timelib_tz_lookup_table *tp;
while (**ptr != '\0' && **ptr != ')' && **ptr != ' ') {
@@ -735,10 +735,10 @@ static long timelib_lookup_abbr(char **ptr, int *dst, char **tz_abbr, int *found
return value;
}
-long timelib_parse_zone(char **ptr, int *dst, timelib_time *t, int *tz_not_found, const timelib_tzdb *tzdb, timelib_tz_get_wrapper tz_wrapper)
+timelib_long timelib_parse_zone(char **ptr, int *dst, timelib_time *t, int *tz_not_found, const timelib_tzdb *tzdb, timelib_tz_get_wrapper tz_wrapper)
{
timelib_tzinfo *res;
- long retval = 0;
+ timelib_long retval = 0;
*tz_not_found = 0;
@@ -766,7 +766,7 @@ long timelib_parse_zone(char **ptr, int *dst, timelib_time *t, int *tz_not_found
retval = timelib_parse_tz_cor(ptr);
} else {
int found = 0;
- long offset = 0;
+ timelib_long offset = 0;
char *tz_abbr;
t->is_localtime = 1;
diff --git a/ext/date/lib/parse_date.re b/ext/date/lib/parse_date.re
index c7953e75ba..c5cb15f797 100644
--- a/ext/date/lib/parse_date.re
+++ b/ext/date/lib/parse_date.re
@@ -564,11 +564,11 @@ static timelib_sll timelib_get_relative_text(char **ptr, int *behavior)
return timelib_lookup_relative_text(ptr, behavior);
}
-static long timelib_lookup_month(char **ptr)
+static timelib_long timelib_lookup_month(char **ptr)
{
char *word;
char *begin = *ptr, *end;
- long value = 0;
+ timelib_long value = 0;
const timelib_lookup_table *tp;
while ((**ptr >= 'A' && **ptr <= 'Z') || (**ptr >= 'a' && **ptr <= 'z')) {
@@ -588,7 +588,7 @@ static long timelib_lookup_month(char **ptr)
return value;
}
-static long timelib_get_month(char **ptr)
+static timelib_long timelib_get_month(char **ptr)
{
while (**ptr == ' ' || **ptr == '\t' || **ptr == '-' || **ptr == '.' || **ptr == '/') {
++*ptr;
@@ -668,7 +668,7 @@ static void timelib_set_relative(char **ptr, timelib_sll amount, int behavior, S
}
}
-const static timelib_tz_lookup_table* abbr_search(const char *word, long gmtoffset, int isdst)
+const static timelib_tz_lookup_table* abbr_search(const char *word, timelib_long gmtoffset, int isdst)
{
int first_found = 0;
const timelib_tz_lookup_table *tp, *first_found_elem = NULL;
@@ -706,11 +706,11 @@ const static timelib_tz_lookup_table* abbr_search(const char *word, long gmtoffs
return NULL;
}
-static long timelib_lookup_abbr(char **ptr, int *dst, char **tz_abbr, int *found)
+static timelib_long timelib_lookup_abbr(char **ptr, int *dst, char **tz_abbr, int *found)
{
char *word;
char *begin = *ptr, *end;
- long value = 0;
+ timelib_long value = 0;
const timelib_tz_lookup_table *tp;
while (**ptr != '\0' && **ptr != ')' && **ptr != ' ') {
@@ -733,10 +733,10 @@ static long timelib_lookup_abbr(char **ptr, int *dst, char **tz_abbr, int *found
return value;
}
-long timelib_parse_zone(char **ptr, int *dst, timelib_time *t, int *tz_not_found, const timelib_tzdb *tzdb, timelib_tz_get_wrapper tz_wrapper)
+timelib_long timelib_parse_zone(char **ptr, int *dst, timelib_time *t, int *tz_not_found, const timelib_tzdb *tzdb, timelib_tz_get_wrapper tz_wrapper)
{
timelib_tzinfo *res;
- long retval = 0;
+ timelib_long retval = 0;
*tz_not_found = 0;
@@ -764,7 +764,7 @@ long timelib_parse_zone(char **ptr, int *dst, timelib_time *t, int *tz_not_found
retval = timelib_parse_tz_cor(ptr);
} else {
int found = 0;
- long offset = 0;
+ timelib_long offset = 0;
char *tz_abbr;
t->is_localtime = 1;
@@ -2202,7 +2202,7 @@ void timelib_fill_holes(timelib_time *parsed, timelib_time *now, int options)
*/
}
-char *timelib_timezone_id_from_abbr(const char *abbr, long gmtoffset, int isdst)
+char *timelib_timezone_id_from_abbr(const char *abbr, timelib_long gmtoffset, int isdst)
{
const timelib_tz_lookup_table *tp;
diff --git a/ext/date/lib/parse_iso_intervals.c b/ext/date/lib/parse_iso_intervals.c
index c14a07465a..5362589a6a 100644
--- a/ext/date/lib/parse_iso_intervals.c
+++ b/ext/date/lib/parse_iso_intervals.c
@@ -1,4 +1,4 @@
-/* Generated by re2c 0.13.5 on Wed Nov 27 11:14:23 2013 */
+/* Generated by re2c 0.13.5 */
#line 1 "ext/date/lib/parse_iso_intervals.re"
/*
+----------------------------------------------------------------------+
@@ -190,9 +190,9 @@ static void timelib_eat_until_separator(char **ptr)
}
}
-static long timelib_get_zone(char **ptr, int *dst, timelib_time *t, int *tz_not_found, const timelib_tzdb *tzdb)
+static timelib_long timelib_get_zone(char **ptr, int *dst, timelib_time *t, int *tz_not_found, const timelib_tzdb *tzdb)
{
- long retval = 0;
+ timelib_long retval = 0;
*tz_not_found = 0;
@@ -291,7 +291,6 @@ std:
0, 0, 0, 0, 0, 0, 0, 0,
};
- YYDEBUG(0, *YYCURSOR);
if ((YYLIMIT - YYCURSOR) < 20) YYFILL(20);
yych = *YYCURSOR;
if (yych <= ',') {
@@ -316,34 +315,29 @@ std:
if (yych != 'R') goto yy11;
}
}
- YYDEBUG(2, *YYCURSOR);
++YYCURSOR;
if ((yych = *YYCURSOR) <= '/') goto yy3;
if (yych <= '9') goto yy98;
yy3:
- YYDEBUG(3, *YYCURSOR);
#line 389 "ext/date/lib/parse_iso_intervals.re"
{
add_error(s, "Unexpected character");
goto std;
}
-#line 331 "ext/date/lib/parse_iso_intervals.c"
+#line 328 "ext/date/lib/parse_iso_intervals.c"
yy4:
- YYDEBUG(4, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if (yych <= '/') goto yy3;
if (yych <= '9') goto yy59;
goto yy3;
yy5:
- YYDEBUG(5, *YYCURSOR);
yyaccept = 1;
yych = *(YYMARKER = ++YYCURSOR);
if (yych <= '/') goto yy6;
if (yych <= '9') goto yy12;
if (yych == 'T') goto yy14;
yy6:
- YYDEBUG(6, *YYCURSOR);
#line 316 "ext/date/lib/parse_iso_intervals.re"
{
timelib_sll nr;
@@ -385,32 +379,26 @@ yy6:
TIMELIB_DEINIT;
return TIMELIB_PERIOD;
}
-#line 389 "ext/date/lib/parse_iso_intervals.c"
+#line 383 "ext/date/lib/parse_iso_intervals.c"
yy7:
- YYDEBUG(7, *YYCURSOR);
++YYCURSOR;
- YYDEBUG(8, *YYCURSOR);
#line 378 "ext/date/lib/parse_iso_intervals.re"
{
goto std;
}
-#line 398 "ext/date/lib/parse_iso_intervals.c"
+#line 390 "ext/date/lib/parse_iso_intervals.c"
yy9:
- YYDEBUG(9, *YYCURSOR);
++YYCURSOR;
- YYDEBUG(10, *YYCURSOR);
#line 383 "ext/date/lib/parse_iso_intervals.re"
{
s->pos = cursor; s->line++;
goto std;
}
-#line 408 "ext/date/lib/parse_iso_intervals.c"
+#line 398 "ext/date/lib/parse_iso_intervals.c"
yy11:
- YYDEBUG(11, *YYCURSOR);
yych = *++YYCURSOR;
goto yy3;
yy12:
- YYDEBUG(12, *YYCURSOR);
yych = *++YYCURSOR;
if (yych <= 'L') {
if (yych <= '9') {
@@ -427,7 +415,6 @@ yy12:
}
}
yy13:
- YYDEBUG(13, *YYCURSOR);
YYCURSOR = YYMARKER;
if (yyaccept <= 0) {
goto yy3;
@@ -435,7 +422,6 @@ yy13:
goto yy6;
}
yy14:
- YYDEBUG(14, *YYCURSOR);
yyaccept = 1;
yych = *(YYMARKER = ++YYCURSOR);
if (yybm[0+yych] & 128) {
@@ -443,11 +429,9 @@ yy14:
}
goto yy6;
yy15:
- YYDEBUG(15, *YYCURSOR);
++YYCURSOR;
if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2);
yych = *YYCURSOR;
- YYDEBUG(16, *YYCURSOR);
if (yybm[0+yych] & 128) {
goto yy15;
}
@@ -459,28 +443,23 @@ yy15:
if (yych != 'S') goto yy13;
}
yy17:
- YYDEBUG(17, *YYCURSOR);
yych = *++YYCURSOR;
goto yy6;
yy18:
- YYDEBUG(18, *YYCURSOR);
yyaccept = 1;
yych = *(YYMARKER = ++YYCURSOR);
if (yych <= '/') goto yy6;
if (yych <= '9') goto yy22;
goto yy6;
yy19:
- YYDEBUG(19, *YYCURSOR);
yyaccept = 1;
yych = *(YYMARKER = ++YYCURSOR);
if (yych <= '/') goto yy6;
if (yych >= ':') goto yy6;
yy20:
- YYDEBUG(20, *YYCURSOR);
++YYCURSOR;
if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2);
yych = *YYCURSOR;
- YYDEBUG(21, *YYCURSOR);
if (yych <= 'L') {
if (yych <= '/') goto yy13;
if (yych <= '9') goto yy20;
@@ -491,22 +470,18 @@ yy20:
goto yy13;
}
yy22:
- YYDEBUG(22, *YYCURSOR);
++YYCURSOR;
if (YYLIMIT <= YYCURSOR) YYFILL(1);
yych = *YYCURSOR;
- YYDEBUG(23, *YYCURSOR);
if (yych <= '/') goto yy13;
if (yych <= '9') goto yy22;
if (yych == 'S') goto yy17;
goto yy13;
yy24:
- YYDEBUG(24, *YYCURSOR);
yych = *++YYCURSOR;
if (yych == 'T') goto yy14;
goto yy6;
yy25:
- YYDEBUG(25, *YYCURSOR);
yych = *++YYCURSOR;
if (yych <= 'L') {
if (yych <= '9') {
@@ -526,7 +501,6 @@ yy25:
}
}
yy26:
- YYDEBUG(26, *YYCURSOR);
yyaccept = 1;
yych = *(YYMARKER = ++YYCURSOR);
if (yych <= '/') goto yy6;
@@ -534,7 +508,6 @@ yy26:
if (yych == 'T') goto yy14;
goto yy6;
yy27:
- YYDEBUG(27, *YYCURSOR);
yyaccept = 1;
yych = *(YYMARKER = ++YYCURSOR);
if (yych <= '/') goto yy6;
@@ -542,7 +515,6 @@ yy27:
if (yych == 'T') goto yy14;
goto yy6;
yy28:
- YYDEBUG(28, *YYCURSOR);
yyaccept = 1;
yych = *(YYMARKER = ++YYCURSOR);
if (yych <= '/') goto yy6;
@@ -550,11 +522,9 @@ yy28:
if (yych == 'T') goto yy14;
goto yy6;
yy29:
- YYDEBUG(29, *YYCURSOR);
++YYCURSOR;
if ((YYLIMIT - YYCURSOR) < 3) YYFILL(3);
yych = *YYCURSOR;
- YYDEBUG(30, *YYCURSOR);
if (yych <= 'D') {
if (yych <= '/') goto yy13;
if (yych <= '9') goto yy29;
@@ -570,11 +540,9 @@ yy29:
}
}
yy31:
- YYDEBUG(31, *YYCURSOR);
++YYCURSOR;
if ((YYLIMIT - YYCURSOR) < 3) YYFILL(3);
yych = *YYCURSOR;
- YYDEBUG(32, *YYCURSOR);
if (yych <= 'C') {
if (yych <= '/') goto yy13;
if (yych <= '9') goto yy31;
@@ -585,17 +553,14 @@ yy31:
goto yy13;
}
yy33:
- YYDEBUG(33, *YYCURSOR);
++YYCURSOR;
if ((YYLIMIT - YYCURSOR) < 3) YYFILL(3);
yych = *YYCURSOR;
- YYDEBUG(34, *YYCURSOR);
if (yych <= '/') goto yy13;
if (yych <= '9') goto yy33;
if (yych == 'D') goto yy24;
goto yy13;
yy35:
- YYDEBUG(35, *YYCURSOR);
yych = *++YYCURSOR;
if (yych <= 'L') {
if (yych <= '9') {
@@ -614,22 +579,18 @@ yy35:
goto yy13;
}
}
- YYDEBUG(36, *YYCURSOR);
yych = *++YYCURSOR;
if (yych != '-') goto yy39;
- YYDEBUG(37, *YYCURSOR);
yych = *++YYCURSOR;
if (yych <= '/') goto yy13;
if (yych <= '0') goto yy40;
if (yych <= '1') goto yy41;
goto yy13;
yy38:
- YYDEBUG(38, *YYCURSOR);
++YYCURSOR;
if ((YYLIMIT - YYCURSOR) < 3) YYFILL(3);
yych = *YYCURSOR;
yy39:
- YYDEBUG(39, *YYCURSOR);
if (yych <= 'L') {
if (yych <= '9') {
if (yych <= '/') goto yy13;
@@ -649,21 +610,17 @@ yy39:
}
}
yy40:
- YYDEBUG(40, *YYCURSOR);
yych = *++YYCURSOR;
if (yych <= '/') goto yy13;
if (yych <= '9') goto yy42;
goto yy13;
yy41:
- YYDEBUG(41, *YYCURSOR);
yych = *++YYCURSOR;
if (yych <= '/') goto yy13;
if (yych >= '3') goto yy13;
yy42:
- YYDEBUG(42, *YYCURSOR);
yych = *++YYCURSOR;
if (yych != '-') goto yy13;
- YYDEBUG(43, *YYCURSOR);
yych = *++YYCURSOR;
if (yych <= '/') goto yy13;
if (yych <= '0') goto yy44;
@@ -671,69 +628,54 @@ yy42:
if (yych <= '3') goto yy46;
goto yy13;
yy44:
- YYDEBUG(44, *YYCURSOR);
yych = *++YYCURSOR;
if (yych <= '/') goto yy13;
if (yych <= '9') goto yy47;
goto yy13;
yy45:
- YYDEBUG(45, *YYCURSOR);
yych = *++YYCURSOR;
if (yych <= '/') goto yy13;
if (yych <= '9') goto yy47;
goto yy13;
yy46:
- YYDEBUG(46, *YYCURSOR);
yych = *++YYCURSOR;
if (yych <= '/') goto yy13;
if (yych >= '2') goto yy13;
yy47:
- YYDEBUG(47, *YYCURSOR);
yych = *++YYCURSOR;
if (yych != 'T') goto yy13;
- YYDEBUG(48, *YYCURSOR);
yych = *++YYCURSOR;
if (yych <= '/') goto yy13;
if (yych <= '1') goto yy49;
if (yych <= '2') goto yy50;
goto yy13;
yy49:
- YYDEBUG(49, *YYCURSOR);
yych = *++YYCURSOR;
if (yych <= '/') goto yy13;
if (yych <= '9') goto yy51;
goto yy13;
yy50:
- YYDEBUG(50, *YYCURSOR);
yych = *++YYCURSOR;
if (yych <= '/') goto yy13;
if (yych >= '5') goto yy13;
yy51:
- YYDEBUG(51, *YYCURSOR);
yych = *++YYCURSOR;
if (yych != ':') goto yy13;
- YYDEBUG(52, *YYCURSOR);
yych = *++YYCURSOR;
if (yych <= '/') goto yy13;
if (yych >= '6') goto yy13;
- YYDEBUG(53, *YYCURSOR);
yych = *++YYCURSOR;
if (yych <= '/') goto yy13;
if (yych >= ':') goto yy13;
- YYDEBUG(54, *YYCURSOR);
yych = *++YYCURSOR;
if (yych != ':') goto yy13;
- YYDEBUG(55, *YYCURSOR);
yych = *++YYCURSOR;
if (yych <= '/') goto yy13;
if (yych >= '6') goto yy13;
- YYDEBUG(56, *YYCURSOR);
yych = *++YYCURSOR;
if (yych <= '/') goto yy13;
if (yych >= ':') goto yy13;
- YYDEBUG(57, *YYCURSOR);
++YYCURSOR;
- YYDEBUG(58, *YYCURSOR);
#line 358 "ext/date/lib/parse_iso_intervals.re"
{
DEBUG_OUTPUT("combinedrep");
@@ -753,17 +695,14 @@ yy51:
TIMELIB_DEINIT;
return TIMELIB_PERIOD;
}
-#line 757 "ext/date/lib/parse_iso_intervals.c"
+#line 699 "ext/date/lib/parse_iso_intervals.c"
yy59:
- YYDEBUG(59, *YYCURSOR);
yych = *++YYCURSOR;
if (yych <= '/') goto yy13;
if (yych >= ':') goto yy13;
- YYDEBUG(60, *YYCURSOR);
yych = *++YYCURSOR;
if (yych <= '/') goto yy13;
if (yych >= ':') goto yy13;
- YYDEBUG(61, *YYCURSOR);
yych = *++YYCURSOR;
if (yych <= '/') {
if (yych == '-') goto yy64;
@@ -774,40 +713,33 @@ yy59:
goto yy13;
}
yy62:
- YYDEBUG(62, *YYCURSOR);
yych = *++YYCURSOR;
if (yych <= '0') goto yy13;
if (yych <= '9') goto yy85;
goto yy13;
yy63:
- YYDEBUG(63, *YYCURSOR);
yych = *++YYCURSOR;
if (yych <= '/') goto yy13;
if (yych <= '2') goto yy85;
goto yy13;
yy64:
- YYDEBUG(64, *YYCURSOR);
yych = *++YYCURSOR;
if (yych <= '/') goto yy13;
if (yych <= '0') goto yy65;
if (yych <= '1') goto yy66;
goto yy13;
yy65:
- YYDEBUG(65, *YYCURSOR);
yych = *++YYCURSOR;
if (yych <= '0') goto yy13;
if (yych <= '9') goto yy67;
goto yy13;
yy66:
- YYDEBUG(66, *YYCURSOR);
yych = *++YYCURSOR;
if (yych <= '/') goto yy13;
if (yych >= '3') goto yy13;
yy67:
- YYDEBUG(67, *YYCURSOR);
yych = *++YYCURSOR;
if (yych != '-') goto yy13;
- YYDEBUG(68, *YYCURSOR);
yych = *++YYCURSOR;
if (yych <= '/') goto yy13;
if (yych <= '0') goto yy69;
@@ -815,73 +747,57 @@ yy67:
if (yych <= '3') goto yy71;
goto yy13;
yy69:
- YYDEBUG(69, *YYCURSOR);
yych = *++YYCURSOR;
if (yych <= '0') goto yy13;
if (yych <= '9') goto yy72;
goto yy13;
yy70:
- YYDEBUG(70, *YYCURSOR);
yych = *++YYCURSOR;
if (yych <= '/') goto yy13;
if (yych <= '9') goto yy72;
goto yy13;
yy71:
- YYDEBUG(71, *YYCURSOR);
yych = *++YYCURSOR;
if (yych <= '/') goto yy13;
if (yych >= '2') goto yy13;
yy72:
- YYDEBUG(72, *YYCURSOR);
yych = *++YYCURSOR;
if (yych != 'T') goto yy13;
- YYDEBUG(73, *YYCURSOR);
yych = *++YYCURSOR;
if (yych <= '/') goto yy13;
if (yych <= '1') goto yy74;
if (yych <= '2') goto yy75;
goto yy13;
yy74:
- YYDEBUG(74, *YYCURSOR);
yych = *++YYCURSOR;
if (yych <= '/') goto yy13;
if (yych <= '9') goto yy76;
goto yy13;
yy75:
- YYDEBUG(75, *YYCURSOR);
yych = *++YYCURSOR;
if (yych <= '/') goto yy13;
if (yych >= '5') goto yy13;
yy76:
- YYDEBUG(76, *YYCURSOR);
yych = *++YYCURSOR;
if (yych != ':') goto yy13;
- YYDEBUG(77, *YYCURSOR);
yych = *++YYCURSOR;
if (yych <= '/') goto yy13;
if (yych >= '6') goto yy13;
- YYDEBUG(78, *YYCURSOR);
yych = *++YYCURSOR;
if (yych <= '/') goto yy13;
if (yych >= ':') goto yy13;
- YYDEBUG(79, *YYCURSOR);
yych = *++YYCURSOR;
if (yych != ':') goto yy13;
- YYDEBUG(80, *YYCURSOR);
yych = *++YYCURSOR;
if (yych <= '/') goto yy13;
if (yych >= '6') goto yy13;
- YYDEBUG(81, *YYCURSOR);
yych = *++YYCURSOR;
if (yych <= '/') goto yy13;
if (yych >= ':') goto yy13;
- YYDEBUG(82, *YYCURSOR);
yych = *++YYCURSOR;
if (yych != 'Z') goto yy13;
yy83:
- YYDEBUG(83, *YYCURSOR);
++YYCURSOR;
- YYDEBUG(84, *YYCURSOR);
#line 292 "ext/date/lib/parse_iso_intervals.re"
{
timelib_time *current;
@@ -905,9 +821,8 @@ yy83:
TIMELIB_DEINIT;
return TIMELIB_ISO_DATE;
}
-#line 909 "ext/date/lib/parse_iso_intervals.c"
+#line 825 "ext/date/lib/parse_iso_intervals.c"
yy85:
- YYDEBUG(85, *YYCURSOR);
yych = *++YYCURSOR;
if (yych <= '/') goto yy13;
if (yych <= '0') goto yy86;
@@ -915,74 +830,59 @@ yy85:
if (yych <= '3') goto yy88;
goto yy13;
yy86:
- YYDEBUG(86, *YYCURSOR);
yych = *++YYCURSOR;
if (yych <= '0') goto yy13;
if (yych <= '9') goto yy89;
goto yy13;
yy87:
- YYDEBUG(87, *YYCURSOR);
yych = *++YYCURSOR;
if (yych <= '/') goto yy13;
if (yych <= '9') goto yy89;
goto yy13;
yy88:
- YYDEBUG(88, *YYCURSOR);
yych = *++YYCURSOR;
if (yych <= '/') goto yy13;
if (yych >= '2') goto yy13;
yy89:
- YYDEBUG(89, *YYCURSOR);
yych = *++YYCURSOR;
if (yych != 'T') goto yy13;
- YYDEBUG(90, *YYCURSOR);
yych = *++YYCURSOR;
if (yych <= '/') goto yy13;
if (yych <= '1') goto yy91;
if (yych <= '2') goto yy92;
goto yy13;
yy91:
- YYDEBUG(91, *YYCURSOR);
yych = *++YYCURSOR;
if (yych <= '/') goto yy13;
if (yych <= '9') goto yy93;
goto yy13;
yy92:
- YYDEBUG(92, *YYCURSOR);
yych = *++YYCURSOR;
if (yych <= '/') goto yy13;
if (yych >= '5') goto yy13;
yy93:
- YYDEBUG(93, *YYCURSOR);
yych = *++YYCURSOR;
if (yych <= '/') goto yy13;
if (yych >= '6') goto yy13;
- YYDEBUG(94, *YYCURSOR);
yych = *++YYCURSOR;
if (yych <= '/') goto yy13;
if (yych >= ':') goto yy13;
- YYDEBUG(95, *YYCURSOR);
yych = *++YYCURSOR;
if (yych <= '/') goto yy13;
if (yych >= '6') goto yy13;
- YYDEBUG(96, *YYCURSOR);
yych = *++YYCURSOR;
if (yych <= '/') goto yy13;
if (yych >= ':') goto yy13;
- YYDEBUG(97, *YYCURSOR);
yych = *++YYCURSOR;
if (yych == 'Z') goto yy83;
goto yy13;
yy98:
- YYDEBUG(98, *YYCURSOR);
++YYCURSOR;
if (YYLIMIT <= YYCURSOR) YYFILL(1);
yych = *YYCURSOR;
- YYDEBUG(99, *YYCURSOR);
if (yych <= '/') goto yy100;
if (yych <= '9') goto yy98;
yy100:
- YYDEBUG(100, *YYCURSOR);
#line 281 "ext/date/lib/parse_iso_intervals.re"
{
DEBUG_OUTPUT("recurrences");
@@ -993,7 +893,7 @@ yy100:
s->have_recurrences = 1;
return TIMELIB_PERIOD;
}
-#line 997 "ext/date/lib/parse_iso_intervals.c"
+#line 897 "ext/date/lib/parse_iso_intervals.c"
}
#line 393 "ext/date/lib/parse_iso_intervals.re"
diff --git a/ext/date/lib/parse_iso_intervals.re b/ext/date/lib/parse_iso_intervals.re
index 8c82cfc3b9..efd822e84e 100644
--- a/ext/date/lib/parse_iso_intervals.re
+++ b/ext/date/lib/parse_iso_intervals.re
@@ -188,9 +188,9 @@ static void timelib_eat_until_separator(char **ptr)
}
}
-static long timelib_get_zone(char **ptr, int *dst, timelib_time *t, int *tz_not_found, const timelib_tzdb *tzdb)
+static timelib_long timelib_get_zone(char **ptr, int *dst, timelib_time *t, int *tz_not_found, const timelib_tzdb *tzdb)
{
- long retval = 0;
+ timelib_long retval = 0;
*tz_not_found = 0;
diff --git a/ext/date/lib/parse_tz.c b/ext/date/lib/parse_tz.c
index 5d2aec9c93..e7a31dd142 100644
--- a/ext/date/lib/parse_tz.c
+++ b/ext/date/lib/parse_tz.c
@@ -221,12 +221,12 @@ void timelib_dump_tzinfo(timelib_tzinfo *tz)
printf("Geo Location: %f,%f\n", tz->location.latitude, tz->location.longitude);
printf("Comments:\n%s\n", tz->location.comments);
printf("BC: %s\n", tz->bc ? "" : "yes");
- printf("UTC/Local count: %lu\n", (unsigned long) tz->ttisgmtcnt);
- printf("Std/Wall count: %lu\n", (unsigned long) tz->ttisstdcnt);
- printf("Leap.sec. count: %lu\n", (unsigned long) tz->leapcnt);
- printf("Trans. count: %lu\n", (unsigned long) tz->timecnt);
- printf("Local types count: %lu\n", (unsigned long) tz->typecnt);
- printf("Zone Abbr. count: %lu\n", (unsigned long) tz->charcnt);
+ printf("UTC/Local count: " TIMELIB_ULONG_FMT "\n", (timelib_ulong) tz->ttisgmtcnt);
+ printf("Std/Wall count: " TIMELIB_ULONG_FMT "\n", (timelib_ulong) tz->ttisstdcnt);
+ printf("Leap.sec. count: " TIMELIB_ULONG_FMT "\n", (timelib_ulong) tz->leapcnt);
+ printf("Trans. count: " TIMELIB_ULONG_FMT "\n", (timelib_ulong) tz->timecnt);
+ printf("Local types count: " TIMELIB_ULONG_FMT "\n", (timelib_ulong) tz->typecnt);
+ printf("Zone Abbr. count: " TIMELIB_ULONG_FMT "\n", (timelib_ulong) tz->charcnt);
printf ("%8s (%12s) = %3d [%5ld %1d %3d '%s' (%d,%d)]\n",
"", "", 0,
diff --git a/ext/date/lib/timelib.c b/ext/date/lib/timelib.c
index 65029e7d1c..716975a90f 100644
--- a/ext/date/lib/timelib.c
+++ b/ext/date/lib/timelib.c
@@ -176,13 +176,13 @@ void timelib_error_container_dtor(timelib_error_container *errors)
free(errors);
}
-zend_long timelib_date_to_int(timelib_time *d, int *error)
+timelib_long timelib_date_to_int(timelib_time *d, int *error)
{
timelib_sll ts;
ts = d->sse;
- if (ts < ZEND_LONG_MIN || ts > ZEND_LONG_MAX) {
+ if (ts < TIMELIB_LONG_MIN || ts > TIMELIB_LONG_MAX) {
if (error) {
*error = 1;
}
@@ -191,7 +191,7 @@ zend_long timelib_date_to_int(timelib_time *d, int *error)
if (error) {
*error = 0;
}
- return (zend_long) d->sse;
+ return (timelib_long) d->sse;
}
void timelib_decimal_hour_to_hms(double h, int *hour, int *min, int *sec)
@@ -286,10 +286,10 @@ void timelib_dump_rel_time(timelib_rel_time *d)
printf("\n");
}
-long timelib_parse_tz_cor(char **ptr)
+timelib_long timelib_parse_tz_cor(char **ptr)
{
char *begin = *ptr, *end;
- long tmp;
+ timelib_long tmp;
while (isdigit(**ptr) || **ptr == ':') {
++*ptr;
diff --git a/ext/date/lib/timelib.h b/ext/date/lib/timelib.h
index 1185dbfe5c..89c9dcbc2d 100644
--- a/ext/date/lib/timelib.h
+++ b/ext/date/lib/timelib.h
@@ -21,7 +21,6 @@
#ifndef __TIMELIB_H__
#define __TIMELIB_H__
-#include "php.h" /* for zend_long */
#include "timelib_structs.h"
#if HAVE_LIMITS_H
#include <limits.h>
@@ -72,9 +71,9 @@ int timelib_valid_date(timelib_sll y, timelib_sll m, timelib_sll d);
timelib_time *timelib_strtotime(char *s, int len, timelib_error_container **errors, const timelib_tzdb *tzdb, timelib_tz_get_wrapper tz_get_wrapper);
timelib_time *timelib_parse_from_format(char *format, char *s, int len, timelib_error_container **errors, const timelib_tzdb *tzdb, timelib_tz_get_wrapper tz_get_wrapper);
void timelib_fill_holes(timelib_time *parsed, timelib_time *now, int options);
-char *timelib_timezone_id_from_abbr(const char *abbr, long gmtoffset, int isdst);
+char *timelib_timezone_id_from_abbr(const char *abbr, timelib_long gmtoffset, int isdst);
const timelib_tz_lookup_table *timelib_timezone_abbreviations_list(void);
-long timelib_parse_tz_cor(char**);
+timelib_long timelib_parse_tz_cor(char**);
/* From parse_iso_intervals.re */
void timelib_strtointerval(char *s, int len,
@@ -106,7 +105,7 @@ timelib_sll timelib_get_current_offset(timelib_time *t);
void timelib_dump_tzinfo(timelib_tzinfo *tz);
const timelib_tzdb *timelib_builtin_db(void);
const timelib_tzdb_index_entry *timelib_timezone_builtin_identifiers_list(int *count);
-long timelib_parse_zone(char **ptr, int *dst, timelib_time *t, int *tz_not_found, const timelib_tzdb *tzdb, timelib_tz_get_wrapper tz_wrapper);
+timelib_long timelib_parse_zone(char **ptr, int *dst, timelib_time *t, int *tz_not_found, const timelib_tzdb *tzdb, timelib_tz_get_wrapper tz_wrapper);
/* From timelib.c */
timelib_tzinfo* timelib_tzinfo_ctor(char *name);
@@ -129,12 +128,12 @@ void timelib_time_offset_dtor(timelib_time_offset* t);
void timelib_error_container_dtor(timelib_error_container *errors);
-zend_long timelib_date_to_int(timelib_time *d, int *error);
+timelib_long timelib_date_to_int(timelib_time *d, int *error);
void timelib_dump_date(timelib_time *d, int options);
void timelib_dump_rel_time(timelib_rel_time *d);
void timelib_decimal_hour_to_hms(double h, int *hour, int *min, int *sec);
-long timelib_parse_tz_cor(char **ptr);
+timelib_long timelib_parse_tz_cor(char **ptr);
/* from astro.c */
double timelib_ts_to_juliandate(timelib_sll ts);
diff --git a/ext/date/lib/timelib_structs.h b/ext/date/lib/timelib_structs.h
index 5033321356..15698c6f80 100644
--- a/ext/date/lib/timelib_structs.h
+++ b/ext/date/lib/timelib_structs.h
@@ -37,6 +37,24 @@
#include <strings.h>
#endif
+#if defined(__X86_64__) || defined(__LP64__) || defined(_LP64) || defined(_WIN64)
+typedef int64_t timelib_long;
+typedef uint64_t timelib_ulong;
+# define TIMELIB_LONG_MAX INT64_MAX
+# define TIMELIB_LONG_MIN INT64_MIN
+# define TIMELIB_ULONG_MAX UINT64_MAX
+# define TIMELIB_LONG_FMT "%" PRId64
+# define TIMELIB_ULONG_FMT "%" PRIu64
+#else
+typedef int32_t timelib_long;
+typedef uint32_t limelib_ulong;
+# define TIMELIB_LONG_MAX INT32_MAX
+# define TIMELIB_LONG_MIN INT32_MIN
+# define TIMELIB_ULONG_MAX UINT32_MAX
+# define TIMELIB_LONG_FMT "%" PRId32
+# define TIMELIB_ULONG_FMT "%" PRIu32
+#endif
+
#if defined(_MSC_VER)
typedef uint64_t timelib_ull;
typedef int64_t timelib_sll;