diff options
Diffstat (limited to 'ext/intl/timezone/timezone_methods.cpp')
-rw-r--r-- | ext/intl/timezone/timezone_methods.cpp | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/ext/intl/timezone/timezone_methods.cpp b/ext/intl/timezone/timezone_methods.cpp index a8332dbf7e..530e6c5bed 100644 --- a/ext/intl/timezone/timezone_methods.cpp +++ b/ext/intl/timezone/timezone_methods.cpp @@ -47,7 +47,7 @@ U_CFUNC PHP_METHOD(IntlTimeZone, __construct) U_CFUNC PHP_FUNCTION(intltz_create_time_zone) { char *str_id; - int str_id_len; + size_t str_id_len; intl_error_reset(NULL TSRMLS_CC); if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", @@ -161,8 +161,8 @@ U_CFUNC PHP_FUNCTION(intltz_create_enumeration) se = TimeZone::createEnumeration(); } else if (Z_TYPE_P(arg) == IS_LONG) { int_offset: - if (Z_LVAL_P(arg) < (long)INT32_MIN || - Z_LVAL_P(arg) > (long)INT32_MAX) { + if (Z_LVAL_P(arg) < (zend_long)INT32_MIN || + Z_LVAL_P(arg) > (zend_long)INT32_MAX) { intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, "intltz_create_enumeration: value is out of range", 0 TSRMLS_CC); RETURN_FALSE; @@ -174,7 +174,7 @@ double_offset: convert_to_long_ex(arg); goto int_offset; } else if (Z_TYPE_P(arg) == IS_OBJECT || Z_TYPE_P(arg) == IS_STRING) { - long lval; + zend_long lval; double dval; convert_to_string_ex(arg); switch (is_numeric_string(Z_STRVAL_P(arg), Z_STRLEN_P(arg), &lval, &dval, 0)) { @@ -209,7 +209,7 @@ double_offset: U_CFUNC PHP_FUNCTION(intltz_count_equivalent_ids) { char *str_id; - int str_id_len; + size_t str_id_len; intl_error_reset(NULL TSRMLS_CC); if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", @@ -228,16 +228,16 @@ U_CFUNC PHP_FUNCTION(intltz_count_equivalent_ids) } int32_t result = TimeZone::countEquivalentIDs(id); - RETURN_LONG((long)result); + RETURN_LONG((zend_long)result); } #if U_ICU_VERSION_MAJOR_NUM * 10 + U_ICU_VERSION_MINOR_NUM >= 48 U_CFUNC PHP_FUNCTION(intltz_create_time_zone_id_enumeration) { - long zoneType, + zend_long zoneType, offset_arg; char *region = NULL; - int region_len = 0; + size_t region_len = 0; int32_t offset, *offsetp = NULL; int arg3isnull = 0; @@ -265,7 +265,7 @@ U_CFUNC PHP_FUNCTION(intltz_create_time_zone_id_enumeration) } if (ZEND_NUM_ARGS() == 3) { - if (offset_arg < (long)INT32_MIN || offset_arg > (long)INT32_MAX) { + if (offset_arg < (zend_long)INT32_MIN || offset_arg > (zend_long)INT32_MAX) { intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, "intltz_create_time_zone_id_enumeration: offset out of bounds", 0 TSRMLS_CC); RETURN_FALSE; @@ -291,7 +291,7 @@ U_CFUNC PHP_FUNCTION(intltz_create_time_zone_id_enumeration) U_CFUNC PHP_FUNCTION(intltz_get_canonical_id) { char *str_id; - int str_id_len; + size_t str_id_len; zval *is_systemid = NULL; intl_error_reset(NULL TSRMLS_CC); @@ -335,7 +335,7 @@ U_CFUNC PHP_FUNCTION(intltz_get_canonical_id) U_CFUNC PHP_FUNCTION(intltz_get_region) { char *str_id; - int str_id_len; + size_t str_id_len; char outbuf[3]; intl_error_reset(NULL TSRMLS_CC); @@ -382,13 +382,13 @@ U_CFUNC PHP_FUNCTION(intltz_get_tz_data_version) U_CFUNC PHP_FUNCTION(intltz_get_equivalent_id) { char *str_id; - int str_id_len; - long index; + size_t str_id_len; + zend_long index; intl_error_reset(NULL TSRMLS_CC); if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sl", &str_id, &str_id_len, &index) == FAILURE || - index < (long)INT32_MIN || index > (long)INT32_MAX) { + index < (zend_long)INT32_MIN || index > (zend_long)INT32_MAX) { intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, "intltz_get_equivalent_id: bad arguments", 0 TSRMLS_CC); RETURN_FALSE; @@ -545,9 +545,9 @@ static const TimeZone::EDisplayType display_types[] = { U_CFUNC PHP_FUNCTION(intltz_get_display_name) { zend_bool daylight = 0; - long display_type = TimeZone::LONG; + zend_long display_type = TimeZone::LONG; const char *locale_str = NULL; - int dummy = 0; + size_t dummy = 0; TIMEZONE_METHOD_INIT_VARS; if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), @@ -603,7 +603,7 @@ U_CFUNC PHP_FUNCTION(intltz_get_dst_savings) TIMEZONE_METHOD_FETCH_OBJECT; - RETURN_LONG((long)to->utimezone->getDSTSavings()); + RETURN_LONG((zend_long)to->utimezone->getDSTSavings()); } U_CFUNC PHP_FUNCTION(intltz_to_date_time_zone) @@ -646,7 +646,7 @@ U_CFUNC PHP_FUNCTION(intltz_get_error_code) if (to == NULL) RETURN_FALSE; - RETURN_LONG((long)TIMEZONE_ERROR_CODE(to)); + RETURN_LONG((zend_long)TIMEZONE_ERROR_CODE(to)); } U_CFUNC PHP_FUNCTION(intltz_get_error_message) |