summaryrefslogtreecommitdiff
path: root/ext/intl/timezone/timezone_methods.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'ext/intl/timezone/timezone_methods.cpp')
-rw-r--r--ext/intl/timezone/timezone_methods.cpp43
1 files changed, 21 insertions, 22 deletions
diff --git a/ext/intl/timezone/timezone_methods.cpp b/ext/intl/timezone/timezone_methods.cpp
index 8a3c2cc7a8..053918ad04 100644
--- a/ext/intl/timezone/timezone_methods.cpp
+++ b/ext/intl/timezone/timezone_methods.cpp
@@ -47,11 +47,10 @@ U_CFUNC PHP_METHOD(IntlTimeZone, __construct)
U_CFUNC PHP_FUNCTION(intltz_create_time_zone)
{
char *str_id;
- size_t str_id_len;
+ size_t str_id_len;
intl_error_reset(NULL);
- if (zend_parse_parameters(ZEND_NUM_ARGS(), "s",
- &str_id, &str_id_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &str_id, &str_id_len) == FAILURE) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
"intltz_create_time_zone: bad arguments", 0);
RETURN_NULL();
@@ -209,7 +208,7 @@ double_offset:
U_CFUNC PHP_FUNCTION(intltz_count_equivalent_ids)
{
char *str_id;
- size_t str_id_len;
+ size_t str_id_len;
intl_error_reset(NULL);
if (zend_parse_parameters(ZEND_NUM_ARGS(), "s",
@@ -234,12 +233,12 @@ U_CFUNC PHP_FUNCTION(intltz_count_equivalent_ids)
#if U_ICU_VERSION_MAJOR_NUM * 10 + U_ICU_VERSION_MINOR_NUM >= 48
U_CFUNC PHP_FUNCTION(intltz_create_time_zone_id_enumeration)
{
- zend_long zoneType,
- offset_arg;
- char *region = NULL;
- size_t region_len = 0;
- int32_t offset,
- *offsetp = NULL;
+ zend_long zoneType,
+ offset_arg;
+ char *region = NULL;
+ size_t region_len = 0;
+ int32_t offset,
+ *offsetp = NULL;
zend_bool arg3isnull = 1;
intl_error_reset(NULL);
@@ -282,7 +281,7 @@ U_CFUNC PHP_FUNCTION(intltz_create_time_zone_id_enumeration)
U_CFUNC PHP_FUNCTION(intltz_get_canonical_id)
{
char *str_id;
- size_t str_id_len;
+ size_t str_id_len;
zval *is_systemid = NULL;
intl_error_reset(NULL);
@@ -307,7 +306,7 @@ U_CFUNC PHP_FUNCTION(intltz_get_canonical_id)
INTL_CHECK_STATUS(status, "intltz_get_canonical_id: error obtaining canonical ID");
char *str;
- int str_len;
+ size_t str_len;
intl_convert_utf16_to_utf8(&str, &str_len, result.getBuffer(), result.length(), &status);
INTL_CHECK_STATUS(status,
"intltz_get_canonical_id: could not convert time zone id to UTF-16");
@@ -326,8 +325,8 @@ U_CFUNC PHP_FUNCTION(intltz_get_canonical_id)
U_CFUNC PHP_FUNCTION(intltz_get_region)
{
char *str_id;
- size_t str_id_len;
- char outbuf[3];
+ size_t str_id_len;
+ char outbuf[3];
intl_error_reset(NULL);
if (zend_parse_parameters(ZEND_NUM_ARGS(), "s",
@@ -372,7 +371,7 @@ U_CFUNC PHP_FUNCTION(intltz_get_tz_data_version)
U_CFUNC PHP_FUNCTION(intltz_get_equivalent_id)
{
- char *str_id;
+ char *str_id;
size_t str_id_len;
zend_long index;
intl_error_reset(NULL);
@@ -395,7 +394,7 @@ U_CFUNC PHP_FUNCTION(intltz_get_equivalent_id)
const UnicodeString result = TimeZone::getEquivalentID(id, (int32_t)index);
char *str;
- int str_len;
+ size_t str_len;
intl_convert_utf16_to_utf8(&str, &str_len, result.getBuffer(), result.length(), &status);
INTL_CHECK_STATUS(status, "intltz_get_equivalent_id: "
@@ -421,8 +420,8 @@ U_CFUNC PHP_FUNCTION(intltz_get_id)
UnicodeString id_us;
to->utimezone->getID(id_us);
- char *id = NULL;
- int id_len = 0;
+ char *id = NULL;
+ size_t id_len = 0;
intl_convert_utf16_to_utf8(&id, &id_len,
id_us.getBuffer(), id_us.length(), TIMEZONE_ERROR_CODE_P(to));
@@ -536,9 +535,9 @@ static const TimeZone::EDisplayType display_types[] = {
U_CFUNC PHP_FUNCTION(intltz_get_display_name)
{
zend_bool daylight = 0;
- zend_long display_type = TimeZone::LONG;
- const char *locale_str = NULL;
- size_t dummy = 0;
+ zend_long display_type = TimeZone::LONG;
+ const char *locale_str = NULL;
+ size_t dummy = 0;
TIMEZONE_METHOD_INIT_VARS;
if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(),
@@ -571,7 +570,7 @@ U_CFUNC PHP_FUNCTION(intltz_get_display_name)
Locale::createFromName(locale_str), result);
char *str;
- int str_len;
+ size_t str_len;
intl_convert_utf16_to_utf8(&str, &str_len, result.getBuffer(), result.length(), TIMEZONE_ERROR_CODE_P(to));
INTL_METHOD_CHECK_STATUS(to, "intltz_get_display_name: "
"could not convert resulting time zone id to UTF-16");