diff options
| author | Anatol Belski <ab@php.net> | 2014-08-19 08:07:31 +0200 |
|---|---|---|
| committer | Anatol Belski <ab@php.net> | 2014-08-19 08:07:31 +0200 |
| commit | 63d3f0b844b3a5f1c94be3c97bca29235dc2b3fc (patch) | |
| tree | e561a58d6e084c5e4cbdde1f84aed16cf4724383 /ext/intl | |
| parent | 1e8273964fbd517a2eb9e560f9cdb4afffa0c034 (diff) | |
| download | php-git-63d3f0b844b3a5f1c94be3c97bca29235dc2b3fc.tar.gz | |
basic macro replacements, all at once
Diffstat (limited to 'ext/intl')
50 files changed, 341 insertions, 341 deletions
diff --git a/ext/intl/breakiterator/breakiterator_class.cpp b/ext/intl/breakiterator/breakiterator_class.cpp index 7aa1eae0bc..7c06af792c 100644 --- a/ext/intl/breakiterator/breakiterator_class.cpp +++ b/ext/intl/breakiterator/breakiterator_class.cpp @@ -338,36 +338,36 @@ U_CFUNC void breakiterator_register_BreakIterator_class(TSRMLS_D) zend_class_implements(BreakIterator_ce_ptr TSRMLS_CC, 1, zend_ce_traversable); - zend_declare_class_constant_long(BreakIterator_ce_ptr, + zend_declare_class_constant_int(BreakIterator_ce_ptr, "DONE", sizeof("DONE") - 1, BreakIterator::DONE TSRMLS_CC ); /* Declare constants that are defined in the C header */ -#define BREAKITER_DECL_LONG_CONST(name) \ - zend_declare_class_constant_long(BreakIterator_ce_ptr, #name, \ +#define BREAKITER_DECL_INT_CONST(name) \ + zend_declare_class_constant_int(BreakIterator_ce_ptr, #name, \ sizeof(#name) - 1, UBRK_ ## name TSRMLS_CC) - BREAKITER_DECL_LONG_CONST(WORD_NONE); - BREAKITER_DECL_LONG_CONST(WORD_NONE_LIMIT); - BREAKITER_DECL_LONG_CONST(WORD_NUMBER); - BREAKITER_DECL_LONG_CONST(WORD_NUMBER_LIMIT); - BREAKITER_DECL_LONG_CONST(WORD_LETTER); - BREAKITER_DECL_LONG_CONST(WORD_LETTER_LIMIT); - BREAKITER_DECL_LONG_CONST(WORD_KANA); - BREAKITER_DECL_LONG_CONST(WORD_KANA_LIMIT); - BREAKITER_DECL_LONG_CONST(WORD_IDEO); - BREAKITER_DECL_LONG_CONST(WORD_IDEO_LIMIT); - - BREAKITER_DECL_LONG_CONST(LINE_SOFT); - BREAKITER_DECL_LONG_CONST(LINE_SOFT_LIMIT); - BREAKITER_DECL_LONG_CONST(LINE_HARD); - BREAKITER_DECL_LONG_CONST(LINE_HARD_LIMIT); - - BREAKITER_DECL_LONG_CONST(SENTENCE_TERM); - BREAKITER_DECL_LONG_CONST(SENTENCE_TERM_LIMIT); - BREAKITER_DECL_LONG_CONST(SENTENCE_SEP); - BREAKITER_DECL_LONG_CONST(SENTENCE_SEP_LIMIT); - -#undef BREAKITER_DECL_LONG_CONST + BREAKITER_DECL_INT_CONST(WORD_NONE); + BREAKITER_DECL_INT_CONST(WORD_NONE_LIMIT); + BREAKITER_DECL_INT_CONST(WORD_NUMBER); + BREAKITER_DECL_INT_CONST(WORD_NUMBER_LIMIT); + BREAKITER_DECL_INT_CONST(WORD_LETTER); + BREAKITER_DECL_INT_CONST(WORD_LETTER_LIMIT); + BREAKITER_DECL_INT_CONST(WORD_KANA); + BREAKITER_DECL_INT_CONST(WORD_KANA_LIMIT); + BREAKITER_DECL_INT_CONST(WORD_IDEO); + BREAKITER_DECL_INT_CONST(WORD_IDEO_LIMIT); + + BREAKITER_DECL_INT_CONST(LINE_SOFT); + BREAKITER_DECL_INT_CONST(LINE_SOFT_LIMIT); + BREAKITER_DECL_INT_CONST(LINE_HARD); + BREAKITER_DECL_INT_CONST(LINE_HARD_LIMIT); + + BREAKITER_DECL_INT_CONST(SENTENCE_TERM); + BREAKITER_DECL_INT_CONST(SENTENCE_TERM_LIMIT); + BREAKITER_DECL_INT_CONST(SENTENCE_SEP); + BREAKITER_DECL_INT_CONST(SENTENCE_SEP_LIMIT); + +#undef BREAKITER_DECL_INT_CONST /* Create and register 'RuleBasedBreakIterator' class. */ diff --git a/ext/intl/breakiterator/breakiterator_iterators.cpp b/ext/intl/breakiterator/breakiterator_iterators.cpp index 7783235d8d..efd5c27811 100644 --- a/ext/intl/breakiterator/breakiterator_iterators.cpp +++ b/ext/intl/breakiterator/breakiterator_iterators.cpp @@ -67,7 +67,7 @@ static void _breakiterator_move_forward(zend_object_iterator *iter TSRMLS_DC) int32_t pos = biter->next(); if (pos != BreakIterator::DONE) { - ZVAL_LONG(&zoi_iter->current, (long)pos); + ZVAL_INT(&zoi_iter->current, (long)pos); } //else we've reached the end of the enum, nothing more is required } @@ -77,7 +77,7 @@ static void _breakiterator_rewind(zend_object_iterator *iter TSRMLS_DC) zoi_with_current *zoi_iter = (zoi_with_current*)iter; int32_t pos = biter->first(); - ZVAL_LONG(&zoi_iter->current, (long)pos); + ZVAL_INT(&zoi_iter->current, (long)pos); } static zend_object_iterator_funcs breakiterator_iterator_funcs = { @@ -137,7 +137,7 @@ static void _breakiterator_parts_destroy_it(zend_object_iterator *iter TSRMLS_DC static void _breakiterator_parts_get_current_key(zend_object_iterator *iter, zval *key TSRMLS_DC) { /* the actual work is done in move_forward and rewind */ - ZVAL_LONG(key, iter->index); + ZVAL_INT(key, iter->index); } static void _breakiterator_parts_move_forward(zend_object_iterator *iter TSRMLS_DC) @@ -168,7 +168,7 @@ static void _breakiterator_parts_move_forward(zend_object_iterator *iter TSRMLS_ * No need to do anything, the engine increments ->index */ const char *s = Z_STRVAL(bio->text); - int32_t slen = Z_STRLEN(bio->text); + int32_t slen = Z_STRSIZE(bio->text); zend_string *res; if (next == BreakIterator::DONE) { @@ -315,7 +315,7 @@ U_CFUNC void breakiterator_register_IntlPartsIterator_class(TSRMLS_D) IntlPartsIterator_handlers.get_method = IntlPartsIterator_get_method; #define PARTSITER_DECL_LONG_CONST(name) \ - zend_declare_class_constant_long(IntlPartsIterator_ce_ptr, #name, \ + zend_declare_class_constant_int(IntlPartsIterator_ce_ptr, #name, \ sizeof(#name) - 1, PARTS_ITERATOR_ ## name TSRMLS_CC) PARTSITER_DECL_LONG_CONST(KEY_SEQUENTIAL); diff --git a/ext/intl/breakiterator/breakiterator_methods.cpp b/ext/intl/breakiterator/breakiterator_methods.cpp index ed5944a3da..99ededb25c 100644 --- a/ext/intl/breakiterator/breakiterator_methods.cpp +++ b/ext/intl/breakiterator/breakiterator_methods.cpp @@ -208,7 +208,7 @@ static void _breakiter_no_args_ret_int32( int32_t res = (bio->biter->*func)(); - RETURN_LONG((long)res); + RETURN_INT((long)res); } static void _breakiter_int32_ret_int32( @@ -240,7 +240,7 @@ static void _breakiter_int32_ret_int32( int32_t res = (bio->biter->*func)((int32_t)arg); - RETURN_LONG((long)res); + RETURN_INT((long)res); } U_CFUNC PHP_FUNCTION(breakiter_first) @@ -308,7 +308,7 @@ U_CFUNC PHP_FUNCTION(breakiter_current) int32_t res = bio->biter->current(); - RETURN_LONG((long)res); + RETURN_INT((long)res); } U_CFUNC PHP_FUNCTION(breakiter_following) @@ -422,7 +422,7 @@ U_CFUNC PHP_FUNCTION(breakiter_get_error_code) if (bio == NULL) RETURN_FALSE; - RETURN_LONG((long)BREAKITER_ERROR_CODE(bio)); + RETURN_INT((long)BREAKITER_ERROR_CODE(bio)); } U_CFUNC PHP_FUNCTION(breakiter_get_error_message) diff --git a/ext/intl/breakiterator/codepointiterator_methods.cpp b/ext/intl/breakiterator/codepointiterator_methods.cpp index a833cf1853..a12924afef 100644 --- a/ext/intl/breakiterator/codepointiterator_methods.cpp +++ b/ext/intl/breakiterator/codepointiterator_methods.cpp @@ -40,5 +40,5 @@ U_CFUNC PHP_FUNCTION(cpbi_get_last_code_point) BREAKITER_METHOD_FETCH_OBJECT; - RETURN_LONG(fetch_cpbi(bio)->getLastCodePoint()); + RETURN_INT(fetch_cpbi(bio)->getLastCodePoint()); } diff --git a/ext/intl/breakiterator/rulebasedbreakiterator_methods.cpp b/ext/intl/breakiterator/rulebasedbreakiterator_methods.cpp index 50df1a61ab..5755b0adb8 100644 --- a/ext/intl/breakiterator/rulebasedbreakiterator_methods.cpp +++ b/ext/intl/breakiterator/rulebasedbreakiterator_methods.cpp @@ -151,7 +151,7 @@ U_CFUNC PHP_FUNCTION(rbbi_get_rule_status) BREAKITER_METHOD_FETCH_OBJECT; - RETURN_LONG(fetch_rbbi(bio)->getRuleStatus()); + RETURN_INT(fetch_rbbi(bio)->getRuleStatus()); } U_CFUNC PHP_FUNCTION(rbbi_get_rule_status_vec) @@ -189,7 +189,7 @@ U_CFUNC PHP_FUNCTION(rbbi_get_rule_status_vec) array_init_size(return_value, num_rules); for (int32_t i = 0; i < num_rules; i++) { - add_next_index_long(return_value, rules[i]); + add_next_index_int(return_value, rules[i]); } delete[] rules; } diff --git a/ext/intl/calendar/calendar_class.cpp b/ext/intl/calendar/calendar_class.cpp index a62ad7b9d9..325ebc5368 100644 --- a/ext/intl/calendar/calendar_class.cpp +++ b/ext/intl/calendar/calendar_class.cpp @@ -209,7 +209,7 @@ static HashTable *Calendar_get_debug_info(zval *object, int *is_temp TSRMLS_DC) const char *name = debug_info_fields[i].name; int32_t res = cal->get(debug_info_fields[i].field, uec); if (U_SUCCESS(uec)) { - add_assoc_long(&zfields, name, (long)res); + add_assoc_int(&zfields, name, (long)res); } else { add_assoc_string(&zfields, name, const_cast<char*>(u_errorName(uec))); } @@ -489,57 +489,57 @@ void calendar_register_IntlCalendar_class(TSRMLS_D) } /* Declare 'IntlCalendar' class constants */ -#define CALENDAR_DECL_LONG_CONST(name, val) \ - zend_declare_class_constant_long(Calendar_ce_ptr, name, sizeof(name) - 1, \ +#define CALENDAR_DECL_INT_CONST(name, val) \ + zend_declare_class_constant_int(Calendar_ce_ptr, name, sizeof(name) - 1, \ val TSRMLS_CC) - CALENDAR_DECL_LONG_CONST("FIELD_ERA", UCAL_ERA); - CALENDAR_DECL_LONG_CONST("FIELD_YEAR", UCAL_YEAR); - CALENDAR_DECL_LONG_CONST("FIELD_MONTH", UCAL_MONTH); - CALENDAR_DECL_LONG_CONST("FIELD_WEEK_OF_YEAR", UCAL_WEEK_OF_YEAR); - CALENDAR_DECL_LONG_CONST("FIELD_WEEK_OF_MONTH", UCAL_WEEK_OF_MONTH); - CALENDAR_DECL_LONG_CONST("FIELD_DATE", UCAL_DATE); - CALENDAR_DECL_LONG_CONST("FIELD_DAY_OF_YEAR", UCAL_DAY_OF_YEAR); - CALENDAR_DECL_LONG_CONST("FIELD_DAY_OF_WEEK", UCAL_DAY_OF_WEEK); - CALENDAR_DECL_LONG_CONST("FIELD_DAY_OF_WEEK_IN_MONTH", UCAL_DAY_OF_WEEK_IN_MONTH); - CALENDAR_DECL_LONG_CONST("FIELD_AM_PM", UCAL_AM_PM); - CALENDAR_DECL_LONG_CONST("FIELD_HOUR", UCAL_HOUR); - CALENDAR_DECL_LONG_CONST("FIELD_HOUR_OF_DAY", UCAL_HOUR_OF_DAY); - CALENDAR_DECL_LONG_CONST("FIELD_HOUR", UCAL_HOUR); - CALENDAR_DECL_LONG_CONST("FIELD_HOUR_OF_DAY", UCAL_HOUR_OF_DAY); - CALENDAR_DECL_LONG_CONST("FIELD_MINUTE", UCAL_MINUTE); - CALENDAR_DECL_LONG_CONST("FIELD_SECOND", UCAL_SECOND); - CALENDAR_DECL_LONG_CONST("FIELD_MILLISECOND", UCAL_MILLISECOND); - CALENDAR_DECL_LONG_CONST("FIELD_ZONE_OFFSET", UCAL_ZONE_OFFSET); - CALENDAR_DECL_LONG_CONST("FIELD_DST_OFFSET", UCAL_DST_OFFSET); - CALENDAR_DECL_LONG_CONST("FIELD_YEAR_WOY", UCAL_YEAR_WOY); - CALENDAR_DECL_LONG_CONST("FIELD_DOW_LOCAL", UCAL_DOW_LOCAL); - CALENDAR_DECL_LONG_CONST("FIELD_EXTENDED_YEAR", UCAL_EXTENDED_YEAR); - CALENDAR_DECL_LONG_CONST("FIELD_JULIAN_DAY", UCAL_JULIAN_DAY); - CALENDAR_DECL_LONG_CONST("FIELD_MILLISECONDS_IN_DAY", UCAL_MILLISECONDS_IN_DAY); - CALENDAR_DECL_LONG_CONST("FIELD_IS_LEAP_MONTH", UCAL_IS_LEAP_MONTH); - CALENDAR_DECL_LONG_CONST("FIELD_FIELD_COUNT", UCAL_FIELD_COUNT); - CALENDAR_DECL_LONG_CONST("FIELD_DAY_OF_MONTH", UCAL_DAY_OF_MONTH); - - CALENDAR_DECL_LONG_CONST("DOW_SUNDAY", UCAL_SUNDAY); - CALENDAR_DECL_LONG_CONST("DOW_MONDAY", UCAL_MONDAY); - CALENDAR_DECL_LONG_CONST("DOW_TUESDAY", UCAL_TUESDAY); - CALENDAR_DECL_LONG_CONST("DOW_WEDNESDAY", UCAL_WEDNESDAY); - CALENDAR_DECL_LONG_CONST("DOW_THURSDAY", UCAL_THURSDAY); - CALENDAR_DECL_LONG_CONST("DOW_FRIDAY", UCAL_FRIDAY); - CALENDAR_DECL_LONG_CONST("DOW_SATURDAY", UCAL_SATURDAY); + CALENDAR_DECL_INT_CONST("FIELD_ERA", UCAL_ERA); + CALENDAR_DECL_INT_CONST("FIELD_YEAR", UCAL_YEAR); + CALENDAR_DECL_INT_CONST("FIELD_MONTH", UCAL_MONTH); + CALENDAR_DECL_INT_CONST("FIELD_WEEK_OF_YEAR", UCAL_WEEK_OF_YEAR); + CALENDAR_DECL_INT_CONST("FIELD_WEEK_OF_MONTH", UCAL_WEEK_OF_MONTH); + CALENDAR_DECL_INT_CONST("FIELD_DATE", UCAL_DATE); + CALENDAR_DECL_INT_CONST("FIELD_DAY_OF_YEAR", UCAL_DAY_OF_YEAR); + CALENDAR_DECL_INT_CONST("FIELD_DAY_OF_WEEK", UCAL_DAY_OF_WEEK); + CALENDAR_DECL_INT_CONST("FIELD_DAY_OF_WEEK_IN_MONTH", UCAL_DAY_OF_WEEK_IN_MONTH); + CALENDAR_DECL_INT_CONST("FIELD_AM_PM", UCAL_AM_PM); + CALENDAR_DECL_INT_CONST("FIELD_HOUR", UCAL_HOUR); + CALENDAR_DECL_INT_CONST("FIELD_HOUR_OF_DAY", UCAL_HOUR_OF_DAY); + CALENDAR_DECL_INT_CONST("FIELD_HOUR", UCAL_HOUR); + CALENDAR_DECL_INT_CONST("FIELD_HOUR_OF_DAY", UCAL_HOUR_OF_DAY); + CALENDAR_DECL_INT_CONST("FIELD_MINUTE", UCAL_MINUTE); + CALENDAR_DECL_INT_CONST("FIELD_SECOND", UCAL_SECOND); + CALENDAR_DECL_INT_CONST("FIELD_MILLISECOND", UCAL_MILLISECOND); + CALENDAR_DECL_INT_CONST("FIELD_ZONE_OFFSET", UCAL_ZONE_OFFSET); + CALENDAR_DECL_INT_CONST("FIELD_DST_OFFSET", UCAL_DST_OFFSET); + CALENDAR_DECL_INT_CONST("FIELD_YEAR_WOY", UCAL_YEAR_WOY); + CALENDAR_DECL_INT_CONST("FIELD_DOW_LOCAL", UCAL_DOW_LOCAL); + CALENDAR_DECL_INT_CONST("FIELD_EXTENDED_YEAR", UCAL_EXTENDED_YEAR); + CALENDAR_DECL_INT_CONST("FIELD_JULIAN_DAY", UCAL_JULIAN_DAY); + CALENDAR_DECL_INT_CONST("FIELD_MILLISECONDS_IN_DAY", UCAL_MILLISECONDS_IN_DAY); + CALENDAR_DECL_INT_CONST("FIELD_IS_LEAP_MONTH", UCAL_IS_LEAP_MONTH); + CALENDAR_DECL_INT_CONST("FIELD_FIELD_COUNT", UCAL_FIELD_COUNT); + CALENDAR_DECL_INT_CONST("FIELD_DAY_OF_MONTH", UCAL_DAY_OF_MONTH); + + CALENDAR_DECL_INT_CONST("DOW_SUNDAY", UCAL_SUNDAY); + CALENDAR_DECL_INT_CONST("DOW_MONDAY", UCAL_MONDAY); + CALENDAR_DECL_INT_CONST("DOW_TUESDAY", UCAL_TUESDAY); + CALENDAR_DECL_INT_CONST("DOW_WEDNESDAY", UCAL_WEDNESDAY); + CALENDAR_DECL_INT_CONST("DOW_THURSDAY", UCAL_THURSDAY); + CALENDAR_DECL_INT_CONST("DOW_FRIDAY", UCAL_FRIDAY); + CALENDAR_DECL_INT_CONST("DOW_SATURDAY", UCAL_SATURDAY); #if U_ICU_VERSION_MAJOR_NUM * 10 + U_ICU_VERSION_MINOR_NUM >= 44 - CALENDAR_DECL_LONG_CONST("DOW_TYPE_WEEKDAY", UCAL_WEEKDAY); - CALENDAR_DECL_LONG_CONST("DOW_TYPE_WEEKEND", UCAL_WEEKEND); - CALENDAR_DECL_LONG_CONST("DOW_TYPE_WEEKEND_OFFSET", UCAL_WEEKEND_ONSET); - CALENDAR_DECL_LONG_CONST("DOW_TYPE_WEEKEND_CEASE", UCAL_WEEKEND_CEASE); + CALENDAR_DECL_INT_CONST("DOW_TYPE_WEEKDAY", UCAL_WEEKDAY); + CALENDAR_DECL_INT_CONST("DOW_TYPE_WEEKEND", UCAL_WEEKEND); + CALENDAR_DECL_INT_CONST("DOW_TYPE_WEEKEND_OFFSET", UCAL_WEEKEND_ONSET); + CALENDAR_DECL_INT_CONST("DOW_TYPE_WEEKEND_CEASE", UCAL_WEEKEND_CEASE); #endif #if U_ICU_VERSION_MAJOR_NUM >= 49 - CALENDAR_DECL_LONG_CONST("WALLTIME_FIRST", UCAL_WALLTIME_FIRST); - CALENDAR_DECL_LONG_CONST("WALLTIME_LAST", UCAL_WALLTIME_LAST); - CALENDAR_DECL_LONG_CONST("WALLTIME_NEXT_VALID", UCAL_WALLTIME_NEXT_VALID); + CALENDAR_DECL_INT_CONST("WALLTIME_FIRST", UCAL_WALLTIME_FIRST); + CALENDAR_DECL_INT_CONST("WALLTIME_LAST", UCAL_WALLTIME_LAST); + CALENDAR_DECL_INT_CONST("WALLTIME_NEXT_VALID", UCAL_WALLTIME_NEXT_VALID); #endif } /* }}} */ diff --git a/ext/intl/calendar/calendar_methods.cpp b/ext/intl/calendar/calendar_methods.cpp index 3684c229a1..29a131533d 100644 --- a/ext/intl/calendar/calendar_methods.cpp +++ b/ext/intl/calendar/calendar_methods.cpp @@ -244,7 +244,7 @@ static void _php_intlcal_field_uec_ret_in32t_method( (UCalendarDateFields)field, CALENDAR_ERROR_CODE(co)); INTL_METHOD_CHECK_STATUS(co, "Call to ICU method has failed"); - RETURN_LONG((long)result); + RETURN_INT((long)result); } U_CFUNC PHP_FUNCTION(intlcal_get) @@ -431,7 +431,7 @@ U_CFUNC PHP_FUNCTION(intlcal_set) } for (i = 0; i < variant; i++) { - if (Z_LVAL(args[i]) < INT32_MIN || Z_LVAL(args[i]) > INT32_MAX) { + if (Z_IVAL(args[i]) < INT32_MIN || Z_IVAL(args[i]) > INT32_MAX) { intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, "intlcal_set: at least one of the arguments has an absolute " "value that is too large", 0 TSRMLS_CC); @@ -596,7 +596,7 @@ U_CFUNC PHP_FUNCTION(intlcal_field_difference) INTL_METHOD_CHECK_STATUS(co, "intlcal_field_difference: Call to ICU method has failed"); - RETURN_LONG((long)result); + RETURN_INT((long)result); } U_CFUNC PHP_FUNCTION(intlcal_get_actual_maximum) @@ -637,7 +637,7 @@ U_CFUNC PHP_FUNCTION(intlcal_get_day_of_week_type) INTL_METHOD_CHECK_STATUS(co, "intlcal_get_day_of_week_type: Call to ICU method has failed"); - RETURN_LONG((long)result); + RETURN_INT((long)result); } #endif @@ -658,7 +658,7 @@ U_CFUNC PHP_FUNCTION(intlcal_get_first_day_of_week) INTL_METHOD_CHECK_STATUS(co, "intlcal_get_first_day_of_week: Call to ICU method has failed"); - RETURN_LONG((long)result); + RETURN_INT((long)result); } static void _php_intlcal_field_ret_in32t_method( @@ -690,7 +690,7 @@ static void _php_intlcal_field_ret_in32t_method( int32_t result = (co->ucal->*func)((UCalendarDateFields)field); INTL_METHOD_CHECK_STATUS(co, "Call to ICU method has failed"); - RETURN_LONG((long)result); + RETURN_INT((long)result); } U_CFUNC PHP_FUNCTION(intlcal_get_greatest_minimum) @@ -756,7 +756,7 @@ U_CFUNC PHP_FUNCTION(intlcal_get_minimal_days_in_first_week) INTL_METHOD_CHECK_STATUS(co, "intlcal_get_first_day_of_week: Call to ICU method has failed"); - RETURN_LONG((long)result); + RETURN_INT((long)result); } U_CFUNC PHP_FUNCTION(intlcal_get_minimum) @@ -830,7 +830,7 @@ U_CFUNC PHP_FUNCTION(intlcal_get_weekend_transition) INTL_METHOD_CHECK_STATUS(co, "intlcal_get_weekend_transition: " "Error calling ICU method"); - RETURN_LONG((long)res); + RETURN_INT((long)res); } #endif @@ -1064,7 +1064,7 @@ U_CFUNC PHP_FUNCTION(intlcal_get_repeated_wall_time_option) CALENDAR_METHOD_FETCH_OBJECT; - RETURN_LONG(co->ucal->getRepeatedWallTimeOption()); + RETURN_INT(co->ucal->getRepeatedWallTimeOption()); } U_CFUNC PHP_FUNCTION(intlcal_get_skipped_wall_time_option) @@ -1080,7 +1080,7 @@ U_CFUNC PHP_FUNCTION(intlcal_get_skipped_wall_time_option) CALENDAR_METHOD_FETCH_OBJECT; - RETURN_LONG(co->ucal->getSkippedWallTimeOption()); + RETURN_INT(co->ucal->getSkippedWallTimeOption()); } U_CFUNC PHP_FUNCTION(intlcal_set_repeated_wall_time_option) @@ -1179,7 +1179,7 @@ U_CFUNC PHP_FUNCTION(intlcal_from_date_time) } zend_call_method_with_0_params(zv_datetime, php_date_get_date_ce(), NULL, "gettimestamp", &zv_timestamp); - if (Z_TYPE(zv_timestamp) != IS_LONG) { + if (Z_TYPE(zv_timestamp) != IS_INT) { intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, "intlcal_from_date_time: bad DateTime; call to " "DateTime::getTimestamp() failed", 0 TSRMLS_CC); @@ -1209,7 +1209,7 @@ U_CFUNC PHP_FUNCTION(intlcal_from_date_time) "error creating ICU Calendar object", 0 TSRMLS_CC); goto error; } - cal->setTime(((UDate)Z_LVAL(zv_timestamp)) * 1000., status); + cal->setTime(((UDate)Z_IVAL(zv_timestamp)) * 1000., status); if (U_FAILURE(status)) { /* time zone was adopted by cal; should not be deleted here */ delete cal; @@ -1322,7 +1322,7 @@ U_CFUNC PHP_FUNCTION(intlcal_get_error_code) if (co == NULL) RETURN_FALSE; - RETURN_LONG((long)CALENDAR_ERROR_CODE(co)); + RETURN_INT((long)CALENDAR_ERROR_CODE(co)); } U_CFUNC PHP_FUNCTION(intlcal_get_error_message) diff --git a/ext/intl/collator/collator.c b/ext/intl/collator/collator.c index eff9568de1..08da6d3831 100644 --- a/ext/intl/collator/collator.c +++ b/ext/intl/collator/collator.c @@ -38,9 +38,9 @@ void collator_register_constants( INIT_FUNC_ARGS ) return; } - #define COLLATOR_EXPOSE_CONST(x) REGISTER_LONG_CONSTANT(#x, x, CONST_PERSISTENT | CONST_CS) - #define COLLATOR_EXPOSE_CLASS_CONST(x) zend_declare_class_constant_long( Collator_ce_ptr, ZEND_STRS( #x ) - 1, UCOL_##x TSRMLS_CC ); - #define COLLATOR_EXPOSE_CUSTOM_CLASS_CONST(name, value) zend_declare_class_constant_long( Collator_ce_ptr, ZEND_STRS( name ) - 1, value TSRMLS_CC ); + #define COLLATOR_EXPOSE_CONST(x) REGISTER_INT_CONSTANT(#x, x, CONST_PERSISTENT | CONST_CS) + #define COLLATOR_EXPOSE_CLASS_CONST(x) zend_declare_class_constant_int( Collator_ce_ptr, ZEND_STRS( #x ) - 1, UCOL_##x TSRMLS_CC ); + #define COLLATOR_EXPOSE_CUSTOM_CLASS_CONST(name, value) zend_declare_class_constant_int( Collator_ce_ptr, ZEND_STRS( name ) - 1, value TSRMLS_CC ); /* UColAttributeValue constants */ COLLATOR_EXPOSE_CUSTOM_CLASS_CONST( "DEFAULT_VALUE", UCOL_DEFAULT ); diff --git a/ext/intl/collator/collator_attr.c b/ext/intl/collator/collator_attr.c index 684e72cc58..061e4c0146 100644 --- a/ext/intl/collator/collator_attr.c +++ b/ext/intl/collator/collator_attr.c @@ -53,7 +53,7 @@ PHP_FUNCTION( collator_get_attribute ) value = ucol_getAttribute( co->ucoll, attribute, COLLATOR_ERROR_CODE_P( co ) ); COLLATOR_CHECK_STATUS( co, "Error getting attribute value" ); - RETURN_LONG( value ); + RETURN_INT( value ); } /* }}} */ @@ -112,7 +112,7 @@ PHP_FUNCTION( collator_get_strength ) COLLATOR_METHOD_FETCH_OBJECT; /* Get current strength and return it. */ - RETURN_LONG( ucol_getStrength( co->ucoll ) ); + RETURN_INT( ucol_getStrength( co->ucoll ) ); } /* }}} */ diff --git a/ext/intl/collator/collator_compare.c b/ext/intl/collator/collator_compare.c index 4384558ac6..497061e157 100644 --- a/ext/intl/collator/collator_compare.c +++ b/ext/intl/collator/collator_compare.c @@ -119,7 +119,7 @@ PHP_FUNCTION( collator_compare ) efree( ustr2 ); /* Return result of the comparison. */ - RETURN_LONG( result ); + RETURN_INT( result ); } /* }}} */ diff --git a/ext/intl/collator/collator_convert.c b/ext/intl/collator/collator_convert.c index 7d8bf0bbc8..edf02f83ce 100644 --- a/ext/intl/collator/collator_convert.c +++ b/ext/intl/collator/collator_convert.c @@ -55,7 +55,7 @@ static void collator_convert_hash_item_from_utf8_to_utf16( return; old_val = Z_STRVAL_P( hashData ); - old_val_len = Z_STRLEN_P( hashData ); + old_val_len = Z_STRSIZE_P( hashData ); /* Convert it from UTF-8 to UTF-16LE and save the result to new_val[_len]. */ intl_convert_utf8_to_utf16( &new_val, &new_val_len, old_val, old_val_len, status ); @@ -67,13 +67,13 @@ static void collator_convert_hash_item_from_utf8_to_utf16( //??? efree(new_val); /* hack to fix use of initialized value */ - Z_STRLEN(znew_val) = Z_STRLEN(znew_val) - UBYTES(1); + Z_STRSIZE(znew_val) = Z_STRSIZE(znew_val) - UBYTES(1); if( hashKey) { zend_hash_update( hash, hashKey, &znew_val); } - else /* hashKeyType == HASH_KEY_IS_LONG */ + else /* hashKeyType == HASH_KEY_IS_INT */ { zend_hash_index_update( hash, hashIndex, &znew_val); } @@ -96,7 +96,7 @@ static void collator_convert_hash_item_from_utf16_to_utf8( return; old_val = Z_STRVAL_P( hashData ); - old_val_len = Z_STRLEN_P( hashData ); + old_val_len = Z_STRSIZE_P( hashData ); /* Convert it from UTF-16LE to UTF-8 and save the result to new_val[_len]. */ intl_convert_utf16_to_utf8( &new_val, &new_val_len, @@ -113,7 +113,7 @@ static void collator_convert_hash_item_from_utf16_to_utf8( { zend_hash_update( hash, hashKey, &znew_val); } - else /* hashKeyType == HASH_KEY_IS_LONG */ + else /* hashKeyType == HASH_KEY_IS_INT */ { zend_hash_index_update( hash, hashIndex, &znew_val); } @@ -176,7 +176,7 @@ zval* collator_convert_zstr_utf16_to_utf8( zval* utf16_zval, zval *rv ) /* Convert to utf8 then. */ intl_convert_utf16_to_utf8( &str, &str_len, - (UChar*) Z_STRVAL_P(utf16_zval), UCHARS( Z_STRLEN_P(utf16_zval) ), &status ); + (UChar*) Z_STRVAL_P(utf16_zval), UCHARS( Z_STRSIZE_P(utf16_zval) ), &status ); if( U_FAILURE( status ) ) php_error( E_WARNING, "Error converting utf16 to utf8 in collator_convert_zval_utf16_to_utf8()" ); @@ -207,7 +207,7 @@ zval* collator_convert_zstr_utf8_to_utf16( zval* utf8_zval, zval *rv ) /* Convert the string to UTF-16. */ intl_convert_utf8_to_utf16( &ustr, &ustr_len, - Z_STRVAL_P( utf8_zval ), Z_STRLEN_P( utf8_zval ), + Z_STRVAL_P( utf8_zval ), Z_STRSIZE_P( utf8_zval ), &status ); if( U_FAILURE( status ) ) php_error( E_WARNING, "Error casting object to string in collator_convert_zstr_utf8_to_utf16()" ); @@ -282,7 +282,7 @@ zval* collator_convert_object_to_string( zval* obj, zval *rv TSRMLS_DC ) /* Convert the string to UTF-16. */ intl_convert_utf8_to_utf16( &ustr, &ustr_len, - Z_STRVAL_P( zstr ), Z_STRLEN_P( zstr ), + Z_STRVAL_P( zstr ), Z_STRSIZE_P( zstr ), &status ); if( U_FAILURE( status ) ) php_error( E_WARNING, "Error casting object to string in collator_convert_object_to_string()" ); @@ -320,7 +320,7 @@ zval* collator_convert_string_to_number( zval* str, zval *rv ) zval_ptr_dtor( num ); num = rv; - ZVAL_LONG( num, 0 ); + ZVAL_INT( num, 0 ); } return num; @@ -338,9 +338,9 @@ zval* collator_convert_string_to_number( zval* str, zval *rv ) zval* collator_convert_string_to_double( zval* str, zval *rv ) { zval* num = collator_convert_string_to_number( str, rv ); - if( Z_TYPE_P(num) == IS_LONG ) + if( Z_TYPE_P(num) == IS_INT ) { - ZVAL_DOUBLE( num, Z_LVAL_P( num ) ); + ZVAL_DOUBLE( num, Z_IVAL_P( num ) ); } return num; @@ -367,10 +367,10 @@ zval* collator_convert_string_to_number_if_possible( zval* str, zval *rv ) COLLATOR_CONVERT_RETURN_FAILED( str ); } - if( ( is_numeric = collator_is_numeric( (UChar*) Z_STRVAL_P(str), UCHARS( Z_STRLEN_P(str) ), &lval, &dval, 1 ) ) ) + if( ( is_numeric = collator_is_numeric( (UChar*) Z_STRVAL_P(str), UCHARS( Z_STRSIZE_P(str) ), &lval, &dval, 1 ) ) ) { - if( is_numeric == IS_LONG ) { - ZVAL_LONG(rv, lval); + if( is_numeric == IS_INT ) { + ZVAL_INT(rv, lval); } if( is_numeric == IS_DOUBLE ) ZVAL_DOUBLE(rv, dval); diff --git a/ext/intl/collator/collator_error.c b/ext/intl/collator/collator_error.c index 91bc25d077..acfa43c498 100644 --- a/ext/intl/collator/collator_error.c +++ b/ext/intl/collator/collator_error.c @@ -48,7 +48,7 @@ PHP_FUNCTION( collator_get_error_code ) RETURN_FALSE; /* Return collator's last error code. */ - RETURN_LONG( COLLATOR_ERROR_CODE( co ) ); + RETURN_INT( COLLATOR_ERROR_CODE( co ) ); } /* }}} */ diff --git a/ext/intl/collator/collator_is_numeric.c b/ext/intl/collator/collator_is_numeric.c index a8abfac12b..cf24efe133 100644 --- a/ext/intl/collator/collator_is_numeric.c +++ b/ext/intl/collator/collator_is_numeric.c @@ -245,7 +245,7 @@ zend_uchar collator_is_numeric( UChar *str, int length, long *lval, double *dval if (lval) { *lval = local_lval; } - return IS_LONG; + return IS_INT; } else if (end_ptr_long == str && *end_ptr_long != '\0' && *str != '.' && *str != '-') { /* ignore partial string matches */ return 0; } @@ -288,7 +288,7 @@ zend_uchar collator_is_numeric( UChar *str, int length, long *lval, double *dval return IS_DOUBLE; } else if (end_ptr_long && lval) { *lval = local_lval; - return IS_LONG; + return IS_INT; } } return 0; diff --git a/ext/intl/collator/collator_sort.c b/ext/intl/collator/collator_sort.c index 43140b2f41..c109fa7cb6 100644 --- a/ext/intl/collator/collator_sort.c +++ b/ext/intl/collator/collator_sort.c @@ -80,10 +80,10 @@ static int collator_regular_compare_function(zval *result, zval *op1, zval *op2 } /* Compare the strings using ICU. */ - ZVAL_LONG(result, ucol_strcoll( + ZVAL_INT(result, ucol_strcoll( co->ucoll, - INTL_Z_STRVAL_P(str1_p), INTL_Z_STRLEN_P(str1_p), - INTL_Z_STRVAL_P(str2_p), INTL_Z_STRLEN_P(str2_p) )); + INTL_Z_STRVAL_P(str1_p), INTL_Z_STRSIZE_P(str1_p), + INTL_Z_STRVAL_P(str2_p), INTL_Z_STRSIZE_P(str2_p) )); } else { @@ -190,10 +190,10 @@ static int collator_icu_compare_function(zval *result, zval *op1, zval *op2 TSRM co = Z_INTL_COLLATOR_P(&INTL_G(current_collator)); /* Compare the strings using ICU. */ - ZVAL_LONG(result, ucol_strcoll( + ZVAL_INT(result, ucol_strcoll( co->ucoll, - INTL_Z_STRVAL_P(str1_p), INTL_Z_STRLEN_P(str1_p), - INTL_Z_STRVAL_P(str2_p), INTL_Z_STRLEN_P(str2_p) )); + INTL_Z_STRVAL_P(str1_p), INTL_Z_STRSIZE_P(str1_p), + INTL_Z_STRVAL_P(str2_p), INTL_Z_STRSIZE_P(str2_p) )); zval_ptr_dtor( str1_p ); zval_ptr_dtor( str2_p ); @@ -232,11 +232,11 @@ static int collator_compare_func( const void* a, const void* b TSRMLS_DC ) return 0; } - convert_to_long(&result); + convert_to_int(&result); - if( Z_LVAL(result) < 0 ) + if( Z_IVAL(result) < 0 ) return -1; - else if( Z_LVAL(result) > 0 ) + else if( Z_IVAL(result) > 0 ) return 1; return 0; @@ -424,7 +424,7 @@ PHP_FUNCTION( collator_sort_with_sort_keys ) /* Process string values only. */ if( Z_TYPE_P( hashData ) == IS_STRING ) { - intl_convert_utf8_to_utf16( &utf16_buf, &utf16_len, Z_STRVAL_P( hashData ), Z_STRLEN_P( hashData ), COLLATOR_ERROR_CODE_P( co ) ); + intl_convert_utf8_to_utf16( &utf16_buf, &utf16_len, Z_STRVAL_P( hashData ), Z_STRSIZE_P( hashData ), COLLATOR_ERROR_CODE_P( co ) ); if( U_FAILURE( COLLATOR_ERROR_CODE( co ) ) ) { diff --git a/ext/intl/common/common_date.cpp b/ext/intl/common/common_date.cpp index 7c7510d554..885d08cd2c 100644 --- a/ext/intl/common/common_date.cpp +++ b/ext/intl/common/common_date.cpp @@ -127,7 +127,7 @@ U_CFUNC int intl_datetime_decompose(zval *z, double *millis, TimeZone **tz, if (millis) { ZVAL_STRING(&zfuncname, "getTimestamp"); if (call_user_function(NULL, z, &zfuncname, &retval, 0, NULL TSRMLS_CC) - != SUCCESS || Z_TYPE(retval) != IS_LONG) { + != SUCCESS || Z_TYPE(retval) != IS_INT) { spprintf(&message, 0, "%s: error calling ::getTimeStamp() on the " "object", func); intl_errors_set(err, U_INTERNAL_PROGRAM_ERROR, @@ -137,7 +137,7 @@ U_CFUNC int intl_datetime_decompose(zval *z, double *millis, TimeZone **tz, return FAILURE; } - *millis = U_MILLIS_PER_SECOND * (double)Z_LVAL(retval); + *millis = U_MILLIS_PER_SECOND * (double)Z_IVAL(retval); zval_ptr_dtor(&zfuncname); } @@ -174,7 +174,7 @@ U_CFUNC int intl_datetime_decompose(zval *z, double *millis, TimeZone **tz, U_CFUNC double intl_zval_to_millis(zval *z, intl_error *err, const char *func TSRMLS_DC) { double rv = NAN; - long lv; + php_int_t lv; int type; char *message; @@ -184,10 +184,10 @@ U_CFUNC double intl_zval_to_millis(zval *z, intl_error *err, const char *func TS switch (Z_TYPE_P(z)) { case IS_STRING: - type = is_numeric_string(Z_STRVAL_P(z), Z_STRLEN_P(z), &lv, &rv, 0); + type = is_numeric_string(Z_STRVAL_P(z), Z_STRSIZE_P(z), &lv, &rv, 0); if (type == IS_DOUBLE) { rv *= U_MILLIS_PER_SECOND; - } else if (type == IS_LONG) { + } else if (type == IS_INT) { rv = U_MILLIS_PER_SECOND * (double)lv; } else { spprintf(&message, 0, "%s: string '%s' is not numeric, " @@ -198,8 +198,8 @@ U_CFUNC double intl_zval_to_millis(zval *z, intl_error *err, const char *func TS efree(message); } break; - case IS_LONG: - rv = U_MILLIS_PER_SECOND * (double)Z_LVAL_P(z); + case IS_INT: + rv = U_MILLIS_PER_SECOND * (double)Z_IVAL_P(z); break; case IS_DOUBLE: rv = U_MILLIS_PER_SECOND * Z_DVAL_P(z); diff --git a/ext/intl/common/common_enum.cpp b/ext/intl/common/common_enum.cpp index ff28bdb456..cfe46ce75a 100644 --- a/ext/intl/common/common_enum.cpp +++ b/ext/intl/common/common_enum.cpp @@ -238,7 +238,7 @@ static PHP_METHOD(IntlIterator, key) if (ii->iterator->funcs->get_current_key) { ii->iterator->funcs->get_current_key(ii->iterator, return_value TSRMLS_CC); } else { - RETURN_LONG(ii->iterator->index); + RETURN_INT(ii->iterator->index); } } diff --git a/ext/intl/common/common_error.c b/ext/intl/common/common_error.c index 2db688ac71..fbdf82ed9c 100644 --- a/ext/intl/common/common_error.c +++ b/ext/intl/common/common_error.c @@ -28,7 +28,7 @@ */ PHP_FUNCTION( intl_get_error_code ) { - RETURN_LONG( intl_error_get_code( NULL TSRMLS_CC ) ); + RETURN_INT( intl_error_get_code( NULL TSRMLS_CC ) ); } /* }}} */ @@ -91,7 +91,7 @@ PHP_FUNCTION( intl_error_name ) */ void intl_expose_icu_error_codes( INIT_FUNC_ARGS ) { - #define INTL_EXPOSE_CONST(x) REGISTER_LONG_CONSTANT(#x, x, CONST_PERSISTENT | CONST_CS) + #define INTL_EXPOSE_CONST(x) REGISTER_INT_CONSTANT(#x, x, CONST_PERSISTENT | CONST_CS) /* Warnings */ INTL_EXPOSE_CONST( U_USING_FALLBACK_WARNING ); diff --git a/ext/intl/converter/converter.c b/ext/intl/converter/converter.c index 0064497b41..4bdbf3408c 100644 --- a/ext/intl/converter/converter.c +++ b/ext/intl/converter/converter.c @@ -65,7 +65,7 @@ static inline void php_converter_throw_failure(php_converter_object *objval, UEr static void php_converter_default_callback(zval *return_value, zval *zobj, long reason, zval *error TSRMLS_DC) { ZVAL_DEREF(error); zval_dtor(error); - ZVAL_LONG(error, U_ZERO_ERROR); + ZVAL_INT(error, U_ZERO_ERROR); /* Basic functionality so children can call parent::toUCallback() */ switch (reason) { case UCNV_UNASSIGNED: @@ -81,7 +81,7 @@ static void php_converter_default_callback(zval *return_value, zval *zobj, long chars[0] = 0x1A; chars[1] = 0; chars_len = 1; - ZVAL_LONG(error, U_INVALID_STATE_ERROR); + ZVAL_INT(error, U_INVALID_STATE_ERROR); RETVAL_STRINGL(chars, chars_len); return; } @@ -99,7 +99,7 @@ static void php_converter_default_callback(zval *return_value, zval *zobj, long chars[0] = 0x1A; chars[1] = 0; chars_len = 1; - ZVAL_LONG(error, uerror); + ZVAL_INT(error, uerror); } RETVAL_STRINGL(chars, chars_len); } @@ -169,9 +169,9 @@ static void php_converter_append_toUnicode_target(zval *val, UConverterToUnicode case IS_NULL: /* Code unit is being skipped */ return; - case IS_LONG: + case IS_INT: { - long lval = Z_LVAL_P(val); + long lval = Z_IVAL_P(val); if ((lval < 0) || (lval > 0x10FFFF)) { php_converter_throw_failure(objval, U_ILLEGAL_ARGUMENT_ERROR TSRMLS_CC, "Invalid codepoint U+%04lx", lval); return; @@ -194,7 +194,7 @@ static void php_converter_append_toUnicode_target(zval *val, UConverterToUnicode case IS_STRING: { const char *strval = Z_STRVAL_P(val); - int i = 0, strlen = Z_STRLEN_P(val); + int i = 0, strlen = Z_STRSIZE_P(val); while((i != strlen) && TARGET_CHECK(args, 1)) { UChar c; @@ -233,10 +233,10 @@ static void php_converter_to_u_callback(const void *context, TSRMLS_D = objval->tsrm_ls; #endif - ZVAL_LONG(&zargs[0], reason); + ZVAL_INT(&zargs[0], reason); ZVAL_STRINGL(&zargs[1], args->source, args->sourceLimit - args->source); ZVAL_STRINGL(&zargs[2], codeUnits, length); - ZVAL_LONG(&zargs[3], *pErrorCode); + ZVAL_INT(&zargs[3], *pErrorCode); objval->to_cb.param_count = 4; objval->to_cb.params = zargs; @@ -250,10 +250,10 @@ static void php_converter_to_u_callback(const void *context, zval_ptr_dtor(&retval); } - if (Z_TYPE(zargs[3]) == IS_LONG) { - *pErrorCode = Z_LVAL(zargs[3]); - } else if (Z_ISREF(zargs[3]) && Z_TYPE_P(Z_REFVAL(zargs[3])) == IS_LONG) { - *pErrorCode = Z_LVAL_P(Z_REFVAL(zargs[3])); + if (Z_TYPE(zargs[3]) == IS_INT) { + *pErrorCode = Z_IVAL(zargs[3]); + } else if (Z_ISREF(zargs[3]) && Z_TYPE_P(Z_REFVAL(zargs[3])) == IS_INT) { + *pErrorCode = Z_IVAL_P(Z_REFVAL(zargs[3])); } zval_ptr_dtor(&zargs[0]); @@ -269,14 +269,14 @@ static void php_converter_append_fromUnicode_target(zval *val, UConverterFromUni case IS_NULL: /* Ignore */ return; - case IS_LONG: + case IS_INT: if (TARGET_CHECK(args, 1)) { - *(args->target++) = Z_LVAL_P(val); + *(args->target++) = Z_IVAL_P(val); } return; case IS_STRING: { - int vallen = Z_STRLEN_P(val); + int vallen = Z_STRSIZE_P(val); if (TARGET_CHECK(args, vallen)) { memcpy(args->target, Z_STRVAL_P(val), vallen); args->target += vallen; @@ -312,16 +312,16 @@ static void php_converter_from_u_callback(const void *context, TSRMLS_D = objval->tsrm_ls; #endif - ZVAL_LONG(&zargs[0], reason); + ZVAL_INT(&zargs[0], reason); array_init(&zargs[1]); i = 0; while (i < length) { UChar32 c; U16_NEXT(codeUnits, i, length, c); - add_next_index_long(&zargs[1], c); + add_next_index_int(&zargs[1], c); } - ZVAL_LONG(&zargs[2], codePoint); - ZVAL_LONG(&zargs[3], *pErrorCode); + ZVAL_INT(&zargs[2], codePoint); + ZVAL_INT(&zargs[3], *pErrorCode); objval->from_cb.param_count = 4; objval->from_cb.params = zargs; @@ -335,10 +335,10 @@ static void php_converter_from_u_callback(const void *context, zval_ptr_dtor(&retval); } - if (Z_TYPE(zargs[3]) == IS_LONG) { - *pErrorCode = Z_LVAL(zargs[3]); - } else if (Z_ISREF(zargs[3]) && Z_TYPE_P(Z_REFVAL(zargs[3])) == IS_LONG) { - *pErrorCode = Z_LVAL_P(Z_REFVAL(zargs[3])); + if (Z_TYPE(zargs[3]) == IS_INT) { + *pErrorCode = Z_IVAL(zargs[3]); + } else if (Z_ISREF(zargs[3]) && Z_TYPE_P(Z_REFVAL(zargs[3])) == IS_INT) { + *pErrorCode = Z_IVAL_P(Z_REFVAL(zargs[3])); } zval_ptr_dtor(&zargs[0]); @@ -512,7 +512,7 @@ static void php_converter_do_get_type(php_converter_object *objval, UConverter * RETURN_FALSE; } - RETURN_LONG(t); + RETURN_INT(t); } /* }}} */ @@ -824,13 +824,13 @@ static PHP_METHOD(UConverter, transcode) { (tmpzval = zend_hash_str_find(Z_ARRVAL_P(options), "from_subst", sizeof("from_subst") - 1)) != NULL && Z_TYPE_P(tmpzval) == IS_STRING) { error = U_ZERO_ERROR; - ucnv_setSubstChars(src_cnv, Z_STRVAL_P(tmpzval), Z_STRLEN_P(tmpzval) & 0x7F, &error); + ucnv_setSubstChars(src_cnv, Z_STRVAL_P(tmpzval), Z_STRSIZE_P(tmpzval) & 0x7F, &error); } if (U_SUCCESS(error) && (tmpzval = zend_hash_str_find(Z_ARRVAL_P(options), "to_subst", sizeof("to_subst") - 1)) != NULL && Z_TYPE_P(tmpzval) == IS_STRING) { error = U_ZERO_ERROR; - ucnv_setSubstChars(dest_cnv, Z_STRVAL_P(tmpzval), Z_STRLEN_P(tmpzval) & 0x7F, &error); + ucnv_setSubstChars(dest_cnv, Z_STRVAL_P(tmpzval), Z_STRSIZE_P(tmpzval) & 0x7F, &error); } } @@ -871,7 +871,7 @@ static PHP_METHOD(UConverter, getErrorCode) { RETURN_FALSE; } - RETURN_LONG(intl_error_get_code(&(objval->error) TSRMLS_CC)); + RETURN_INT(intl_error_get_code(&(objval->error) TSRMLS_CC)); } /* }}} */ @@ -1098,8 +1098,8 @@ static zend_object *php_converter_clone_object(zval *object TSRMLS_DC) { } /* }}} */ -#define CONV_REASON_CONST(v) zend_declare_class_constant_long(php_converter_ce, "REASON_" #v, sizeof("REASON_" #v) - 1, UCNV_ ## v TSRMLS_CC) -#define CONV_TYPE_CONST(v) zend_declare_class_constant_long(php_converter_ce, #v , sizeof(#v) - 1, UCNV_ ## v TSRMLS_CC) +#define CONV_REASON_CONST(v) zend_declare_class_constant_int(php_converter_ce, "REASON_" #v, sizeof("REASON_" #v) - 1, UCNV_ ## v TSRMLS_CC) +#define CONV_TYPE_CONST(v) zend_declare_class_constant_int(php_converter_ce, #v , sizeof(#v) - 1, UCNV_ ## v TSRMLS_CC) /* {{{ php_converter_minit */ int php_converter_minit(INIT_FUNC_ARGS) { diff --git a/ext/intl/dateformat/dateformat.c b/ext/intl/dateformat/dateformat.c index eedc60040e..c51b33144b 100644 --- a/ext/intl/dateformat/dateformat.c +++ b/ext/intl/dateformat/dateformat.c @@ -34,11 +34,11 @@ void dateformat_register_constants( INIT_FUNC_ARGS ) return; } - #define DATEFORMATTER_EXPOSE_CONST(x) REGISTER_LONG_CONSTANT(#x, x, CONST_PERSISTENT | CONST_CS) - #define DATEFORMATTER_EXPOSE_CLASS_CONST(x) zend_declare_class_constant_long( IntlDateFormatter_ce_ptr, ZEND_STRS( #x ) - 1, UDAT_##x TSRMLS_CC ); - #define DATEFORMATTER_EXPOSE_CUSTOM_CLASS_CONST(name, value) zend_declare_class_constant_long( IntlDateFormatter_ce_ptr, ZEND_STRS( name ) - 1, value TSRMLS_CC ); + #define DATEFORMATTER_EXPOSE_CONST(x) REGISTER_INT_CONSTANT(#x, x, CONST_PERSISTENT | CONST_CS) + #define DATEFORMATTER_EXPOSE_CLASS_CONST(x) zend_declare_class_constant_int( IntlDateFormatter_ce_ptr, ZEND_STRS( #x ) - 1, UDAT_##x TSRMLS_CC ); + #define DATEFORMATTER_EXPOSE_CUSTOM_CLASS_CONST(name, value) zend_declare_class_constant_int( IntlDateFormatter_ce_ptr, ZEND_STRS( name ) - 1, value TSRMLS_CC ); - #define DATEFORMATTER_EXPOSE_UCAL_CLASS_CONST(x) zend_declare_class_constant_long( IntlDateFormatter_ce_ptr, ZEND_STRS( #x ) - 1, UCAL_##x TSRMLS_CC ); + #define DATEFORMATTER_EXPOSE_UCAL_CLASS_CONST(x) zend_declare_class_constant_int( IntlDateFormatter_ce_ptr, ZEND_STRS( #x ) - 1, UCAL_##x TSRMLS_CC ); /* UDateFormatStyle constants */ DATEFORMATTER_EXPOSE_CLASS_CONST( FULL ); @@ -85,7 +85,7 @@ PHP_FUNCTION( datefmt_get_error_code ) dfo = Z_INTL_DATEFORMATTER_P( object ); /* Return formatter's last error code. */ - RETURN_LONG( INTL_DATA_ERROR_CODE(dfo) ); + RETURN_INT( INTL_DATA_ERROR_CODE(dfo) ); } /* }}} */ diff --git a/ext/intl/dateformat/dateformat_attr.c b/ext/intl/dateformat/dateformat_attr.c index e13b0f4cd2..a451054554 100644 --- a/ext/intl/dateformat/dateformat_attr.c +++ b/ext/intl/dateformat/dateformat_attr.c @@ -48,7 +48,7 @@ PHP_FUNCTION( datefmt_get_datetype ) INTL_METHOD_CHECK_STATUS(dfo, "Error getting formatter datetype." ); - RETURN_LONG(dfo->date_type ); + RETURN_INT(dfo->date_type ); } /* }}} */ @@ -74,7 +74,7 @@ PHP_FUNCTION( datefmt_get_timetype ) INTL_METHOD_CHECK_STATUS(dfo, "Error getting formatter timetype." ); - RETURN_LONG(dfo->time_type ); + RETURN_INT(dfo->time_type ); } /* }}} */ diff --git a/ext/intl/dateformat/dateformat_attrcpp.cpp b/ext/intl/dateformat/dateformat_attrcpp.cpp index 8ca880d956..269b1cdce2 100644 --- a/ext/intl/dateformat/dateformat_attrcpp.cpp +++ b/ext/intl/dateformat/dateformat_attrcpp.cpp @@ -160,7 +160,7 @@ U_CFUNC PHP_FUNCTION(datefmt_get_calendar) RETURN_FALSE; } - RETURN_LONG(dfo->calendar); + RETURN_INT(dfo->calendar); } /* }}} */ diff --git a/ext/intl/dateformat/dateformat_format.c b/ext/intl/dateformat/dateformat_format.c index 467053ef84..9ec012c570 100644 --- a/ext/intl/dateformat/dateformat_format.c +++ b/ext/intl/dateformat/dateformat_format.c @@ -71,21 +71,21 @@ static int32_t internal_get_arr_ele(IntlDateFormatter_object *dfo, } if ((ele_value = zend_hash_str_find(hash_arr, key_name, strlen(key_name))) != NULL) { - if(Z_TYPE_P(ele_value) != IS_LONG) { + if(Z_TYPE_P(ele_value) != IS_INT) { spprintf(&message, 0, "datefmt_format: parameter array contains " "a non-integer element for key '%s'", key_name); intl_errors_set(err, U_ILLEGAL_ARGUMENT_ERROR, message, 1 TSRMLS_CC); efree(message); } else { - if (Z_LVAL_P(ele_value) > INT32_MAX || - Z_LVAL_P(ele_value) < INT32_MIN) { + if (Z_IVAL_P(ele_value) > INT32_MAX || + Z_IVAL_P(ele_value) < INT32_MIN) { spprintf(&message, 0, "datefmt_format: value %ld is out of " "bounds for a 32-bit integer in key '%s'", - Z_LVAL_P(ele_value), key_name); + Z_IVAL_P(ele_value), key_name); intl_errors_set(err, U_ILLEGAL_ARGUMENT_ERROR, message, 1 TSRMLS_CC); efree(message); } else { - result = Z_LVAL_P(ele_value); + result = Z_IVAL_P(ele_value); } } } diff --git a/ext/intl/dateformat/dateformat_format_object.cpp b/ext/intl/dateformat/dateformat_format_object.cpp index ac8aa2fe4c..b0c8cc1653 100644 --- a/ext/intl/dateformat/dateformat_format_object.cpp +++ b/ext/intl/dateformat/dateformat_format_object.cpp @@ -46,8 +46,8 @@ static const DateFormat::EStyle valid_styles[] = { }; static bool valid_format(zval *z) { - if (Z_TYPE_P(z) == IS_LONG) { - long lval = Z_LVAL_P(z); + if (Z_TYPE_P(z) == IS_INT) { + long lval = Z_IVAL_P(z); for (int i = 0; i < sizeof(valid_styles) / sizeof(*valid_styles); i++) { if ((long)valid_styles[i] == lval) { return true; @@ -103,7 +103,7 @@ U_CFUNC PHP_FUNCTION(datefmt_format_object) "element of the array) is not valid", 0 TSRMLS_CC); RETURN_FALSE; } - dateStyle = (DateFormat::EStyle)Z_LVAL_P(z); + dateStyle = (DateFormat::EStyle)Z_IVAL_P(z); zend_hash_move_forward_ex(ht, &pos); z = zend_hash_get_current_data_ex(ht, &pos); @@ -113,18 +113,18 @@ U_CFUNC PHP_FUNCTION(datefmt_format_object) "second element of the array) is not valid", 0 TSRMLS_CC); RETURN_FALSE; } - timeStyle = (DateFormat::EStyle)Z_LVAL_P(z); - } else if (Z_TYPE_P(format) == IS_LONG) { + timeStyle = (DateFormat::EStyle)Z_IVAL_P(z); + } else if (Z_TYPE_P(format) == IS_INT) { if (!valid_format(format)) { intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, "datefmt_format_object: the date/time format type is invalid", 0 TSRMLS_CC); RETURN_FALSE; } - dateStyle = timeStyle = (DateFormat::EStyle)Z_LVAL_P(format); + dateStyle = timeStyle = (DateFormat::EStyle)Z_IVAL_P(format); } else { convert_to_string_ex(format); - if (Z_STRLEN_P(format) == 0) { + if (Z_STRSIZE_P(format) == 0) { intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, "datefmt_format_object: the format is empty", 0 TSRMLS_CC); RETURN_FALSE; @@ -176,7 +176,7 @@ U_CFUNC PHP_FUNCTION(datefmt_format_object) if (pattern) { df = new SimpleDateFormat( - UnicodeString(Z_STRVAL_P(format), Z_STRLEN_P(format), + UnicodeString(Z_STRVAL_P(format), Z_STRSIZE_P(format), UnicodeString::kInvariant), Locale::createFromName(locale_str), status); diff --git a/ext/intl/dateformat/dateformat_helpers.cpp b/ext/intl/dateformat/dateformat_helpers.cpp index 74758bbec9..f3c184e168 100644 --- a/ext/intl/dateformat/dateformat_helpers.cpp +++ b/ext/intl/dateformat/dateformat_helpers.cpp @@ -47,9 +47,9 @@ int datefmt_process_calendar_arg(zval* calendar_zv, cal_int_type = UCAL_GREGORIAN; - } else if (Z_TYPE_P(calendar_zv) == IS_LONG) { + } else if (Z_TYPE_P(calendar_zv) == IS_INT) { - long v = Z_LVAL_P(calendar_zv); + long v = Z_IVAL_P(calendar_zv); if (v != (long)UCAL_TRADITIONAL && v != (long)UCAL_GREGORIAN) { spprintf(&msg, 0, "%s: invalid value for calendar type; it must be " "one of IntlDateFormatter::TRADITIONAL (locale's default " @@ -66,7 +66,7 @@ int datefmt_process_calendar_arg(zval* calendar_zv, } calendar_owned = true; - cal_int_type = Z_LVAL_P(calendar_zv); + cal_int_type = Z_IVAL_P(calendar_zv); } else if (Z_TYPE_P(calendar_zv) == IS_OBJECT && instanceof_function_ex(Z_OBJCE_P(calendar_zv), diff --git a/ext/intl/dateformat/dateformat_parse.c b/ext/intl/dateformat/dateformat_parse.c index fb3da3e053..70d640ac2e 100644 --- a/ext/intl/dateformat/dateformat_parse.c +++ b/ext/intl/dateformat/dateformat_parse.c @@ -57,7 +57,7 @@ static void internal_parse_to_timestamp(IntlDateFormatter_object *dfo, char* tex if(result > LONG_MAX || result < -LONG_MAX) { ZVAL_DOUBLE(return_value, result<0?ceil(result):floor(result)); } else { - ZVAL_LONG(return_value, (long)result); + ZVAL_INT(return_value, (long)result); } } /* }}} */ @@ -69,12 +69,12 @@ static void add_to_localtime_arr( IntlDateFormatter_object *dfo, zval* return_va if( strcmp(key_name, CALENDAR_YEAR )==0 ){ /* since tm_year is years from 1900 */ - add_assoc_long( return_value, key_name,( calendar_field_val-1900) ); + add_assoc_int( return_value, key_name,( calendar_field_val-1900) ); }else if( strcmp(key_name, CALENDAR_WDAY )==0 ){ /* since tm_wday starts from 0 whereas ICU WDAY start from 1 */ - add_assoc_long( return_value, key_name,( calendar_field_val-1) ); + add_assoc_int( return_value, key_name,( calendar_field_val-1) ); }else{ - add_assoc_long( return_value, key_name, calendar_field_val ); + add_assoc_int( return_value, key_name, calendar_field_val ); } } @@ -116,7 +116,7 @@ static void internal_parse_to_localtime(IntlDateFormatter_object *dfo, char* tex /* Is in DST? */ isInDST = ucal_inDaylightTime(parsed_calendar , &INTL_DATA_ERROR_CODE(dfo)); INTL_METHOD_CHECK_STATUS( dfo, "Date parsing - localtime failed : while checking if currently in DST." ); - add_assoc_long( return_value, CALENDAR_ISDST,(isInDST==1?1:0)); + add_assoc_int( return_value, CALENDAR_ISDST,(isInDST==1?1:0)); } /* }}} */ @@ -146,8 +146,8 @@ PHP_FUNCTION(datefmt_parse) if (z_parse_pos) { ZVAL_DEREF(z_parse_pos); - convert_to_long(z_parse_pos); - parse_pos = (int32_t)Z_LVAL_P(z_parse_pos); + convert_to_int(z_parse_pos); + parse_pos = (int32_t)Z_IVAL_P(z_parse_pos); if(parse_pos > text_len) { RETURN_FALSE; } @@ -155,7 +155,7 @@ PHP_FUNCTION(datefmt_parse) internal_parse_to_timestamp( dfo, text_to_parse, text_len, z_parse_pos?&parse_pos:NULL, return_value TSRMLS_CC); if(z_parse_pos) { zval_dtor(z_parse_pos); - ZVAL_LONG(z_parse_pos, parse_pos); + ZVAL_INT(z_parse_pos, parse_pos); } } /* }}} */ @@ -185,8 +185,8 @@ PHP_FUNCTION(datefmt_localtime) if (z_parse_pos) { ZVAL_DEREF(z_parse_pos); - convert_to_long(z_parse_pos); - parse_pos = (int32_t)Z_LVAL_P(z_parse_pos); + convert_to_int(z_parse_pos); + parse_pos = (int32_t)Z_IVAL_P(z_parse_pos); if(parse_pos > text_len) { RETURN_FALSE; } @@ -194,7 +194,7 @@ PHP_FUNCTION(datefmt_localtime) internal_parse_to_localtime( dfo, text_to_parse, text_len, z_parse_pos?&parse_pos:NULL, return_value TSRMLS_CC); if (z_parse_pos) { zval_dtor(z_parse_pos); - ZVAL_LONG(z_parse_pos, parse_pos); + ZVAL_INT(z_parse_pos, parse_pos); } } /* }}} */ diff --git a/ext/intl/formatter/formatter.c b/ext/intl/formatter/formatter.c index 12cbb6c75b..2c3ffaa569 100644 --- a/ext/intl/formatter/formatter.c +++ b/ext/intl/formatter/formatter.c @@ -40,9 +40,9 @@ void formatter_register_constants( INIT_FUNC_ARGS ) zend_error(E_ERROR, "NumberFormatter class not defined"); } - #define FORMATTER_EXPOSE_CONST(x) REGISTER_LONG_CONSTANT(#x, x, CONST_PERSISTENT | CONST_CS) - #define FORMATTER_EXPOSE_CLASS_CONST(x) zend_declare_class_constant_long( NumberFormatter_ce_ptr, ZEND_STRS( #x ) - 1, UNUM_##x TSRMLS_CC ); - #define FORMATTER_EXPOSE_CUSTOM_CLASS_CONST(name, value) zend_declare_class_constant_long( NumberFormatter_ce_ptr, ZEND_STRS( name ) - 1, value TSRMLS_CC ); + #define FORMATTER_EXPOSE_CONST(x) REGISTER_INT_CONSTANT(#x, x, CONST_PERSISTENT | CONST_CS) + #define FORMATTER_EXPOSE_CLASS_CONST(x) zend_declare_class_constant_int( NumberFormatter_ce_ptr, ZEND_STRS( #x ) - 1, UNUM_##x TSRMLS_CC ); + #define FORMATTER_EXPOSE_CUSTOM_CLASS_CONST(name, value) zend_declare_class_constant_int( NumberFormatter_ce_ptr, ZEND_STRS( name ) - 1, value TSRMLS_CC ); /* UNumberFormatStyle constants */ FORMATTER_EXPOSE_CLASS_CONST( PATTERN_DECIMAL ); diff --git a/ext/intl/formatter/formatter_attr.c b/ext/intl/formatter/formatter_attr.c index af58cfe37f..d58d331ffd 100644 --- a/ext/intl/formatter/formatter_attr.c +++ b/ext/intl/formatter/formatter_attr.c @@ -72,7 +72,7 @@ PHP_FUNCTION( numfmt_get_attribute ) if(value == -1) { INTL_DATA_ERROR_CODE(nfo) = U_UNSUPPORTED_ERROR; } else { - RETVAL_LONG(value); + RETVAL_INT(value); } break; case UNUM_ROUNDING_INCREMENT: @@ -182,8 +182,8 @@ PHP_FUNCTION( numfmt_set_attribute ) case UNUM_MIN_SIGNIFICANT_DIGITS: case UNUM_MAX_SIGNIFICANT_DIGITS: case UNUM_LENIENT_PARSE: - convert_to_long_ex(value); - unum_setAttribute(FORMATTER_OBJECT(nfo), attribute, Z_LVAL_P(value)); + convert_to_int_ex(value); + unum_setAttribute(FORMATTER_OBJECT(nfo), attribute, Z_IVAL_P(value)); break; case UNUM_ROUNDING_INCREMENT: convert_to_double_ex(value); diff --git a/ext/intl/formatter/formatter_format.c b/ext/intl/formatter/formatter_format.c index 4b98f4fb17..a51c9876b7 100644 --- a/ext/intl/formatter/formatter_format.c +++ b/ext/intl/formatter/formatter_format.c @@ -57,7 +57,7 @@ PHP_FUNCTION( numfmt_format ) convert_scalar_to_number_ex(number); } - if(Z_TYPE_P(number) == IS_LONG) { + if(Z_TYPE_P(number) == IS_INT) { /* take INT32 on 32-bit, int64 on 64-bit */ type = (sizeof(long) == 8)?FORMAT_TYPE_INT64:FORMAT_TYPE_INT32; } else if(Z_TYPE_P(number) == IS_DOUBLE) { @@ -67,20 +67,20 @@ PHP_FUNCTION( numfmt_format ) } } - if(Z_TYPE_P(number) != IS_DOUBLE && Z_TYPE_P(number) != IS_LONG) { + if(Z_TYPE_P(number) != IS_DOUBLE && Z_TYPE_P(number) != IS_INT) { SEPARATE_ZVAL_IF_NOT_REF(number); convert_scalar_to_number(number TSRMLS_CC ); } switch(type) { case FORMAT_TYPE_INT32: - convert_to_long_ex(number); - formatted_len = unum_format(FORMATTER_OBJECT(nfo), (int32_t)Z_LVAL_P(number), + convert_to_int_ex(number); + formatted_len = unum_format(FORMATTER_OBJECT(nfo), (int32_t)Z_IVAL_P(number), formatted, formatted_len, NULL, &INTL_DATA_ERROR_CODE(nfo)); if (INTL_DATA_ERROR_CODE(nfo) == U_BUFFER_OVERFLOW_ERROR) { intl_error_reset(INTL_DATA_ERROR_P(nfo) TSRMLS_CC); formatted = eumalloc(formatted_len); - formatted_len = unum_format(FORMATTER_OBJECT(nfo), (int32_t)Z_LVAL_P(number), + formatted_len = unum_format(FORMATTER_OBJECT(nfo), (int32_t)Z_IVAL_P(number), formatted, formatted_len, NULL, &INTL_DATA_ERROR_CODE(nfo)); if (U_FAILURE( INTL_DATA_ERROR_CODE(nfo) ) ) { efree(formatted); @@ -91,7 +91,7 @@ PHP_FUNCTION( numfmt_format ) case FORMAT_TYPE_INT64: { - int64_t value = (Z_TYPE_P(number) == IS_DOUBLE)?(int64_t)Z_DVAL_P(number):Z_LVAL_P(number); + int64_t value = (Z_TYPE_P(number) == IS_DOUBLE)?(int64_t)Z_DVAL_P(number):Z_IVAL_P(number); formatted_len = unum_formatInt64(FORMATTER_OBJECT(nfo), value, formatted, formatted_len, NULL, &INTL_DATA_ERROR_CODE(nfo)); if (INTL_DATA_ERROR_CODE(nfo) == U_BUFFER_OVERFLOW_ERROR) { intl_error_reset(INTL_DATA_ERROR_P(nfo) TSRMLS_CC); diff --git a/ext/intl/formatter/formatter_main.c b/ext/intl/formatter/formatter_main.c index 26473ebe78..3bb46c3204 100644 --- a/ext/intl/formatter/formatter_main.c +++ b/ext/intl/formatter/formatter_main.c @@ -125,7 +125,7 @@ PHP_FUNCTION( numfmt_get_error_code ) nfo = Z_INTL_NUMBERFORMATTER_P(object); /* Return formatter's last error code. */ - RETURN_LONG( INTL_DATA_ERROR_CODE(nfo) ); + RETURN_INT( INTL_DATA_ERROR_CODE(nfo) ); } /* }}} */ diff --git a/ext/intl/formatter/formatter_parse.c b/ext/intl/formatter/formatter_parse.c index 73b331302b..57ab4e28d8 100644 --- a/ext/intl/formatter/formatter_parse.c +++ b/ext/intl/formatter/formatter_parse.c @@ -68,8 +68,8 @@ PHP_FUNCTION( numfmt_parse ) if(zposition) { ZVAL_DEREF(zposition); - convert_to_long(zposition); - position = (int32_t)Z_LVAL_P( zposition ); + convert_to_int(zposition); + position = (int32_t)Z_IVAL_P( zposition ); position_p = &position; } @@ -82,14 +82,14 @@ PHP_FUNCTION( numfmt_parse ) switch(type) { case FORMAT_TYPE_INT32: val32 = unum_parse(FORMATTER_OBJECT(nfo), sstr, sstr_len, position_p, &INTL_DATA_ERROR_CODE(nfo)); - RETVAL_LONG(val32); + RETVAL_INT(val32); break; case FORMAT_TYPE_INT64: val64 = unum_parseInt64(FORMATTER_OBJECT(nfo), sstr, sstr_len, position_p, &INTL_DATA_ERROR_CODE(nfo)); if(val64 > LONG_MAX || val64 < LONG_MIN) { RETVAL_DOUBLE(val64); } else { - RETVAL_LONG((long)val64); + RETVAL_INT((long)val64); } break; case FORMAT_TYPE_DOUBLE: @@ -107,7 +107,7 @@ PHP_FUNCTION( numfmt_parse ) #endif if(zposition) { zval_dtor(zposition); - ZVAL_LONG(zposition, position); + ZVAL_INT(zposition, position); } if (sstr) { @@ -157,15 +157,15 @@ PHP_FUNCTION( numfmt_parse_currency ) if(zposition) { ZVAL_DEREF(zposition); - convert_to_long(zposition); - position = (int32_t)Z_LVAL_P( zposition ); + convert_to_int(zposition); + position = (int32_t)Z_IVAL_P( zposition ); position_p = &position; } number = unum_parseDoubleCurrency(FORMATTER_OBJECT(nfo), sstr, sstr_len, position_p, currency, &INTL_DATA_ERROR_CODE(nfo)); if(zposition) { zval_dtor(zposition); - ZVAL_LONG(zposition, position); + ZVAL_INT(zposition, position); } if (sstr) { efree(sstr); diff --git a/ext/intl/grapheme/grapheme_string.c b/ext/intl/grapheme/grapheme_string.c index 5caacb4f28..705eb31b9b 100644 --- a/ext/intl/grapheme/grapheme_string.c +++ b/ext/intl/grapheme/grapheme_string.c @@ -44,9 +44,9 @@ */ void grapheme_register_constants( INIT_FUNC_ARGS ) { - REGISTER_LONG_CONSTANT("GRAPHEME_EXTR_COUNT", GRAPHEME_EXTRACT_TYPE_COUNT, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("GRAPHEME_EXTR_MAXBYTES", GRAPHEME_EXTRACT_TYPE_MAXBYTES, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("GRAPHEME_EXTR_MAXCHARS", GRAPHEME_EXTRACT_TYPE_MAXCHARS, CONST_CS | CONST_PERSISTENT); + REGISTER_INT_CONSTANT("GRAPHEME_EXTR_COUNT", GRAPHEME_EXTRACT_TYPE_COUNT, CONST_CS | CONST_PERSISTENT); + REGISTER_INT_CONSTANT("GRAPHEME_EXTR_MAXBYTES", GRAPHEME_EXTRACT_TYPE_MAXBYTES, CONST_CS | CONST_PERSISTENT); + REGISTER_INT_CONSTANT("GRAPHEME_EXTR_MAXCHARS", GRAPHEME_EXTRACT_TYPE_MAXCHARS, CONST_CS | CONST_PERSISTENT); } /* }}} */ @@ -72,7 +72,7 @@ PHP_FUNCTION(grapheme_strlen) ret_len = grapheme_ascii_check(string, string_len); if ( ret_len >= 0 ) - RETURN_LONG(ret_len); + RETURN_INT(ret_len); /* convert the string to UTF-16. */ status = U_ZERO_ERROR; @@ -97,7 +97,7 @@ PHP_FUNCTION(grapheme_strlen) } if (ret_len >= 0) { - RETVAL_LONG(ret_len); + RETVAL_INT(ret_len); } else { RETVAL_FALSE; } @@ -156,14 +156,14 @@ PHP_FUNCTION(grapheme_strpos) /* if it is there, and if the haystack is ascii, we are all done */ if ( grapheme_ascii_check(haystack, haystack_len) >= 0 ) { - RETURN_LONG(found - haystack); + RETURN_INT(found - haystack); } /* do utf16 part of the strpos */ ret_pos = grapheme_strpos_utf16(haystack, haystack_len, needle, needle_len, offset, NULL, 0 /* fIgnoreCase */, 0 /* last */ TSRMLS_CC ); if ( ret_pos >= 0 ) { - RETURN_LONG(ret_pos); + RETURN_INT(ret_pos); } else { RETURN_FALSE; } @@ -225,7 +225,7 @@ PHP_FUNCTION(grapheme_stripos) efree(needle_dup); if (found) { - RETURN_LONG(found - haystack_dup); + RETURN_INT(found - haystack_dup); } /* if needle was ascii too, we are all done, otherwise we need to try using Unicode to see what we get */ @@ -238,7 +238,7 @@ PHP_FUNCTION(grapheme_stripos) ret_pos = grapheme_strpos_utf16(haystack, haystack_len, needle, needle_len, offset, NULL, 1 /* fIgnoreCase */, 0 /*last */ TSRMLS_CC ); if ( ret_pos >= 0 ) { - RETURN_LONG(ret_pos); + RETURN_INT(ret_pos); } else { RETURN_FALSE; } @@ -292,7 +292,7 @@ PHP_FUNCTION(grapheme_strrpos) if ( ret_pos >= 0 ) { - RETURN_LONG(ret_pos); + RETURN_INT(ret_pos); } /* if the needle was ascii too, we are done */ @@ -307,7 +307,7 @@ PHP_FUNCTION(grapheme_strrpos) ret_pos = grapheme_strpos_utf16(haystack, haystack_len, needle, needle_len, offset, NULL, 0 /* f_ignore_case */, 1/* last */ TSRMLS_CC); if ( ret_pos >= 0 ) { - RETURN_LONG(ret_pos); + RETURN_INT(ret_pos); } else { RETURN_FALSE; } @@ -370,7 +370,7 @@ PHP_FUNCTION(grapheme_strripos) efree(needle_dup); if ( ret_pos >= 0 ) { - RETURN_LONG(ret_pos); + RETURN_INT(ret_pos); } /* if the needle was ascii too, we are done */ @@ -385,7 +385,7 @@ PHP_FUNCTION(grapheme_strripos) ret_pos = grapheme_strpos_utf16(haystack, haystack_len, needle, needle_len, offset, NULL, 1 /* f_ignore_case */, 1 /*last */ TSRMLS_CC); if ( ret_pos >= 0 ) { - RETURN_LONG(ret_pos); + RETURN_INT(ret_pos); } else { RETURN_FALSE; } @@ -846,7 +846,7 @@ PHP_FUNCTION(grapheme_extract) /* initialize next */ SEPARATE_ZVAL(next); zval_dtor(next); - ZVAL_LONG(next, lstart); + ZVAL_INT(next, lstart); } } @@ -900,7 +900,7 @@ PHP_FUNCTION(grapheme_extract) if ( -1 != grapheme_ascii_check(pstr, size + 1 < str_len ? size + 1 : str_len ) ) { long nsize = ( size < str_len ? size : str_len ); if ( NULL != next ) { - ZVAL_LONG(next, start+nsize); + ZVAL_INT(next, start+nsize); } RETURN_STRINGL(((char *)pstr), nsize); } @@ -943,7 +943,7 @@ PHP_FUNCTION(grapheme_extract) ubrk_close(bi); if ( NULL != next ) { - ZVAL_LONG(next, start+ret_pos); + ZVAL_INT(next, start+ret_pos); } RETURN_STRINGL(((char *)pstr), ret_pos); diff --git a/ext/intl/idn/idn.c b/ext/intl/idn/idn.c index 6bf187a068..78892025b3 100644 --- a/ext/intl/idn/idn.c +++ b/ext/intl/idn/idn.c @@ -51,56 +51,56 @@ void idn_register_constants( INIT_FUNC_ARGS ) /* Option to prohibit processing of unassigned codepoints in the input and do not check if the input conforms to STD-3 ASCII rules. */ - REGISTER_LONG_CONSTANT("IDNA_DEFAULT", UIDNA_DEFAULT, CONST_CS | CONST_PERSISTENT); + REGISTER_INT_CONSTANT("IDNA_DEFAULT", UIDNA_DEFAULT, CONST_CS | CONST_PERSISTENT); /* Option to allow processing of unassigned codepoints in the input */ - REGISTER_LONG_CONSTANT("IDNA_ALLOW_UNASSIGNED", UIDNA_ALLOW_UNASSIGNED, CONST_CS | CONST_PERSISTENT); + REGISTER_INT_CONSTANT("IDNA_ALLOW_UNASSIGNED", UIDNA_ALLOW_UNASSIGNED, CONST_CS | CONST_PERSISTENT); /* Option to check if input conforms to STD-3 ASCII rules */ - REGISTER_LONG_CONSTANT("IDNA_USE_STD3_RULES", UIDNA_USE_STD3_RULES, CONST_CS | CONST_PERSISTENT); + REGISTER_INT_CONSTANT("IDNA_USE_STD3_RULES", UIDNA_USE_STD3_RULES, CONST_CS | CONST_PERSISTENT); #ifdef HAVE_46_API /* Option to check for whether the input conforms to the BiDi rules. * Ignored by the IDNA2003 implementation. (IDNA2003 always performs a BiDi check.) */ - REGISTER_LONG_CONSTANT("IDNA_CHECK_BIDI", UIDNA_CHECK_BIDI, CONST_CS | CONST_PERSISTENT); + REGISTER_INT_CONSTANT("IDNA_CHECK_BIDI", UIDNA_CHECK_BIDI, CONST_CS | CONST_PERSISTENT); /* Option to check for whether the input conforms to the CONTEXTJ rules. * Ignored by the IDNA2003 implementation. (The CONTEXTJ check is new in IDNA2008.) */ - REGISTER_LONG_CONSTANT("IDNA_CHECK_CONTEXTJ", UIDNA_CHECK_CONTEXTJ, CONST_CS | CONST_PERSISTENT); + REGISTER_INT_CONSTANT("IDNA_CHECK_CONTEXTJ", UIDNA_CHECK_CONTEXTJ, CONST_CS | CONST_PERSISTENT); /* Option for nontransitional processing in ToASCII(). * By default, ToASCII() uses transitional processing. * Ignored by the IDNA2003 implementation. */ - REGISTER_LONG_CONSTANT("IDNA_NONTRANSITIONAL_TO_ASCII", UIDNA_NONTRANSITIONAL_TO_ASCII, CONST_CS | CONST_PERSISTENT); + REGISTER_INT_CONSTANT("IDNA_NONTRANSITIONAL_TO_ASCII", UIDNA_NONTRANSITIONAL_TO_ASCII, CONST_CS | CONST_PERSISTENT); /* Option for nontransitional processing in ToUnicode(). * By default, ToUnicode() uses transitional processing. * Ignored by the IDNA2003 implementation. */ - REGISTER_LONG_CONSTANT("IDNA_NONTRANSITIONAL_TO_UNICODE", UIDNA_NONTRANSITIONAL_TO_UNICODE, CONST_CS | CONST_PERSISTENT); + REGISTER_INT_CONSTANT("IDNA_NONTRANSITIONAL_TO_UNICODE", UIDNA_NONTRANSITIONAL_TO_UNICODE, CONST_CS | CONST_PERSISTENT); #endif /* VARIANTS */ - REGISTER_LONG_CONSTANT("INTL_IDNA_VARIANT_2003", INTL_IDN_VARIANT_2003, CONST_CS | CONST_PERSISTENT); + REGISTER_INT_CONSTANT("INTL_IDNA_VARIANT_2003", INTL_IDN_VARIANT_2003, CONST_CS | CONST_PERSISTENT); #ifdef HAVE_46_API - REGISTER_LONG_CONSTANT("INTL_IDNA_VARIANT_UTS46", INTL_IDN_VARIANT_UTS46, CONST_CS | CONST_PERSISTENT); + REGISTER_INT_CONSTANT("INTL_IDNA_VARIANT_UTS46", INTL_IDN_VARIANT_UTS46, CONST_CS | CONST_PERSISTENT); #endif #ifdef HAVE_46_API /* PINFO ERROR CODES */ - REGISTER_LONG_CONSTANT("IDNA_ERROR_EMPTY_LABEL", UIDNA_ERROR_EMPTY_LABEL, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("IDNA_ERROR_LABEL_TOO_LONG", UIDNA_ERROR_LABEL_TOO_LONG, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("IDNA_ERROR_DOMAIN_NAME_TOO_LONG", UIDNA_ERROR_DOMAIN_NAME_TOO_LONG, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("IDNA_ERROR_LEADING_HYPHEN", UIDNA_ERROR_LEADING_HYPHEN, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("IDNA_ERROR_TRAILING_HYPHEN", UIDNA_ERROR_TRAILING_HYPHEN, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("IDNA_ERROR_HYPHEN_3_4", UIDNA_ERROR_HYPHEN_3_4, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("IDNA_ERROR_LEADING_COMBINING_MARK", UIDNA_ERROR_LEADING_COMBINING_MARK, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("IDNA_ERROR_DISALLOWED", UIDNA_ERROR_DISALLOWED, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("IDNA_ERROR_PUNYCODE", UIDNA_ERROR_PUNYCODE, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("IDNA_ERROR_LABEL_HAS_DOT", UIDNA_ERROR_LABEL_HAS_DOT, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("IDNA_ERROR_INVALID_ACE_LABEL", UIDNA_ERROR_INVALID_ACE_LABEL, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("IDNA_ERROR_BIDI", UIDNA_ERROR_BIDI, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("IDNA_ERROR_CONTEXTJ", UIDNA_ERROR_CONTEXTJ, CONST_CS | CONST_PERSISTENT); + REGISTER_INT_CONSTANT("IDNA_ERROR_EMPTY_LABEL", UIDNA_ERROR_EMPTY_LABEL, CONST_CS | CONST_PERSISTENT); + REGISTER_INT_CONSTANT("IDNA_ERROR_LABEL_TOO_LONG", UIDNA_ERROR_LABEL_TOO_LONG, CONST_CS | CONST_PERSISTENT); + REGISTER_INT_CONSTANT("IDNA_ERROR_DOMAIN_NAME_TOO_LONG", UIDNA_ERROR_DOMAIN_NAME_TOO_LONG, CONST_CS | CONST_PERSISTENT); + REGISTER_INT_CONSTANT("IDNA_ERROR_LEADING_HYPHEN", UIDNA_ERROR_LEADING_HYPHEN, CONST_CS | CONST_PERSISTENT); + REGISTER_INT_CONSTANT("IDNA_ERROR_TRAILING_HYPHEN", UIDNA_ERROR_TRAILING_HYPHEN, CONST_CS | CONST_PERSISTENT); + REGISTER_INT_CONSTANT("IDNA_ERROR_HYPHEN_3_4", UIDNA_ERROR_HYPHEN_3_4, CONST_CS | CONST_PERSISTENT); + REGISTER_INT_CONSTANT("IDNA_ERROR_LEADING_COMBINING_MARK", UIDNA_ERROR_LEADING_COMBINING_MARK, CONST_CS | CONST_PERSISTENT); + REGISTER_INT_CONSTANT("IDNA_ERROR_DISALLOWED", UIDNA_ERROR_DISALLOWED, CONST_CS | CONST_PERSISTENT); + REGISTER_INT_CONSTANT("IDNA_ERROR_PUNYCODE", UIDNA_ERROR_PUNYCODE, CONST_CS | CONST_PERSISTENT); + REGISTER_INT_CONSTANT("IDNA_ERROR_LABEL_HAS_DOT", UIDNA_ERROR_LABEL_HAS_DOT, CONST_CS | CONST_PERSISTENT); + REGISTER_INT_CONSTANT("IDNA_ERROR_INVALID_ACE_LABEL", UIDNA_ERROR_INVALID_ACE_LABEL, CONST_CS | CONST_PERSISTENT); + REGISTER_INT_CONSTANT("IDNA_ERROR_BIDI", UIDNA_ERROR_BIDI, CONST_CS | CONST_PERSISTENT); + REGISTER_INT_CONSTANT("IDNA_ERROR_CONTEXTJ", UIDNA_ERROR_CONTEXTJ, CONST_CS | CONST_PERSISTENT); #endif } /* }}} */ @@ -190,7 +190,7 @@ static void php_intl_idn_to_46(INTERNAL_FUNCTION_PARAMETERS, } add_assoc_bool_ex(idna_info, "isTransitionalDifferent", sizeof("isTransitionalDifferent")-1, info.isTransitionalDifferent); - add_assoc_long_ex(idna_info, "errors", sizeof("errors")-1, (long)info.errors); + add_assoc_int_ex(idna_info, "errors", sizeof("errors")-1, (long)info.errors); } if (!buffer_used) { diff --git a/ext/intl/intl_common.h b/ext/intl/intl_common.h index 9424571d02..cf83e6d7ee 100644 --- a/ext/intl/intl_common.h +++ b/ext/intl/intl_common.h @@ -39,6 +39,6 @@ #define UCHARS(len) ((len) / sizeof(UChar)) #define INTL_Z_STRVAL_P(str) (UChar*) Z_STRVAL_P(str) -#define INTL_Z_STRLEN_P(str) UCHARS( Z_STRLEN_P(str) ) +#define INTL_Z_STRSIZE_P(str) UCHARS( Z_STRSIZE_P(str) ) #endif /* INTL_COMMON_H */ diff --git a/ext/intl/intl_error.c b/ext/intl/intl_error.c index e692e5dc0d..d7f215d4e4 100644 --- a/ext/intl/intl_error.c +++ b/ext/intl/intl_error.c @@ -258,7 +258,7 @@ smart_str intl_parse_error_to_string( UParseError* pe ) if( pe->line > 0 ) { smart_str_appends( &ret, "on line " ); - smart_str_append_long( &ret, (long ) pe->line ); + smart_str_append_int( &ret, (long ) pe->line ); any = 1; } if( pe->offset >= 0 ) { @@ -268,7 +268,7 @@ smart_str intl_parse_error_to_string( UParseError* pe ) smart_str_appends( &ret, "at " ); smart_str_appends( &ret, "offset " ); - smart_str_append_long( &ret, (long ) pe->offset ); + smart_str_append_int( &ret, (long ) pe->offset ); any = 1; } diff --git a/ext/intl/locale/locale.c b/ext/intl/locale/locale.c index 921e6e589f..fa8edddfa3 100644 --- a/ext/intl/locale/locale.c +++ b/ext/intl/locale/locale.c @@ -39,8 +39,8 @@ void locale_register_constants( INIT_FUNC_ARGS ) return; } - #define LOCALE_EXPOSE_CONST(x) REGISTER_LONG_CONSTANT(#x, x, CONST_PERSISTENT | CONST_CS) - #define LOCALE_EXPOSE_CLASS_CONST(x) zend_declare_class_constant_long( Locale_ce_ptr, ZEND_STRS( #x ) - 1, ULOC_##x TSRMLS_CC ); + #define LOCALE_EXPOSE_CONST(x) REGISTER_INT_CONSTANT(#x, x, CONST_PERSISTENT | CONST_CS) + #define LOCALE_EXPOSE_CLASS_CONST(x) zend_declare_class_constant_int( Locale_ce_ptr, ZEND_STRS( #x ) - 1, ULOC_##x TSRMLS_CC ); #define LOCALE_EXPOSE_CUSTOM_CLASS_CONST_STR(name, value) zend_declare_class_constant_string( Locale_ce_ptr, ZEND_STRS( name ) - 1, value TSRMLS_CC ); LOCALE_EXPOSE_CLASS_CONST( ACTUAL_LOCALE ); diff --git a/ext/intl/locale/locale_methods.c b/ext/intl/locale/locale_methods.c index 01cbddd062..34e7374969 100644 --- a/ext/intl/locale/locale_methods.c +++ b/ext/intl/locale/locale_methods.c @@ -782,7 +782,7 @@ static int append_key_value(smart_str* loc_name, HashTable* hash_arr, char* key_ /* not lang or grandfathered tag */ smart_str_appendl(loc_name, SEPARATOR , sizeof(SEPARATOR)-1); } - smart_str_appendl(loc_name, Z_STRVAL_P(ele_value) , Z_STRLEN_P(ele_value)); + smart_str_appendl(loc_name, Z_STRVAL_P(ele_value) , Z_STRSIZE_P(ele_value)); return SUCCESS; } @@ -822,7 +822,7 @@ static int append_multiple_key_values(smart_str* loc_name, HashTable* hash_arr, add_prefix( loc_name , key_name); smart_str_appendl(loc_name, SEPARATOR , sizeof(SEPARATOR)-1); - smart_str_appendl(loc_name, Z_STRVAL_P(ele_value) , Z_STRLEN_P(ele_value)); + smart_str_appendl(loc_name, Z_STRVAL_P(ele_value) , Z_STRSIZE_P(ele_value)); return SUCCESS; } else if(Z_TYPE_P(ele_value) == IS_ARRAY ) { HashTable *arr = HASH_OF(ele_value); @@ -836,7 +836,7 @@ static int append_multiple_key_values(smart_str* loc_name, HashTable* hash_arr, add_prefix(loc_name , key_name); } smart_str_appendl(loc_name, SEPARATOR , sizeof(SEPARATOR)-1); - smart_str_appendl(loc_name, Z_STRVAL_P(data) , Z_STRLEN_P(data)); + smart_str_appendl(loc_name, Z_STRVAL_P(data) , Z_STRSIZE_P(data)); } ZEND_HASH_FOREACH_END(); return SUCCESS; } else { @@ -869,7 +869,7 @@ static int append_multiple_key_values(smart_str* loc_name, HashTable* hash_arr, add_prefix(loc_name , cur_key_name); } smart_str_appendl(loc_name, SEPARATOR , sizeof(SEPARATOR)-1); - smart_str_appendl(loc_name, Z_STRVAL_P(ele_value) , Z_STRLEN_P(ele_value)); + smart_str_appendl(loc_name, Z_STRVAL_P(ele_value) , Z_STRSIZE_P(ele_value)); } } /* end of for */ } /* end of else */ @@ -1439,7 +1439,7 @@ static char* lookup_loc_range(const char* loc_range, HashTable* hash_arr, int ca intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, "lookup_loc_range: locale array element is not a string", 0 TSRMLS_CC); LOOKUP_CLEAN_RETURN(NULL); } - cur_arr[cur_arr_len*2] = estrndup(Z_STRVAL_P(ele_value), Z_STRLEN_P(ele_value)); + cur_arr[cur_arr_len*2] = estrndup(Z_STRVAL_P(ele_value), Z_STRSIZE_P(ele_value)); result = strToMatch(Z_STRVAL_P(ele_value), cur_arr[cur_arr_len*2]); if(result == 0) { intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, "lookup_loc_range: unable to canonicalize lang_tag", 0 TSRMLS_CC); diff --git a/ext/intl/msgformat/msgformat.c b/ext/intl/msgformat/msgformat.c index b9f6c7a369..cfe6538f0a 100644 --- a/ext/intl/msgformat/msgformat.c +++ b/ext/intl/msgformat/msgformat.c @@ -144,7 +144,7 @@ PHP_FUNCTION( msgfmt_get_error_code ) mfo = Z_INTL_MESSAGEFORMATTER_P( object ); /* Return formatter's last error code. */ - RETURN_LONG( INTL_DATA_ERROR_CODE(mfo) ); + RETURN_INT( INTL_DATA_ERROR_CODE(mfo) ); } /* }}} */ diff --git a/ext/intl/msgformat/msgformat_helpers.cpp b/ext/intl/msgformat/msgformat_helpers.cpp index ba5a5df001..a23f9e87cb 100644 --- a/ext/intl/msgformat/msgformat_helpers.cpp +++ b/ext/intl/msgformat/msgformat_helpers.cpp @@ -447,7 +447,7 @@ U_CFUNC void umsg_format_helper(MessageFormatter_object *mfo, UnicodeString *text = new UnicodeString(); intl_stringFromChar(*text, - Z_STRVAL_P(elem), Z_STRLEN_P(elem), &err.code); + Z_STRVAL_P(elem), Z_STRSIZE_P(elem), &err.code); if (U_FAILURE(err.code)) { char *message; @@ -466,14 +466,14 @@ U_CFUNC void umsg_format_helper(MessageFormatter_object *mfo, double d; if (Z_TYPE_P(elem) == IS_DOUBLE) { d = Z_DVAL_P(elem); - } else if (Z_TYPE_P(elem) == IS_LONG) { - d = (double)Z_LVAL_P(elem); + } else if (Z_TYPE_P(elem) == IS_INT) { + d = (double)Z_IVAL_P(elem); } else { SEPARATE_ZVAL_IF_NOT_REF(elem); convert_scalar_to_number(elem TSRMLS_CC); d = (Z_TYPE_P(elem) == IS_DOUBLE) ? Z_DVAL_P(elem) - : (double)Z_LVAL_P(elem); + : (double)Z_IVAL_P(elem); } formattable.setDouble(d); break; @@ -491,14 +491,14 @@ retry_klong: } else { tInt32 = (int32_t)Z_DVAL_P(elem); } - } else if (Z_TYPE_P(elem) == IS_LONG) { - if (Z_LVAL_P(elem) > INT32_MAX || - Z_LVAL_P(elem) < INT32_MIN) { + } else if (Z_TYPE_P(elem) == IS_INT) { + if (Z_IVAL_P(elem) > INT32_MAX || + Z_IVAL_P(elem) < INT32_MIN) { intl_errors_set(&err, U_ILLEGAL_ARGUMENT_ERROR, "Found PHP integer with absolute value too large " "for 32 bit integer argument", 0 TSRMLS_CC); } else { - tInt32 = (int32_t)Z_LVAL_P(elem); + tInt32 = (int32_t)Z_IVAL_P(elem); } } else { SEPARATE_ZVAL_IF_NOT_REF(elem); @@ -521,9 +521,9 @@ retry_kint64: } else { tInt64 = (int64_t)Z_DVAL_P(elem); } - } else if (Z_TYPE_P(elem) == IS_LONG) { + } else if (Z_TYPE_P(elem) == IS_INT) { /* assume long is not wider than 64 bits */ - tInt64 = (int64_t)Z_LVAL_P(elem); + tInt64 = (int64_t)Z_IVAL_P(elem); } else { SEPARATE_ZVAL_IF_NOT_REF(elem); convert_scalar_to_number(elem TSRMLS_CC); @@ -567,10 +567,10 @@ retry_kint64: break; case IS_TRUE: case IS_FALSE: - convert_to_long_ex(elem); + convert_to_int_ex(elem); /* Intentional fallthrough */ - case IS_LONG: - formattable.setInt64((int64_t)Z_LVAL_P(elem)); + case IS_INT: + formattable.setInt64((int64_t)Z_IVAL_P(elem)); break; case IS_NULL: formattable.setInt64((int64_t)0); @@ -658,7 +658,7 @@ U_CFUNC void umsg_parse_helper(UMessageFormat *fmt, int *count, zval **args, UCh break; case Formattable::kLong: - ZVAL_LONG(&(*args)[i], fargs[i].getLong()); + ZVAL_INT(&(*args)[i], fargs[i].getLong()); break; case Formattable::kInt64: @@ -666,7 +666,7 @@ U_CFUNC void umsg_parse_helper(UMessageFormat *fmt, int *count, zval **args, UCh if(aInt64 > LONG_MAX || aInt64 < -LONG_MAX) { ZVAL_DOUBLE(&(*args)[i], (double)aInt64); } else { - ZVAL_LONG(&(*args)[i], (long)aInt64); + ZVAL_INT(&(*args)[i], (long)aInt64); } break; diff --git a/ext/intl/normalizer/normalizer.c b/ext/intl/normalizer/normalizer.c index f06a3e685c..cbc680e7aa 100644 --- a/ext/intl/normalizer/normalizer.c +++ b/ext/intl/normalizer/normalizer.c @@ -37,9 +37,9 @@ void normalizer_register_constants( INIT_FUNC_ARGS ) return; } - #define NORMALIZER_EXPOSE_CONST(x) REGISTER_LONG_CONSTANT(#x, x, CONST_PERSISTENT | CONST_CS) - #define NORMALIZER_EXPOSE_CLASS_CONST(x) zend_declare_class_constant_long( Normalizer_ce_ptr, ZEND_STRS( #x ) - 1, NORMALIZER_##x TSRMLS_CC ); - #define NORMALIZER_EXPOSE_CUSTOM_CLASS_CONST(name, value) zend_declare_class_constant_long( Normalizer_ce_ptr, ZEND_STRS( name ) - 1, value TSRMLS_CC ); + #define NORMALIZER_EXPOSE_CONST(x) REGISTER_INT_CONSTANT(#x, x, CONST_PERSISTENT | CONST_CS) + #define NORMALIZER_EXPOSE_CLASS_CONST(x) zend_declare_class_constant_int( Normalizer_ce_ptr, ZEND_STRS( #x ) - 1, NORMALIZER_##x TSRMLS_CC ); + #define NORMALIZER_EXPOSE_CUSTOM_CLASS_CONST(name, value) zend_declare_class_constant_int( Normalizer_ce_ptr, ZEND_STRS( name ) - 1, value TSRMLS_CC ); /* Normalization form constants */ NORMALIZER_EXPOSE_CLASS_CONST( NONE ); diff --git a/ext/intl/php_intl.c b/ext/intl/php_intl.c index 9ca225ab88..f837bf9d78 100644 --- a/ext/intl/php_intl.c +++ b/ext/intl/php_intl.c @@ -910,7 +910,7 @@ PHP_MINIT_FUNCTION( intl ) /* For the default locale php.ini setting */ REGISTER_INI_ENTRIES(); - REGISTER_LONG_CONSTANT("INTL_MAX_LOCALE_LEN", INTL_MAX_LOCALE_LEN, CONST_PERSISTENT | CONST_CS); + REGISTER_INT_CONSTANT("INTL_MAX_LOCALE_LEN", INTL_MAX_LOCALE_LEN, CONST_PERSISTENT | CONST_CS); REGISTER_STRING_CONSTANT("INTL_ICU_VERSION", U_ICU_VERSION, CONST_PERSISTENT | CONST_CS); #ifdef U_ICU_DATA_VERSION REGISTER_STRING_CONSTANT("INTL_ICU_DATA_VERSION", U_ICU_DATA_VERSION, CONST_PERSISTENT | CONST_CS); diff --git a/ext/intl/resourcebundle/resourcebundle.c b/ext/intl/resourcebundle/resourcebundle.c index 66978eb888..8f6025bcb1 100644 --- a/ext/intl/resourcebundle/resourcebundle.c +++ b/ext/intl/resourcebundle/resourcebundle.c @@ -53,7 +53,7 @@ void resourcebundle_extract_value( zval *return_value, ResourceBundle_object *so case URES_INT: lfield = ures_getInt( source->child, &INTL_DATA_ERROR_CODE(source) ); INTL_METHOD_CHECK_STATUS(source, "Failed to retrieve integer value"); - ZVAL_LONG( return_value, lfield ); + ZVAL_INT( return_value, lfield ); break; case URES_INT_VECTOR: @@ -61,7 +61,7 @@ void resourcebundle_extract_value( zval *return_value, ResourceBundle_object *so INTL_METHOD_CHECK_STATUS(source, "Failed to retrieve vector value"); array_init( return_value ); for (i=0; i<ilen; i++) { - add_next_index_long( return_value, vfield[i] ); + add_next_index_int( return_value, vfield[i] ); } break; diff --git a/ext/intl/resourcebundle/resourcebundle_class.c b/ext/intl/resourcebundle/resourcebundle_class.c index 77f2e90588..af629f8ec6 100644 --- a/ext/intl/resourcebundle/resourcebundle_class.c +++ b/ext/intl/resourcebundle/resourcebundle_class.c @@ -177,9 +177,9 @@ static void resourcebundle_array_fetch(zval *object, zval *offset, zval *return_ intl_error_reset( NULL TSRMLS_CC ); RESOURCEBUNDLE_METHOD_FETCH_OBJECT; - if(Z_TYPE_P(offset) == IS_LONG) { + if(Z_TYPE_P(offset) == IS_INT) { is_numeric = 1; - meindex = Z_LVAL_P(offset); + meindex = Z_IVAL_P(offset); rb->child = ures_getByIndex( rb->me, meindex, rb->child, &INTL_DATA_ERROR_CODE(rb) ); } else if(Z_TYPE_P(offset) == IS_STRING) { mekey = Z_STRVAL_P(offset); @@ -299,7 +299,7 @@ PHP_FUNCTION( resourcebundle_count ) RESOURCEBUNDLE_METHOD_FETCH_OBJECT; len = ures_getSize( rb->me ); - RETURN_LONG( len ); + RETURN_INT( len ); } /* {{{ arginfo_resourcebundle_getlocales */ @@ -372,7 +372,7 @@ PHP_FUNCTION( resourcebundle_get_error_code ) rb = Z_INTL_RESOURCEBUNDLE_P( object ); - RETURN_LONG(INTL_DATA_ERROR_CODE(rb)); + RETURN_INT(INTL_DATA_ERROR_CODE(rb)); } /* }}} */ diff --git a/ext/intl/resourcebundle/resourcebundle_iterator.c b/ext/intl/resourcebundle/resourcebundle_iterator.c index bdedfd15bc..79149cb234 100644 --- a/ext/intl/resourcebundle/resourcebundle_iterator.c +++ b/ext/intl/resourcebundle/resourcebundle_iterator.c @@ -109,7 +109,7 @@ static void resourcebundle_iterator_key( zend_object_iterator *iter, zval *key T if (iterator->is_table) { ZVAL_STRING(key, iterator->currentkey); } else { - ZVAL_LONG(key, iterator->i); + ZVAL_INT(key, iterator->i); } } /* }}} */ diff --git a/ext/intl/spoofchecker/spoofchecker.c b/ext/intl/spoofchecker/spoofchecker.c index 42a014a90e..747654a53b 100644 --- a/ext/intl/spoofchecker/spoofchecker.c +++ b/ext/intl/spoofchecker/spoofchecker.c @@ -35,7 +35,7 @@ void spoofchecker_register_constants(INIT_FUNC_ARGS) return; } - #define SPOOFCHECKER_EXPOSE_CLASS_CONST(x) zend_declare_class_constant_long(Spoofchecker_ce_ptr, ZEND_STRS( #x ) - 1, USPOOF_##x TSRMLS_CC); + #define SPOOFCHECKER_EXPOSE_CLASS_CONST(x) zend_declare_class_constant_int(Spoofchecker_ce_ptr, ZEND_STRS( #x ) - 1, USPOOF_##x TSRMLS_CC); SPOOFCHECKER_EXPOSE_CLASS_CONST(SINGLE_SCRIPT_CONFUSABLE) SPOOFCHECKER_EXPOSE_CLASS_CONST(MIXED_SCRIPT_CONFUSABLE) diff --git a/ext/intl/spoofchecker/spoofchecker_main.c b/ext/intl/spoofchecker/spoofchecker_main.c index c37b9186a2..c0eac1f4eb 100644 --- a/ext/intl/spoofchecker/spoofchecker_main.c +++ b/ext/intl/spoofchecker/spoofchecker_main.c @@ -47,7 +47,7 @@ PHP_METHOD(Spoofchecker, isSuspicious) if (error_code) { zval_dtor(error_code); - ZVAL_LONG(error_code, ret); + ZVAL_INT(error_code, ret); } RETVAL_BOOL(ret != 0); } @@ -80,7 +80,7 @@ PHP_METHOD(Spoofchecker, areConfusable) if (error_code) { zval_dtor(error_code); - ZVAL_LONG(error_code, ret); + ZVAL_INT(error_code, ret); } RETVAL_BOOL(ret != 0); } 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) diff --git a/ext/intl/transliterator/transliterator.c b/ext/intl/transliterator/transliterator.c index 5f698e2b90..88e1225654 100644 --- a/ext/intl/transliterator/transliterator.c +++ b/ext/intl/transliterator/transliterator.c @@ -35,9 +35,9 @@ void transliterator_register_constants( INIT_FUNC_ARGS ) return; } - #define TRANSLITERATOR_EXPOSE_CONST( x ) REGISTER_LONG_CONSTANT( #x, x, CONST_PERSISTENT | CONST_CS ) - #define TRANSLITERATOR_EXPOSE_CLASS_CONST( x ) zend_declare_class_constant_long( Transliterator_ce_ptr, ZEND_STRS( #x ) - 1, TRANSLITERATOR_##x TSRMLS_CC ); - #define TRANSLITERATOR_EXPOSE_CUSTOM_CLASS_CONST( name, value ) zend_declare_class_constant_long( Transliterator_ce_ptr, ZEND_STRS( name ) - 1, value TSRMLS_CC );*/ + #define TRANSLITERATOR_EXPOSE_CONST( x ) REGISTER_INT_CONSTANT( #x, x, CONST_PERSISTENT | CONST_CS ) + #define TRANSLITERATOR_EXPOSE_CLASS_CONST( x ) zend_declare_class_constant_int( Transliterator_ce_ptr, ZEND_STRS( #x ) - 1, TRANSLITERATOR_##x TSRMLS_CC ); + #define TRANSLITERATOR_EXPOSE_CUSTOM_CLASS_CONST( name, value ) zend_declare_class_constant_int( Transliterator_ce_ptr, ZEND_STRS( name ) - 1, value TSRMLS_CC );*/ /* Normalization form constants */ TRANSLITERATOR_EXPOSE_CLASS_CONST( FORWARD ); diff --git a/ext/intl/transliterator/transliterator_class.c b/ext/intl/transliterator/transliterator_class.c index 1373db0c5b..e5f26f2829 100644 --- a/ext/intl/transliterator/transliterator_class.c +++ b/ext/intl/transliterator/transliterator_class.c @@ -223,7 +223,7 @@ static zval *Transliterator_get_property_ptr_ptr( zval *object, zval *member, in TRANSLITERATOR_PROPERTY_HANDLER_PROLOG; if(zend_binary_strcmp( "id", sizeof( "id" ) - 1, - Z_STRVAL_P( member ), Z_STRLEN_P( member ) ) == 0 ) + Z_STRVAL_P( member ), Z_STRSIZE_P( member ) ) == 0 ) { retval = NULL; /* fallback to read_property */ } @@ -247,7 +247,7 @@ static zval *Transliterator_read_property( zval *object, zval *member, int type, if( ( type != BP_VAR_R && type != BP_VAR_IS ) && ( zend_binary_strcmp( "id", sizeof( "id" ) - 1, - Z_STRVAL_P( member ), Z_STRLEN_P( member ) ) == 0 ) ) + Z_STRVAL_P( member ), Z_STRSIZE_P( member ) ) == 0 ) ) { php_error_docref0( NULL TSRMLS_CC, E_WARNING, "The property \"id\" is read-only" ); retval = &EG( uninitialized_zval ); @@ -272,7 +272,7 @@ static void Transliterator_write_property( zval *object, zval *member, zval *val if( ( EG( scope ) != Transliterator_ce_ptr ) && ( zend_binary_strcmp( "id", sizeof( "id" ) - 1, - Z_STRVAL_P( member ), Z_STRLEN_P( member ) ) == 0 ) ) + Z_STRVAL_P( member ), Z_STRSIZE_P( member ) ) == 0 ) ) { php_error_docref0( NULL TSRMLS_CC, E_WARNING, "The property \"id\" is read-only" ); } diff --git a/ext/intl/transliterator/transliterator_methods.c b/ext/intl/transliterator/transliterator_methods.c index 4403de08aa..c3709973f3 100644 --- a/ext/intl/transliterator/transliterator_methods.c +++ b/ext/intl/transliterator/transliterator_methods.c @@ -342,7 +342,7 @@ PHP_FUNCTION( transliterator_transliterate ) convert_to_string( arg1 ); } object = &tmp_object; - res = create_transliterator( Z_STRVAL_P( arg1 ), Z_STRLEN_P( arg1 ), + res = create_transliterator( Z_STRVAL_P( arg1 ), Z_STRSIZE_P( arg1 ), TRANSLITERATOR_FORWARD, object TSRMLS_CC ); if( res == FAILURE ) { @@ -497,7 +497,7 @@ PHP_FUNCTION( transliterator_get_error_code ) if (to == NULL ) RETURN_FALSE; - RETURN_LONG( (long) TRANSLITERATOR_ERROR_CODE( to ) ); + RETURN_INT( (long) TRANSLITERATOR_ERROR_CODE( to ) ); } /* }}} */ |
