com php-src: fix datatype mismatches: ext/date/lib/parse_date .c ext/date/lib/parse_date.re ext/date/lib/parse_is o_intervals.c
ext/date/lib/parse_iso_intervals.re ext/date/lib/timelib.h ext/date/php_date.c ext/dat e/php_date.h
| From: | Anatol Belski | Date: | Thu, 30 Oct 2014 19:06:51 +0000 |
| Subject: | com php-src: fix datatype mismatches: ext/date/lib/parse_date .c ext/date/lib/parse_date.re ext/date/lib/parse_is o_intervals.c ext/date/lib/parse_iso_intervals.re ext/date/lib/timelib.h ext/date/php_date.c ext/dat e/php_date.h |
||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-82904@lists.php.net to get a copy of this message | ||
Commit: b0499545ee863c5173c82fe5e3e9b5289db13bf0
Author: Anatol Belski <ab@php.net> Thu, 30 Oct 2014 18:37:56 +0100
Parents: c7fa02948792a302c70e7530ee1058d6d3abefe6
Branches: master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=b0499545ee863c5173c82fe5e3e9b5289db13bf0
Log:
fix datatype mismatches
Changed paths:
M ext/date/lib/parse_date.c
M ext/date/lib/parse_date.re
M ext/date/lib/parse_iso_intervals.c
M ext/date/lib/parse_iso_intervals.re
M ext/date/lib/timelib.h
M ext/date/php_date.c
M ext/date/php_date.h
diff --git a/ext/date/lib/parse_date.c b/ext/date/lib/parse_date.c index 2a61555..f9872a5 100644 --- a/ext/date/lib/parse_date.c +++ b/ext/date/lib/parse_date.c @@ -1,4 +1,4 @@ -/* Generated by re2c 0.13.5 on Tue Aug 26 10:40:19 2014 */ +/* Generated by re2c 0.13.5 on Thu Oct 30 18:16:16 2014 */ #line 1 "ext/date/lib/parse_date.re" /* +----------------------------------------------------------------------+ @@ -24712,7 +24712,7 @@ yy1537: #define YYMAXFILL 31 -timelib_time* timelib_strtotime(char *s, int len, struct timelib_error_container **errors, const timelib_tzdb *tzdb, timelib_tz_get_wrapper tz_get_wrapper) +timelib_time* timelib_strtotime(char *s, size_t len, struct timelib_error_container **errors, const timelib_tzdb *tzdb, timelib_tz_get_wrapper tz_get_wrapper) { Scanner in; int t; @@ -24823,7 +24823,7 @@ static void timelib_time_reset_unset_fields(timelib_time *time) if (time->f == TIMELIB_UNSET ) time->f = 0.0; } -timelib_time *timelib_parse_from_format(char *format, char *string, 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 *string, size_t len, timelib_error_container **errors, const timelib_tzdb *tzdb, timelib_tz_get_wrapper tz_get_wrapper) { char *fptr = format; char *ptr = string; diff --git a/ext/date/lib/parse_date.re b/ext/date/lib/parse_date.re index cb5df16..7c4d143 100644 --- a/ext/date/lib/parse_date.re +++ b/ext/date/lib/parse_date.re @@ -1721,7 +1721,7 @@ weekdayof = (reltextnumber|reltexttext) space (dayfull|dayabbr) space 'of /*!max:re2c */ -timelib_time* timelib_strtotime(char *s, int len, struct timelib_error_container **errors, const timelib_tzdb *tzdb, timelib_tz_get_wrapper tz_get_wrapper) +timelib_time* timelib_strtotime(char *s, size_t len, struct timelib_error_container **errors, const timelib_tzdb *tzdb, timelib_tz_get_wrapper tz_get_wrapper) { Scanner in; int t; @@ -1832,7 +1832,7 @@ static void timelib_time_reset_unset_fields(timelib_time *time) if (time->f == TIMELIB_UNSET ) time->f = 0.0; } -timelib_time *timelib_parse_from_format(char *format, char *string, 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 *string, size_t len, timelib_error_container **errors, const timelib_tzdb *tzdb, timelib_tz_get_wrapper tz_get_wrapper) { char *fptr = format; char *ptr = string; diff --git a/ext/date/lib/parse_iso_intervals.c b/ext/date/lib/parse_iso_intervals.c index 3b7580f..ffa33b0 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 Tue Aug 26 10:39:58 2014 */ +/* Generated by re2c 0.13.5 on Thu Oct 30 18:20:16 2014 */ #line 1 "ext/date/lib/parse_iso_intervals.re" /* +----------------------------------------------------------------------+ @@ -1004,7 +1004,7 @@ yy100: #define YYMAXFILL 20 -void timelib_strtointerval(char *s, int len, +void timelib_strtointerval(char *s, size_t len, timelib_time **begin, timelib_time **end, timelib_rel_time **period, int *recurrences, struct timelib_error_container **errors) diff --git a/ext/date/lib/parse_iso_intervals.re b/ext/date/lib/parse_iso_intervals.re index 097488e..b400522 100644 --- a/ext/date/lib/parse_iso_intervals.re +++ b/ext/date/lib/parse_iso_intervals.re @@ -398,7 +398,7 @@ isoweek = year4 "-"? "W" weekofyear; /*!max:re2c */ -void timelib_strtointerval(char *s, int len, +void timelib_strtointerval(char *s, size_t len, timelib_time **begin, timelib_time **end, timelib_rel_time **period, int *recurrences, struct timelib_error_container **errors) diff --git a/ext/date/lib/timelib.h b/ext/date/lib/timelib.h index b7c4988..552ec39 100644 --- a/ext/date/lib/timelib.h +++ b/ext/date/lib/timelib.h @@ -68,15 +68,15 @@ int timelib_valid_time(timelib_sll h, timelib_sll i, timelib_sll s); int timelib_valid_date(timelib_sll y, timelib_sll m, timelib_sll d); /* From parse_date.re */ -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); +timelib_time *timelib_strtotime(char *s, size_t 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, size_t 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, timelib_long gmtoffset, int isdst); const timelib_tz_lookup_table *timelib_timezone_abbreviations_list(void); timelib_long timelib_parse_tz_cor(char**); /* From parse_iso_intervals.re */ -void timelib_strtointerval(char *s, int len, +void timelib_strtointerval(char *s, size_t len, timelib_time **begin, timelib_time **end, timelib_rel_time **period, int *recurrences, struct timelib_error_container **errors); diff --git a/ext/date/php_date.c b/ext/date/php_date.c index f2ced7b..6146dec 100644 --- a/ext/date/php_date.c +++ b/ext/date/php_date.c @@ -1230,7 +1230,7 @@ static void php_date(INTERNAL_FUNCTION_PARAMETERS, int localtime) } /* }}} */ -PHPAPI zend_string *php_format_date(char *format, int format_len, time_t ts, int localtime TSRMLS_DC) /* {{{ */ +PHPAPI zend_string *php_format_date(char *format, size_t format_len, time_t ts, int localtime TSRMLS_DC) /* {{{ */ { timelib_time *t; timelib_tzinfo *tzi; @@ -3031,7 +3031,7 @@ PHP_FUNCTION(date_format) } /* }}} */ -static int php_date_modify(zval *object, char *modify, int modify_len TSRMLS_DC) /* {{{ */ +static int php_date_modify(zval *object, char *modify, size_t modify_len TSRMLS_DC) /* {{{ */ { php_date_obj *dateobj; timelib_time *tmp_time; @@ -3938,7 +3938,7 @@ PHP_FUNCTION(timezone_location_get) } /* }}} */ -static int date_interval_initialize(timelib_rel_time **rt, /*const*/ char *format, int format_length TSRMLS_DC) /* {{{ */ +static int date_interval_initialize(timelib_rel_time **rt, /*const*/ char *format, size_t format_length TSRMLS_DC) /* {{{ */ { timelib_time *b = NULL, *e = NULL; timelib_rel_time *p = NULL; @@ -4221,7 +4221,7 @@ PHP_FUNCTION(date_interval_create_from_date_string) /* }}} */ /* {{{ date_interval_format - */ -static zend_string *date_interval_format(char *format, int format_len, timelib_rel_time *t TSRMLS_DC) +static zend_string *date_interval_format(char *format, size_t format_len, timelib_rel_time *t TSRMLS_DC) { smart_str string = {0}; int i, length, have_format_spec = 0; @@ -4302,7 +4302,7 @@ PHP_FUNCTION(date_interval_format) } /* }}} */ -static int date_period_initialize(timelib_time **st, timelib_time **et, timelib_rel_time **d, zend_long *recurrences, /*const*/ char *format, int format_length TSRMLS_DC) /* {{{ */ +static int date_period_initialize(timelib_time **st, timelib_time **et, timelib_rel_time **d, zend_long *recurrences, /*const*/ char *format, size_t format_length TSRMLS_DC) /* {{{ */ { timelib_time *b = NULL, *e = NULL; timelib_rel_time *p = NULL; diff --git a/ext/date/php_date.h b/ext/date/php_date.h index aa46aa1..ebbf9a9 100644 --- a/ext/date/php_date.h +++ b/ext/date/php_date.h @@ -210,7 +210,7 @@ PHPAPI int php_idate(char format, time_t ts, int localtime TSRMLS_DC); #define _php_strftime php_strftime PHPAPI void php_strftime(INTERNAL_FUNCTION_PARAMETERS, int gm); #endif -PHPAPI zend_string *php_format_date(char *format, int format_len, time_t ts, int localtime TSRMLS_DC); +PHPAPI zend_string *php_format_date(char *format, size_t format_len, time_t ts, int localtime TSRMLS_DC); /* Mechanism to set new TZ database */ PHPAPI void php_date_set_tzdb(timelib_tzdb *tzdb);
diff --git a/ext/date/lib/parse_date.c b/ext/date/lib/parse_date.c index 2a61555..f9872a5 100644 --- a/ext/date/lib/parse_date.c +++ b/ext/date/lib/parse_date.c @@ -1,4 +1,4 @@ -/* Generated by re2c 0.13.5 on Tue Aug 26 10:40:19 2014 */ +/* Generated by re2c 0.13.5 on Thu Oct 30 18:16:16 2014 */ #line 1 "ext/date/lib/parse_date.re" /* +----------------------------------------------------------------------+ @@ -24712,7 +24712,7 @@ yy1537: #define YYMAXFILL 31 -timelib_time* timelib_strtotime(char *s, int len, struct timelib_error_container **errors, const timelib_tzdb *tzdb, timelib_tz_get_wrapper tz_get_wrapper) +timelib_time* timelib_strtotime(char *s, size_t len, struct timelib_error_container **errors, const timelib_tzdb *tzdb, timelib_tz_get_wrapper tz_get_wrapper) { Scanner in; int t; @@ -24823,7 +24823,7 @@ static void timelib_time_reset_unset_fields(timelib_time *time) if (time->f == TIMELIB_UNSET ) time->f = 0.0; } -timelib_time *timelib_parse_from_format(char *format, char *string, 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 *string, size_t len, timelib_error_container **errors, const timelib_tzdb *tzdb, timelib_tz_get_wrapper tz_get_wrapper) { char *fptr = format; char *ptr = string; diff --git a/ext/date/lib/parse_date.re b/ext/date/lib/parse_date.re index cb5df16..7c4d143 100644 --- a/ext/date/lib/parse_date.re +++ b/ext/date/lib/parse_date.re @@ -1721,7 +1721,7 @@ weekdayof = (reltextnumber|reltexttext) space (dayfull|dayabbr) space 'of /*!max:re2c */ -timelib_time* timelib_strtotime(char *s, int len, struct timelib_error_container **errors, const timelib_tzdb *tzdb, timelib_tz_get_wrapper tz_get_wrapper) +timelib_time* timelib_strtotime(char *s, size_t len, struct timelib_error_container **errors, const timelib_tzdb *tzdb, timelib_tz_get_wrapper tz_get_wrapper) { Scanner in; int t; @@ -1832,7 +1832,7 @@ static void timelib_time_reset_unset_fields(timelib_time *time) if (time->f == TIMELIB_UNSET ) time->f = 0.0; } -timelib_time *timelib_parse_from_format(char *format, char *string, 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 *string, size_t len, timelib_error_container **errors, const timelib_tzdb *tzdb, timelib_tz_get_wrapper tz_get_wrapper) { char *fptr = format; char *ptr = string; diff --git a/ext/date/lib/parse_iso_intervals.c b/ext/date/lib/parse_iso_intervals.c index 3b7580f..ffa33b0 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 Tue Aug 26 10:39:58 2014 */ +/* Generated by re2c 0.13.5 on Thu Oct 30 18:20:16 2014 */ #line 1 "ext/date/lib/parse_iso_intervals.re" /* +----------------------------------------------------------------------+ @@ -1004,7 +1004,7 @@ yy100: #define YYMAXFILL 20 -void timelib_strtointerval(char *s, int len, +void timelib_strtointerval(char *s, size_t len, timelib_time **begin, timelib_time **end, timelib_rel_time **period, int *recurrences, struct timelib_error_container **errors) diff --git a/ext/date/lib/parse_iso_intervals.re b/ext/date/lib/parse_iso_intervals.re index 097488e..b400522 100644 --- a/ext/date/lib/parse_iso_intervals.re +++ b/ext/date/lib/parse_iso_intervals.re @@ -398,7 +398,7 @@ isoweek = year4 "-"? "W" weekofyear; /*!max:re2c */ -void timelib_strtointerval(char *s, int len, +void timelib_strtointerval(char *s, size_t len, timelib_time **begin, timelib_time **end, timelib_rel_time **period, int *recurrences, struct timelib_error_container **errors) diff --git a/ext/date/lib/timelib.h b/ext/date/lib/timelib.h index b7c4988..552ec39 100644 --- a/ext/date/lib/timelib.h +++ b/ext/date/lib/timelib.h @@ -68,15 +68,15 @@ int timelib_valid_time(timelib_sll h, timelib_sll i, timelib_sll s); int timelib_valid_date(timelib_sll y, timelib_sll m, timelib_sll d); /* From parse_date.re */ -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); +timelib_time *timelib_strtotime(char *s, size_t 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, size_t 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, timelib_long gmtoffset, int isdst); const timelib_tz_lookup_table *timelib_timezone_abbreviations_list(void); timelib_long timelib_parse_tz_cor(char**); /* From parse_iso_intervals.re */ -void timelib_strtointerval(char *s, int len, +void timelib_strtointerval(char *s, size_t len, timelib_time **begin, timelib_time **end, timelib_rel_time **period, int *recurrences, struct timelib_error_container **errors); diff --git a/ext/date/php_date.c b/ext/date/php_date.c index f2ced7b..6146dec 100644 --- a/ext/date/php_date.c +++ b/ext/date/php_date.c @@ -1230,7 +1230,7 @@ static void php_date(INTERNAL_FUNCTION_PARAMETERS, int localtime) } /* }}} */ -PHPAPI zend_string *php_format_date(char *format, int format_len, time_t ts, int localtime TSRMLS_DC) /* {{{ */ +PHPAPI zend_string *php_format_date(char *format, size_t format_len, time_t ts, int localtime TSRMLS_DC) /* {{{ */ { timelib_time *t; timelib_tzinfo *tzi; @@ -3031,7 +3031,7 @@ PHP_FUNCTION(date_format) } /* }}} */ -static int php_date_modify(zval *object, char *modify, int modify_len TSRMLS_DC) /* {{{ */ +static int php_date_modify(zval *object, char *modify, size_t modify_len TSRMLS_DC) /* {{{ */ { php_date_obj *dateobj; timelib_time *tmp_time; @@ -3938,7 +3938,7 @@ PHP_FUNCTION(timezone_location_get) } /* }}} */ -static int date_interval_initialize(timelib_rel_time **rt, /*const*/ char *format, int format_length TSRMLS_DC) /* {{{ */ +static int date_interval_initialize(timelib_rel_time **rt, /*const*/ char *format, size_t format_length TSRMLS_DC) /* {{{ */ { timelib_time *b = NULL, *e = NULL; timelib_rel_time *p = NULL; @@ -4221,7 +4221,7 @@ PHP_FUNCTION(date_interval_create_from_date_string) /* }}} */ /* {{{ date_interval_format - */ -static zend_string *date_interval_format(char *format, int format_len, timelib_rel_time *t TSRMLS_DC) +static zend_string *date_interval_format(char *format, size_t format_len, timelib_rel_time *t TSRMLS_DC) { smart_str string = {0}; int i, length, have_format_spec = 0; @@ -4302,7 +4302,7 @@ PHP_FUNCTION(date_interval_format) } /* }}} */ -static int date_period_initialize(timelib_time **st, timelib_time **et, timelib_rel_time **d, zend_long *recurrences, /*const*/ char *format, int format_length TSRMLS_DC) /* {{{ */ +static int date_period_initialize(timelib_time **st, timelib_time **et, timelib_rel_time **d, zend_long *recurrences, /*const*/ char *format, size_t format_length TSRMLS_DC) /* {{{ */ { timelib_time *b = NULL, *e = NULL; timelib_rel_time *p = NULL; diff --git a/ext/date/php_date.h b/ext/date/php_date.h index aa46aa1..ebbf9a9 100644 --- a/ext/date/php_date.h +++ b/ext/date/php_date.h @@ -210,7 +210,7 @@ PHPAPI int php_idate(char format, time_t ts, int localtime TSRMLS_DC); #define _php_strftime php_strftime PHPAPI void php_strftime(INTERNAL_FUNCTION_PARAMETERS, int gm); #endif -PHPAPI zend_string *php_format_date(char *format, int format_len, time_t ts, int localtime TSRMLS_DC); +PHPAPI zend_string *php_format_date(char *format, size_t format_len, time_t ts, int localtime TSRMLS_DC); /* Mechanism to set new TZ database */ PHPAPI void php_date_set_tzdb(timelib_tzdb *tzdb);