summaryrefslogtreecommitdiff
path: root/ext/intl/timezone
diff options
context:
space:
mode:
authorAnatol Belski <ab@php.net>2014-08-19 08:07:31 +0200
committerAnatol Belski <ab@php.net>2014-08-19 08:07:31 +0200
commit63d3f0b844b3a5f1c94be3c97bca29235dc2b3fc (patch)
treee561a58d6e084c5e4cbdde1f84aed16cf4724383 /ext/intl/timezone
parent1e8273964fbd517a2eb9e560f9cdb4afffa0c034 (diff)
downloadphp-git-63d3f0b844b3a5f1c94be3c97bca29235dc2b3fc.tar.gz
basic macro replacements, all at once
Diffstat (limited to 'ext/intl/timezone')
-rw-r--r--ext/intl/timezone/timezone_class.cpp32
-rw-r--r--ext/intl/timezone/timezone_methods.cpp30
2 files changed, 31 insertions, 31 deletions
diff --git a/ext/intl/timezone/timezone_class.cpp b/ext/intl/timezone/timezone_class.cpp
index be30c2d541..6c5b27aa4e 100644
--- a/ext/intl/timezone/timezone_class.cpp
+++ b/ext/intl/timezone/timezone_class.cpp
@@ -180,7 +180,7 @@ U_CFUNC TimeZone *timezone_process_timezone_argument(zval *zv_timezone,
gottenId;
UErrorCode status = U_ZERO_ERROR; /* outside_error may be NULL */
convert_to_string_ex(zv_timezone);
- if (intl_stringFromChar(id, Z_STRVAL_P(zv_timezone), Z_STRLEN_P(zv_timezone),
+ if (intl_stringFromChar(id, Z_STRVAL_P(zv_timezone), Z_STRSIZE_P(zv_timezone),
&status) == FAILURE) {
spprintf(&message, 0, "%s: Time zone identifier given is not a "
"valid UTF-8 string", func);
@@ -331,9 +331,9 @@ static HashTable *TimeZone_get_debug_info(zval *object, int *is_temp TSRMLS_DC)
return debug_info;
}
- ZVAL_LONG(&zv, (long)rawOffset);
+ ZVAL_INT(&zv, (long)rawOffset);
zend_hash_str_update(debug_info,"rawOffset", sizeof("rawOffset") - 1, &zv);
- ZVAL_LONG(&zv, (long)(rawOffset + dstOffset));
+ ZVAL_INT(&zv, (long)(rawOffset + dstOffset));
zend_hash_str_update(debug_info,"currentOffset", sizeof("currentOffset") - 1, &zv);
return debug_info;
@@ -513,26 +513,26 @@ U_CFUNC void timezone_register_IntlTimeZone_class(TSRMLS_D)
/* Declare 'IntlTimeZone' class constants */
-#define TIMEZONE_DECL_LONG_CONST(name, val) \
- zend_declare_class_constant_long(TimeZone_ce_ptr, name, sizeof(name) - 1, \
+#define TIMEZONE_DECL_INT_CONST(name, val) \
+ zend_declare_class_constant_int(TimeZone_ce_ptr, name, sizeof(name) - 1, \
val TSRMLS_CC)
- TIMEZONE_DECL_LONG_CONST("DISPLAY_SHORT", TimeZone::SHORT);
- TIMEZONE_DECL_LONG_CONST("DISPLAY_LONG", TimeZone::LONG);
+ TIMEZONE_DECL_INT_CONST("DISPLAY_SHORT", TimeZone::SHORT);
+ TIMEZONE_DECL_INT_CONST("DISPLAY_LONG", TimeZone::LONG);
#if U_ICU_VERSION_MAJOR_NUM * 10 + U_ICU_VERSION_MINOR_NUM >= 44
- TIMEZONE_DECL_LONG_CONST("DISPLAY_SHORT_GENERIC", TimeZone::SHORT_GENERIC);
- TIMEZONE_DECL_LONG_CONST("DISPLAY_LONG_GENERIC", TimeZone::LONG_GENERIC);
- TIMEZONE_DECL_LONG_CONST("DISPLAY_SHORT_GMT", TimeZone::SHORT_GMT);
- TIMEZONE_DECL_LONG_CONST("DISPLAY_LONG_GMT", TimeZone::LONG_GMT);
- TIMEZONE_DECL_LONG_CONST("DISPLAY_SHORT_COMMONLY_USED", TimeZone::SHORT_COMMONLY_USED);
- TIMEZONE_DECL_LONG_CONST("DISPLAY_GENERIC_LOCATION", TimeZone::GENERIC_LOCATION);
+ TIMEZONE_DECL_INT_CONST("DISPLAY_SHORT_GENERIC", TimeZone::SHORT_GENERIC);
+ TIMEZONE_DECL_INT_CONST("DISPLAY_LONG_GENERIC", TimeZone::LONG_GENERIC);
+ TIMEZONE_DECL_INT_CONST("DISPLAY_SHORT_GMT", TimeZone::SHORT_GMT);
+ TIMEZONE_DECL_INT_CONST("DISPLAY_LONG_GMT", TimeZone::LONG_GMT);
+ TIMEZONE_DECL_INT_CONST("DISPLAY_SHORT_COMMONLY_USED", TimeZone::SHORT_COMMONLY_USED);
+ TIMEZONE_DECL_INT_CONST("DISPLAY_GENERIC_LOCATION", TimeZone::GENERIC_LOCATION);
#endif
#if U_ICU_VERSION_MAJOR_NUM * 10 + U_ICU_VERSION_MINOR_NUM >= 48
- TIMEZONE_DECL_LONG_CONST("TYPE_ANY", UCAL_ZONE_TYPE_ANY);
- TIMEZONE_DECL_LONG_CONST("TYPE_CANONICAL", UCAL_ZONE_TYPE_CANONICAL);
- TIMEZONE_DECL_LONG_CONST("TYPE_CANONICAL_LOCATION", UCAL_ZONE_TYPE_CANONICAL_LOCATION);
+ TIMEZONE_DECL_INT_CONST("TYPE_ANY", UCAL_ZONE_TYPE_ANY);
+ TIMEZONE_DECL_INT_CONST("TYPE_CANONICAL", UCAL_ZONE_TYPE_CANONICAL);
+ TIMEZONE_DECL_INT_CONST("TYPE_CANONICAL_LOCATION", UCAL_ZONE_TYPE_CANONICAL_LOCATION);
#endif
/* Declare 'IntlTimeZone' class properties */
diff --git a/ext/intl/timezone/timezone_methods.cpp b/ext/intl/timezone/timezone_methods.cpp
index a8332dbf7e..bff8dc803e 100644
--- a/ext/intl/timezone/timezone_methods.cpp
+++ b/ext/intl/timezone/timezone_methods.cpp
@@ -159,34 +159,34 @@ U_CFUNC PHP_FUNCTION(intltz_create_enumeration)
if (arg == NULL || Z_TYPE_P(arg) == IS_NULL) {
se = TimeZone::createEnumeration();
- } else if (Z_TYPE_P(arg) == IS_LONG) {
+ } else if (Z_TYPE_P(arg) == IS_INT) {
int_offset:
- if (Z_LVAL_P(arg) < (long)INT32_MIN ||
- Z_LVAL_P(arg) > (long)INT32_MAX) {
+ if (Z_IVAL_P(arg) < (long)INT32_MIN ||
+ Z_IVAL_P(arg) > (long)INT32_MAX) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
"intltz_create_enumeration: value is out of range", 0 TSRMLS_CC);
RETURN_FALSE;
} else {
- se = TimeZone::createEnumeration((int32_t) Z_LVAL_P(arg));
+ se = TimeZone::createEnumeration((int32_t) Z_IVAL_P(arg));
}
} else if (Z_TYPE_P(arg) == IS_DOUBLE) {
double_offset:
- convert_to_long_ex(arg);
+ convert_to_int_ex(arg);
goto int_offset;
} else if (Z_TYPE_P(arg) == IS_OBJECT || Z_TYPE_P(arg) == IS_STRING) {
- long lval;
+ php_int_t lval;
double dval;
convert_to_string_ex(arg);
- switch (is_numeric_string(Z_STRVAL_P(arg), Z_STRLEN_P(arg), &lval, &dval, 0)) {
+ switch (is_numeric_string(Z_STRVAL_P(arg), Z_STRSIZE_P(arg), &lval, &dval, 0)) {
case IS_DOUBLE:
SEPARATE_ZVAL(arg);
zval_dtor(arg);
ZVAL_DOUBLE(arg, dval);
goto double_offset;
- case IS_LONG:
+ case IS_INT:
SEPARATE_ZVAL(arg);
zval_dtor(arg);
- ZVAL_LONG(arg, lval);
+ ZVAL_INT(arg, lval);
goto int_offset;
}
/* else call string version */
@@ -228,7 +228,7 @@ U_CFUNC PHP_FUNCTION(intltz_count_equivalent_ids)
}
int32_t result = TimeZone::countEquivalentIDs(id);
- RETURN_LONG((long)result);
+ RETURN_INT((long)result);
}
#if U_ICU_VERSION_MAJOR_NUM * 10 + U_ICU_VERSION_MINOR_NUM >= 48
@@ -485,10 +485,10 @@ U_CFUNC PHP_FUNCTION(intltz_get_offset)
ZVAL_DEREF(rawOffsetArg);
zval_dtor(rawOffsetArg);
- ZVAL_LONG(rawOffsetArg, rawOffset);
+ ZVAL_INT(rawOffsetArg, rawOffset);
ZVAL_DEREF(dstOffsetArg);
zval_dtor(dstOffsetArg);
- ZVAL_LONG(dstOffsetArg, dstOffset);
+ ZVAL_INT(dstOffsetArg, dstOffset);
RETURN_TRUE;
}
@@ -506,7 +506,7 @@ U_CFUNC PHP_FUNCTION(intltz_get_raw_offset)
TIMEZONE_METHOD_FETCH_OBJECT;
- RETURN_LONG(to->utimezone->getRawOffset());
+ RETURN_INT(to->utimezone->getRawOffset());
}
U_CFUNC PHP_FUNCTION(intltz_has_same_rules)
@@ -603,7 +603,7 @@ U_CFUNC PHP_FUNCTION(intltz_get_dst_savings)
TIMEZONE_METHOD_FETCH_OBJECT;
- RETURN_LONG((long)to->utimezone->getDSTSavings());
+ RETURN_INT((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_INT((long)TIMEZONE_ERROR_CODE(to));
}
U_CFUNC PHP_FUNCTION(intltz_get_error_message)