Browse Source

fixed ext/intl

pull/536/merge
Anatol Belski 12 years ago
parent
commit
a45082e78d
  1. 4
      ext/intl/breakiterator/breakiterator_iterators.cpp
  2. 26
      ext/intl/breakiterator/breakiterator_methods.cpp
  3. 4
      ext/intl/breakiterator/codepointiterator_internal.cpp
  4. 2
      ext/intl/calendar/calendar_class.cpp
  5. 76
      ext/intl/calendar/calendar_methods.cpp
  6. 6
      ext/intl/calendar/gregoriancalendar_methods.cpp
  7. 12
      ext/intl/collator/collator_attr.c
  8. 10
      ext/intl/collator/collator_convert.c
  9. 4
      ext/intl/collator/collator_is_numeric.c
  10. 2
      ext/intl/collator/collator_is_numeric.h
  11. 4
      ext/intl/collator/collator_locale.c
  12. 6
      ext/intl/collator/collator_sort.c
  13. 2
      ext/intl/common/common_date.cpp
  14. 8
      ext/intl/common/common_error.c
  15. 18
      ext/intl/converter/converter.c
  16. 4
      ext/intl/dateformat/dateformat_attr.c
  17. 2
      ext/intl/dateformat/dateformat_attrcpp.cpp
  18. 8
      ext/intl/dateformat/dateformat_create.cpp
  19. 4
      ext/intl/dateformat/dateformat_format_object.cpp
  20. 8
      ext/intl/dateformat/dateformat_helpers.cpp
  21. 2
      ext/intl/dateformat/dateformat_helpers.h
  22. 8
      ext/intl/dateformat/dateformat_parse.c
  23. 28
      ext/intl/formatter/formatter_attr.c
  24. 6
      ext/intl/formatter/formatter_format.c
  25. 4
      ext/intl/formatter/formatter_main.c
  26. 8
      ext/intl/formatter/formatter_parse.c
  27. 30
      ext/intl/grapheme/grapheme_string.c
  28. 16
      ext/intl/grapheme/grapheme_util.c
  29. 2
      ext/intl/grapheme/grapheme_util.h
  30. 6
      ext/intl/idn/idn.c
  31. 4
      ext/intl/intl_error.c
  32. 4
      ext/intl/msgformat/msgformat_helpers.cpp
  33. 4
      ext/intl/normalizer/normalizer_normalize.c
  34. 2
      ext/intl/php_intl.h
  35. 2
      ext/intl/resourcebundle/resourcebundle.c
  36. 2
      ext/intl/resourcebundle/resourcebundle_class.c
  37. 4
      ext/intl/resourcebundle/resourcebundle_iterator.h
  38. 4
      ext/intl/spoofchecker/spoofchecker_main.c
  39. 4
      ext/intl/timezone/timezone_class.cpp
  40. 26
      ext/intl/timezone/timezone_methods.cpp
  41. 18
      ext/intl/transliterator/transliterator_methods.c
  42. 14
      ext/standard/php_smart_str.h

4
ext/intl/breakiterator/breakiterator_iterators.cpp

@ -69,7 +69,7 @@ static void _breakiterator_move_forward(zend_object_iterator *iter TSRMLS_DC)
int32_t pos = biter->next();
if (pos != BreakIterator::DONE) {
MAKE_STD_ZVAL(zoi_iter->current);
ZVAL_LONG(zoi_iter->current, (long)pos);
ZVAL_LONG(zoi_iter->current, (php_int_t)pos);
} //else we've reached the end of the enum, nothing more is required
}
@ -80,7 +80,7 @@ static void _breakiterator_rewind(zend_object_iterator *iter TSRMLS_DC)
int32_t pos = biter->first();
MAKE_STD_ZVAL(zoi_iter->current);
ZVAL_LONG(zoi_iter->current, (long)pos);
ZVAL_LONG(zoi_iter->current, (php_int_t)pos);
}
static zend_object_iterator_funcs breakiterator_iterator_funcs = {

26
ext/intl/breakiterator/breakiterator_methods.cpp

@ -211,7 +211,7 @@ static void _breakiter_no_args_ret_int32(
int32_t res = (bio->biter->*func)();
RETURN_LONG((long)res);
RETURN_LONG((php_int_t)res);
}
static void _breakiter_int32_ret_int32(
@ -220,11 +220,11 @@ static void _breakiter_int32_ret_int32(
INTERNAL_FUNCTION_PARAMETERS)
{
char *msg;
long arg;
php_int_t arg;
BREAKITER_METHOD_INIT_VARS;
object = getThis();
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &arg) == FAILURE) {
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "i", &arg) == FAILURE) {
spprintf(&msg, 0, "%s: bad arguments", func_name);
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, msg, 1 TSRMLS_CC);
efree(msg);
@ -243,7 +243,7 @@ static void _breakiter_int32_ret_int32(
int32_t res = (bio->biter->*func)((int32_t)arg);
RETURN_LONG((long)res);
RETURN_LONG((php_int_t)res);
}
U_CFUNC PHP_FUNCTION(breakiter_first)
@ -311,7 +311,7 @@ U_CFUNC PHP_FUNCTION(breakiter_current)
int32_t res = bio->biter->current();
RETURN_LONG((long)res);
RETURN_LONG((php_int_t)res);
}
U_CFUNC PHP_FUNCTION(breakiter_following)
@ -330,11 +330,11 @@ U_CFUNC PHP_FUNCTION(breakiter_preceding)
U_CFUNC PHP_FUNCTION(breakiter_is_boundary)
{
long offset;
php_int_t offset;
BREAKITER_METHOD_INIT_VARS;
object = getThis();
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l",
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "i",
&offset) == FAILURE) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
"breakiter_is_boundary: bad arguments", 0 TSRMLS_CC);
@ -352,16 +352,16 @@ U_CFUNC PHP_FUNCTION(breakiter_is_boundary)
UBool res = bio->biter->isBoundary((int32_t)offset);
RETURN_BOOL((long)res);
RETURN_BOOL((php_int_t)res);
}
U_CFUNC PHP_FUNCTION(breakiter_get_locale)
{
long locale_type;
php_int_t locale_type;
BREAKITER_METHOD_INIT_VARS;
object = getThis();
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &locale_type) == FAILURE) {
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "i", &locale_type) == FAILURE) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
"breakiter_get_locale: bad arguments", 0 TSRMLS_CC);
RETURN_FALSE;
@ -385,11 +385,11 @@ U_CFUNC PHP_FUNCTION(breakiter_get_locale)
U_CFUNC PHP_FUNCTION(breakiter_get_parts_iterator)
{
long key_type = 0;
php_int_t key_type = 0;
BREAKITER_METHOD_INIT_VARS;
object = getThis();
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|l", &key_type) == FAILURE) {
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|i", &key_type) == FAILURE) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
"breakiter_get_parts_iterator: bad arguments", 0 TSRMLS_CC);
RETURN_FALSE;
@ -425,7 +425,7 @@ U_CFUNC PHP_FUNCTION(breakiter_get_error_code)
if (bio == NULL)
RETURN_FALSE;
RETURN_LONG((long)BREAKITER_ERROR_CODE(bio));
RETURN_LONG((php_int_t)BREAKITER_ERROR_CODE(bio));
}
U_CFUNC PHP_FUNCTION(breakiter_get_error_message)

4
ext/intl/breakiterator/codepointiterator_internal.cpp

@ -18,9 +18,11 @@
#include <unicode/uchriter.h>
#include <typeinfo>
#include "php.h"
//copied from cmemory.h, which is not public
typedef union {
long t1;
php_int_t t1;
double t2;
void *t3;
} UAlignedMemory;

2
ext/intl/calendar/calendar_class.cpp

@ -208,7 +208,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_long(zfields, name, (php_int_t)res);
} else {
add_assoc_string(zfields, name, const_cast<char*>(u_errorName(uec)), 1);
}

76
ext/intl/calendar/calendar_methods.cpp

@ -219,7 +219,7 @@ static void _php_intlcal_field_uec_ret_in32t_method(
const char *method_name,
INTERNAL_FUNCTION_PARAMETERS)
{
long field;
php_int_t field;
char *message;
CALENDAR_METHOD_INIT_VARS;
@ -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_LONG((php_int_t)result);
}
U_CFUNC PHP_FUNCTION(intlcal_get)
@ -295,12 +295,12 @@ U_CFUNC PHP_FUNCTION(intlcal_set_time)
U_CFUNC PHP_FUNCTION(intlcal_add)
{
long field,
php_int_t field,
amount;
CALENDAR_METHOD_INIT_VARS;
if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(),
"Oll", &object, Calendar_ce_ptr, &field, &amount) == FAILURE) {
"Oii", &object, Calendar_ce_ptr, &field, &amount) == FAILURE) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
"intlcal_add: bad arguments", 0 TSRMLS_CC);
RETURN_FALSE;
@ -400,7 +400,7 @@ U_CFUNC PHP_FUNCTION(intlcal_before)
U_CFUNC PHP_FUNCTION(intlcal_set)
{
long arg1, arg2, arg3, arg4, arg5, arg6;
php_int_t arg1, arg2, arg3, arg4, arg5, arg6;
zval **args_a[7] = {0},
***args = &args_a[0];
int i;
@ -424,7 +424,7 @@ U_CFUNC PHP_FUNCTION(intlcal_set)
if (variant == 4 ||
zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(),
"Oll|llll", &object, Calendar_ce_ptr, &arg1, &arg2, &arg3, &arg4,
"Oii|iiii", &object, Calendar_ce_ptr, &arg1, &arg2, &arg3, &arg4,
&arg5, &arg6) == FAILURE) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
"intlcal_set: bad arguments", 0 TSRMLS_CC);
@ -463,7 +463,7 @@ U_CFUNC PHP_FUNCTION(intlcal_set)
U_CFUNC PHP_FUNCTION(intlcal_roll)
{
long field,
php_int_t field,
value;
zval **args_a[3] = {0},
***args = &args_a[0];
@ -481,7 +481,7 @@ U_CFUNC PHP_FUNCTION(intlcal_roll)
}
if (args[1] != NULL && Z_TYPE_PP(args[1]) == IS_BOOL) {
if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(),
"Olb", &object, Calendar_ce_ptr, &field, &bool_variant_val)
"Oib", &object, Calendar_ce_ptr, &field, &bool_variant_val)
== FAILURE) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
"intlcal_roll: bad arguments", 0 TSRMLS_CC);
@ -489,7 +489,7 @@ U_CFUNC PHP_FUNCTION(intlcal_roll)
}
bool_variant_val = Z_BVAL_PP(args[1]);
} else if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(),
"Oll", &object, Calendar_ce_ptr, &field, &value) == FAILURE) {
"Oii", &object, Calendar_ce_ptr, &field, &value) == FAILURE) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
"intlcal_roll: bad arguments", 0 TSRMLS_CC);
RETURN_FALSE;
@ -525,7 +525,7 @@ U_CFUNC PHP_FUNCTION(intlcal_clear)
{
zval **args_a[2] = {0},
***args = &args_a[0];
long field;
php_int_t field;
int variant;
CALENDAR_METHOD_INIT_VARS;
@ -548,7 +548,7 @@ U_CFUNC PHP_FUNCTION(intlcal_clear)
}
variant = 0;
} else if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC,
getThis(), "Ol", &object, Calendar_ce_ptr, &field) == FAILURE) {
getThis(), "Oi", &object, Calendar_ce_ptr, &field) == FAILURE) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
"intlcal_clear: bad arguments", 0 TSRMLS_CC);
RETURN_FALSE;
@ -573,12 +573,12 @@ U_CFUNC PHP_FUNCTION(intlcal_clear)
U_CFUNC PHP_FUNCTION(intlcal_field_difference)
{
long field;
php_int_t field;
double when;
CALENDAR_METHOD_INIT_VARS;
if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(),
"Odl", &object, Calendar_ce_ptr, &when, &field) == FAILURE) {
"Odi", &object, Calendar_ce_ptr, &when, &field) == FAILURE) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
"intlcal_field_difference: bad arguments", 0 TSRMLS_CC);
RETURN_FALSE;
@ -597,7 +597,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_LONG((php_int_t)result);
}
U_CFUNC PHP_FUNCTION(intlcal_get_actual_maximum)
@ -615,11 +615,11 @@ U_CFUNC PHP_FUNCTION(intlcal_get_actual_minimum)
#if U_ICU_VERSION_MAJOR_NUM * 10 + U_ICU_VERSION_MINOR_NUM >= 44
U_CFUNC PHP_FUNCTION(intlcal_get_day_of_week_type)
{
long dow;
php_uint_t dow;
CALENDAR_METHOD_INIT_VARS;
if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(),
"Ol", &object, Calendar_ce_ptr, &dow) == FAILURE) {
"Oi", &object, Calendar_ce_ptr, &dow) == FAILURE) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
"intlcal_get_day_of_week_type: bad arguments", 0 TSRMLS_CC);
RETURN_FALSE;
@ -638,7 +638,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_LONG((php_int_t)result);
}
#endif
@ -659,7 +659,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_LONG((php_int_t)result);
}
static void _php_intlcal_field_ret_in32t_method(
@ -667,12 +667,12 @@ static void _php_intlcal_field_ret_in32t_method(
const char *method_name,
INTERNAL_FUNCTION_PARAMETERS)
{
long field;
php_int_t field;
char *message;
CALENDAR_METHOD_INIT_VARS;
if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(),
"Ol", &object, Calendar_ce_ptr, &field) == FAILURE) {
"Oi", &object, Calendar_ce_ptr, &field) == FAILURE) {
spprintf(&message, 0, "%s: bad arguments", method_name);
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, message, 1 TSRMLS_CC);
efree(message);
@ -691,7 +691,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_LONG((php_int_t)result);
}
U_CFUNC PHP_FUNCTION(intlcal_get_greatest_minimum)
@ -708,11 +708,11 @@ U_CFUNC PHP_FUNCTION(intlcal_get_least_maximum)
U_CFUNC PHP_FUNCTION(intlcal_get_locale)
{
long locale_type;
php_int_t locale_type;
CALENDAR_METHOD_INIT_VARS;
if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(),
"Ol", &object, Calendar_ce_ptr, &locale_type) == FAILURE) {
"Oi", &object, Calendar_ce_ptr, &locale_type) == FAILURE) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
"intlcal_get_locale: bad arguments", 0 TSRMLS_CC);
RETURN_FALSE;
@ -757,7 +757,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_LONG((php_int_t)result);
}
U_CFUNC PHP_FUNCTION(intlcal_get_minimum)
@ -808,11 +808,11 @@ U_CFUNC PHP_FUNCTION(intlcal_get_type)
#if U_ICU_VERSION_MAJOR_NUM * 10 + U_ICU_VERSION_MINOR_NUM >= 44
U_CFUNC PHP_FUNCTION(intlcal_get_weekend_transition)
{
long dow;
php_int_t dow;
CALENDAR_METHOD_INIT_VARS;
if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(),
"Ol", &object, Calendar_ce_ptr, &dow) == FAILURE) {
"Oi", &object, Calendar_ce_ptr, &dow) == FAILURE) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
"intlcal_get_weekend_transition: bad arguments", 0 TSRMLS_CC);
RETURN_FALSE;
@ -831,7 +831,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_LONG((php_int_t)res);
}
#endif
@ -899,11 +899,11 @@ U_CFUNC PHP_FUNCTION(intlcal_is_lenient)
U_CFUNC PHP_FUNCTION(intlcal_is_set)
{
long field;
php_int_t field;
CALENDAR_METHOD_INIT_VARS;
if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(),
"Ol", &object, Calendar_ce_ptr, &field) == FAILURE) {
"Oi", &object, Calendar_ce_ptr, &field) == FAILURE) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
"intlcal_is_set: bad arguments", 0 TSRMLS_CC);
RETURN_FALSE;
@ -954,11 +954,11 @@ U_CFUNC PHP_FUNCTION(intlcal_is_weekend)
U_CFUNC PHP_FUNCTION(intlcal_set_first_day_of_week)
{
long dow;
php_int_t dow;
CALENDAR_METHOD_INIT_VARS;
if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(),
"Ol", &object, Calendar_ce_ptr, &dow) == FAILURE) {
"Oi", &object, Calendar_ce_ptr, &dow) == FAILURE) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
"intlcal_set_first_day_of_week: bad arguments", 0 TSRMLS_CC);
RETURN_FALSE;
@ -998,11 +998,11 @@ U_CFUNC PHP_FUNCTION(intlcal_set_lenient)
U_CFUNC PHP_FUNCTION(intlcal_set_minimal_days_in_first_week)
{
long num_days;
php_int_t num_days;
CALENDAR_METHOD_INIT_VARS;
if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(),
"Ol", &object, Calendar_ce_ptr, &num_days) == FAILURE) {
"Oi", &object, Calendar_ce_ptr, &num_days) == FAILURE) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
"intlcal_set_minimal_days_in_first_week: bad arguments", 0 TSRMLS_CC);
RETURN_FALSE;
@ -1086,11 +1086,11 @@ U_CFUNC PHP_FUNCTION(intlcal_get_skipped_wall_time_option)
U_CFUNC PHP_FUNCTION(intlcal_set_repeated_wall_time_option)
{
long option;
php_int_t option;
CALENDAR_METHOD_INIT_VARS;
if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(),
"Ol", &object, Calendar_ce_ptr, &option) == FAILURE) {
"Oi", &object, Calendar_ce_ptr, &option) == FAILURE) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
"intlcal_set_repeated_wall_time_option: bad arguments", 0 TSRMLS_CC);
RETURN_FALSE;
@ -1111,11 +1111,11 @@ U_CFUNC PHP_FUNCTION(intlcal_set_repeated_wall_time_option)
U_CFUNC PHP_FUNCTION(intlcal_set_skipped_wall_time_option)
{
long option;
php_int_t option;
CALENDAR_METHOD_INIT_VARS;
if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(),
"Ol", &object, Calendar_ce_ptr, &option) == FAILURE) {
"Oi", &object, Calendar_ce_ptr, &option) == FAILURE) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
"intlcal_set_skipped_wall_time_option: bad arguments", 0 TSRMLS_CC);
RETURN_FALSE;
@ -1326,7 +1326,7 @@ U_CFUNC PHP_FUNCTION(intlcal_get_error_code)
if (co == NULL)
RETURN_FALSE;
RETURN_LONG((long)CALENDAR_ERROR_CODE(co));
RETURN_LONG((php_int_t)CALENDAR_ERROR_CODE(co));
}
U_CFUNC PHP_FUNCTION(intlcal_get_error_message)

6
ext/intl/calendar/gregoriancalendar_methods.cpp

@ -43,7 +43,7 @@ static void _php_intlgregcal_constructor_body(INTERNAL_FUNCTION_PARAMETERS)
***args = &args_a[0];
char *locale = NULL;
zend_str_size_int locale_len;
long largs[6];
php_int_t largs[6];
UErrorCode status = U_ZERO_ERROR;
int variant;
intl_error_reset(NULL TSRMLS_CC);
@ -233,11 +233,11 @@ U_CFUNC PHP_FUNCTION(intlgregcal_get_gregorian_change)
U_CFUNC PHP_FUNCTION(intlgregcal_is_leap_year)
{
long year;
php_int_t year;
CALENDAR_METHOD_INIT_VARS;
if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(),
"Ol", &object, GregorianCalendar_ce_ptr, &year) == FAILURE) {
"Oi", &object, GregorianCalendar_ce_ptr, &year) == FAILURE) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
"intlgregcal_is_leap_year: bad arguments", 0 TSRMLS_CC);
RETURN_FALSE;

12
ext/intl/collator/collator_attr.c

@ -33,12 +33,12 @@
*/
PHP_FUNCTION( collator_get_attribute )
{
long attribute, value;
php_int_t attribute, value;
COLLATOR_METHOD_INIT_VARS
/* Parse parameters. */
if( zend_parse_method_parameters( ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Ol",
if( zend_parse_method_parameters( ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Oi",
&object, Collator_ce_ptr, &attribute ) == FAILURE )
{
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,
@ -64,12 +64,12 @@ PHP_FUNCTION( collator_get_attribute )
*/
PHP_FUNCTION( collator_set_attribute )
{
long attribute, value;
php_int_t attribute, value;
COLLATOR_METHOD_INIT_VARS
/* Parse parameters. */
if( zend_parse_method_parameters( ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Oll",
if( zend_parse_method_parameters( ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Oii",
&object, Collator_ce_ptr, &attribute, &value ) == FAILURE)
{
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,
@ -123,12 +123,12 @@ PHP_FUNCTION( collator_get_strength )
*/
PHP_FUNCTION( collator_set_strength )
{
long strength;
php_int_t strength;
COLLATOR_METHOD_INIT_VARS
/* Parse parameters. */
if( zend_parse_method_parameters( ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Ol",
if( zend_parse_method_parameters( ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Oi",
&object, Collator_ce_ptr, &strength ) == FAILURE )
{
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,

10
ext/intl/collator/collator_convert.c

@ -41,7 +41,7 @@
/* {{{ collator_convert_hash_item_from_utf8_to_utf16 */
static void collator_convert_hash_item_from_utf8_to_utf16(
HashTable* hash, int hashKeyType, char* hashKey, ulong hashIndex,
HashTable* hash, int hashKeyType, char* hashKey, zend_uint_t hashIndex,
UErrorCode* status )
{
const char* old_val;
@ -85,7 +85,7 @@ static void collator_convert_hash_item_from_utf8_to_utf16(
/* {{{ collator_convert_hash_item_from_utf16_to_utf8 */
static void collator_convert_hash_item_from_utf16_to_utf8(
HashTable* hash, int hashKeyType, char* hashKey, ulong hashIndex,
HashTable* hash, int hashKeyType, char* hashKey, zend_uint_t hashIndex,
UErrorCode* status )
{
const char* old_val;
@ -133,7 +133,7 @@ static void collator_convert_hash_item_from_utf16_to_utf8(
*/
void collator_convert_hash_from_utf8_to_utf16( HashTable* hash, UErrorCode* status )
{
ulong hashIndex = 0;
zend_uint_t hashIndex = 0;
char* hashKey = NULL;
int hashKeyType = 0;
@ -158,7 +158,7 @@ void collator_convert_hash_from_utf8_to_utf16( HashTable* hash, UErrorCode* stat
*/
void collator_convert_hash_from_utf16_to_utf8( HashTable* hash, UErrorCode* status )
{
ulong hashIndex = 0;
zend_uint_t hashIndex = 0;
char* hashKey = NULL;
int hashKeyType = 0;
@ -374,7 +374,7 @@ zval* collator_convert_string_to_number_if_possible( zval* str )
{
zval* num = NULL;
int is_numeric = 0;
long lval = 0;
php_int_t lval = 0;
double dval = 0;
if( Z_TYPE_P( str ) != IS_STRING )

4
ext/intl/collator/collator_is_numeric.c

@ -222,9 +222,9 @@ static long collator_u_strtol(nptr, endptr, base)
/* {{{ collator_is_numeric]
* Taken from PHP6:is_numeric_unicode()
*/
zend_uchar collator_is_numeric( UChar *str, int length, long *lval, double *dval, int allow_errors )
zend_uchar collator_is_numeric( UChar *str, zend_str_size_int length, php_int_t *lval, double *dval, int allow_errors )
{
long local_lval;
php_int_t local_lval;
double local_dval;
UChar *end_ptr_long, *end_ptr_double;
int conv_base=10;

2
ext/intl/collator/collator_is_numeric.h

@ -21,6 +21,6 @@
#include <php.h>
#include <unicode/uchar.h>
zend_uchar collator_is_numeric( UChar *str, int length, long *lval, double *dval, int allow_errors );
zend_uchar collator_is_numeric( UChar *str, zend_str_size_int length, php_int_t *lval, double *dval, int allow_errors );
#endif // COLLATOR_IS_NUMERIC_H

4
ext/intl/collator/collator_locale.c

@ -33,13 +33,13 @@
*/
PHP_FUNCTION( collator_get_locale )
{
long type = 0;
php_int_t type = 0;
char* locale_name = NULL;
COLLATOR_METHOD_INIT_VARS
/* Parse parameters. */
if( zend_parse_method_parameters( ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Ol",
if( zend_parse_method_parameters( ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Oi",
&object, Collator_ce_ptr, &type ) == FAILURE )
{
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,

6
ext/intl/collator/collator_sort.c

@ -260,7 +260,7 @@ static int collator_cmp_sort_keys( const void *p1, const void *p2 TSRMLS_DC )
/* {{{ collator_get_compare_function
* Choose compare function according to sort flags.
*/
static collator_compare_func_t collator_get_compare_function( const long sort_flags )
static collator_compare_func_t collator_get_compare_function( const php_int_t sort_flags )
{
collator_compare_func_t func;
@ -292,12 +292,12 @@ static void collator_sort_internal( int renumber, INTERNAL_FUNCTION_PARAMETERS )
zval* array = NULL;
HashTable* hash = NULL;
zval* saved_collator = NULL;
long sort_flags = COLLATOR_SORT_REGULAR;
php_int_t sort_flags = COLLATOR_SORT_REGULAR;
COLLATOR_METHOD_INIT_VARS
/* Parse parameters. */
if( zend_parse_method_parameters( ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Oa|l",
if( zend_parse_method_parameters( ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Oa|i",
&object, Collator_ce_ptr, &array, &sort_flags ) == FAILURE )
{
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,

2
ext/intl/common/common_date.cpp

@ -176,7 +176,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;

8
ext/intl/common/common_error.c

@ -49,10 +49,10 @@ PHP_FUNCTION( intl_get_error_message )
*/
PHP_FUNCTION( intl_is_failure )
{
long err_code;
php_int_t err_code;
/* Parse parameters. */
if( zend_parse_parameters( ZEND_NUM_ARGS() TSRMLS_CC, "l",
if( zend_parse_parameters( ZEND_NUM_ARGS() TSRMLS_CC, "i",
&err_code ) == FAILURE )
{
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,
@ -70,10 +70,10 @@ PHP_FUNCTION( intl_is_failure )
*/
PHP_FUNCTION( intl_error_name )
{
long err_code;
php_int_t err_code;
/* Parse parameters. */
if( zend_parse_parameters( ZEND_NUM_ARGS() TSRMLS_CC, "l",
if( zend_parse_parameters( ZEND_NUM_ARGS() TSRMLS_CC, "i",
&err_code ) == FAILURE )
{
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,

18
ext/intl/converter/converter.c

@ -56,7 +56,7 @@ static inline void php_converter_throw_failure(php_converter_object *objval, UEr
/* }}} */
/* {{{ php_converter_default_callback */
static void php_converter_default_callback(zval *return_value, zval *zobj, long reason, zval *error TSRMLS_DC) {
static void php_converter_default_callback(zval *return_value, zval *zobj, php_int_t reason, zval *error TSRMLS_DC) {
/* Basic functionality so children can call parent::toUCallback() */
switch (reason) {
case UCNV_UNASSIGNED:
@ -100,10 +100,10 @@ ZEND_BEGIN_ARG_INFO_EX(php_converter_toUCallback_arginfo, 0, ZEND_RETURN_VALUE,
ZEND_ARG_INFO(1, error)
ZEND_END_ARG_INFO();
static PHP_METHOD(UConverter, toUCallback) {
long reason;
php_int_t reason;
zval *source, *codeUnits, *error;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "lzzz",
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "izzz",
&reason, &source, &codeUnits, &error) == FAILURE) {
return;
}
@ -122,10 +122,10 @@ ZEND_BEGIN_ARG_INFO_EX(php_converter_fromUCallback_arginfo, 0, ZEND_RETURN_VALUE
ZEND_ARG_INFO(1, error)
ZEND_END_ARG_INFO();
static PHP_METHOD(UConverter, fromUCallback) {
long reason;
php_int_t reason;
zval *source, *codePoint, *error;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "lzzz",
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "izzz",
&reason, &source, &codePoint, &error) == FAILURE) {
return;
}
@ -135,7 +135,7 @@ static PHP_METHOD(UConverter, fromUCallback) {
/* }}} */
/* {{{ php_converter_check_limits */
static inline zend_bool php_converter_check_limits(php_converter_object *objval, long available, long needed TSRMLS_DC) {
static inline zend_bool php_converter_check_limits(php_converter_object *objval, php_int_t available, php_int_t needed TSRMLS_DC) {
if (available < needed) {
php_converter_throw_failure(objval, U_BUFFER_OVERFLOW_ERROR TSRMLS_CC, "Buffer overrun %ld bytes needed, %ld available", needed, available);
return 0;
@ -154,7 +154,7 @@ static void php_converter_append_toUnicode_target(zval *val, UConverterToUnicode
return;
case IS_LONG:
{
long lval = Z_LVAL_P(val);
php_int_t lval = Z_LVAL_P(val);
if ((lval < 0) || (lval > 0x10FFFF)) {
php_converter_throw_failure(objval, U_ILLEGAL_ARGUMENT_ERROR TSRMLS_CC, "Invalid codepoint U+%04lx", lval);
return;
@ -738,9 +738,9 @@ ZEND_BEGIN_ARG_INFO_EX(php_converter_reasontext_arginfo, 0, ZEND_RETURN_VALUE, 0
ZEND_ARG_INFO(0, reason)
ZEND_END_ARG_INFO();
static PHP_METHOD(UConverter, reasonText) {
long reason;
php_int_t reason;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &reason) == FAILURE) {
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "i", &reason) == FAILURE) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
"UConverter::reasonText(): bad arguments", 0 TSRMLS_CC);
RETURN_FALSE;

4
ext/intl/dateformat/dateformat_attr.c

@ -170,12 +170,12 @@ PHP_FUNCTION( datefmt_set_pattern )
PHP_FUNCTION( datefmt_get_locale )
{
char *loc;
long loc_type =ULOC_ACTUAL_LOCALE;
php_int_t loc_type =ULOC_ACTUAL_LOCALE;
DATE_FORMAT_METHOD_INIT_VARS;
/* Parse parameters. */
if( zend_parse_method_parameters( ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O|l",
if( zend_parse_method_parameters( ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O|i",
&object, IntlDateFormatter_ce_ptr,&loc_type) == FAILURE )
{
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,

2
ext/intl/dateformat/dateformat_attrcpp.cpp

@ -217,7 +217,7 @@ U_CFUNC PHP_FUNCTION(datefmt_set_calendar)
DATE_FORMAT_METHOD_FETCH_OBJECT;
Calendar *cal;
long cal_type;
php_int_t cal_type;
bool cal_owned;
Locale locale = Locale::createFromName(dfo->requested_locale);
// getting the actual locale from the DateFormat is not enough

8
ext/intl/dateformat/dateformat_create.cpp

@ -43,11 +43,11 @@ static void datefmt_ctor(INTERNAL_FUNCTION_PARAMETERS)
const char *locale_str;
zend_str_size_int locale_len = 0;
Locale locale;
long date_type = 0;
long time_type = 0;
php_int_t date_type = 0;
php_int_t time_type = 0;
zval *calendar_zv = NULL;
Calendar *calendar = NULL;
long calendar_type;
php_int_t calendar_type;
bool calendar_owned;
zval **timezone_zv = NULL;
TimeZone *timezone = NULL;
@ -61,7 +61,7 @@ static void datefmt_ctor(INTERNAL_FUNCTION_PARAMETERS)
intl_error_reset(NULL TSRMLS_CC);
object = return_value;
/* Parse parameters. */
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Sll|ZzS",
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Sii|ZzS",
&locale_str, &locale_len, &date_type, &time_type, &timezone_zv,
&calendar_zv, &pattern_str, &pattern_str_len) == FAILURE) {
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, "datefmt_create: "

4
ext/intl/dateformat/dateformat_format_object.cpp

@ -47,9 +47,9 @@ static const DateFormat::EStyle valid_styles[] = {
static bool valid_format(zval **z) {
if (Z_TYPE_PP(z) == IS_LONG) {
long lval = Z_LVAL_PP(z);
php_int_t lval = Z_LVAL_PP(z);
for (int i = 0; i < sizeof(valid_styles) / sizeof(*valid_styles); i++) {
if ((long)valid_styles[i] == lval) {
if ((php_int_t)valid_styles[i] == lval) {
return true;
}
}

8
ext/intl/dateformat/dateformat_helpers.cpp

@ -33,7 +33,7 @@ int datefmt_process_calendar_arg(zval* calendar_zv,
const char *func_name,
intl_error *err,
Calendar*& cal,
long& cal_int_type,
php_int_t& cal_int_type,
bool& calendar_owned TSRMLS_DC)
{
char *msg;
@ -49,8 +49,8 @@ int datefmt_process_calendar_arg(zval* calendar_zv,
} else if (Z_TYPE_P(calendar_zv) == IS_LONG) {
long v = Z_LVAL_P(calendar_zv);
if (v != (long)UCAL_TRADITIONAL && v != (long)UCAL_GREGORIAN) {
php_int_t v = Z_LVAL_P(calendar_zv);
if (v != (php_int_t)UCAL_TRADITIONAL && v != (php_int_t)UCAL_GREGORIAN) {
spprintf(&msg, 0, "%s: invalid value for calendar type; it must be "
"one of IntlDateFormatter::TRADITIONAL (locale's default "
"calendar) or IntlDateFormatter::GREGORIAN. "
@ -59,7 +59,7 @@ int datefmt_process_calendar_arg(zval* calendar_zv,
intl_errors_set(err, U_ILLEGAL_ARGUMENT_ERROR, msg, 1 TSRMLS_CC);
efree(msg);
return FAILURE;
} else if (v == (long)UCAL_TRADITIONAL) {
} else if (v == (php_int_t)UCAL_TRADITIONAL) {
cal = Calendar::createInstance(locale, status);
} else { //UCAL_GREGORIAN
cal = new GregorianCalendar(locale, status);

2
ext/intl/dateformat/dateformat_helpers.h

@ -32,7 +32,7 @@ int datefmt_process_calendar_arg(zval* calendar_zv,
const char *func_name,
intl_error *err,
Calendar*& cal,
long& cal_int_type,
php_int_t& cal_int_type,
bool& calendar_owned TSRMLS_DC);
#endif /* DATEFORMAT_HELPERS_H */

8
ext/intl/dateformat/dateformat_parse.c

@ -57,14 +57,14 @@ 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_LONG(return_value, (php_int_t)result);
}
}
/* }}} */
static void add_to_localtime_arr( IntlDateFormatter_object *dfo, zval* return_value, const UCalendar *parsed_calendar, long calendar_field, char* key_name TSRMLS_DC)
static void add_to_localtime_arr( IntlDateFormatter_object *dfo, zval* return_value, const UCalendar *parsed_calendar, php_int_t calendar_field, char* key_name TSRMLS_DC)
{
long calendar_field_val = ucal_get( parsed_calendar, calendar_field, &INTL_DATA_ERROR_CODE(dfo));
php_int_t calendar_field_val = ucal_get( parsed_calendar, calendar_field, &INTL_DATA_ERROR_CODE(dfo));
INTL_METHOD_CHECK_STATUS( dfo, "Date parsing - localtime failed : could not get a field from calendar" );
if( strcmp(key_name, CALENDAR_YEAR )==0 ){
@ -86,7 +86,7 @@ static void internal_parse_to_localtime(IntlDateFormatter_object *dfo, char* tex
UCalendar *parsed_calendar = NULL;
UChar* text_utf16 = NULL;
zend_str_size_int text_utf16_len = 0;
long isInDST = 0;
php_int_t isInDST = 0;
/* Convert timezone to UTF-16. */
intl_convert_utf8_to_utf16(&text_utf16, &text_utf16_len, text_to_parse, text_len, &INTL_DATA_ERROR_CODE(dfo));

28
ext/intl/formatter/formatter_attr.c

@ -32,11 +32,11 @@
*/
PHP_FUNCTION( numfmt_get_attribute )
{
long attribute, value;
php_int_t attribute, value;
FORMATTER_METHOD_INIT_VARS;
/* Parse parameters. */
if( zend_parse_method_parameters( ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Ol",
if( zend_parse_method_parameters( ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Oi",
&object, NumberFormatter_ce_ptr, &attribute ) == FAILURE )
{
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,
@ -101,7 +101,7 @@ PHP_FUNCTION( numfmt_get_attribute )
*/
PHP_FUNCTION( numfmt_get_text_attribute )
{
long attribute;
php_int_t attribute;
UChar value_buf[64];
int value_buf_size = USIZE( value_buf );
UChar* value = value_buf;
@ -109,7 +109,7 @@ PHP_FUNCTION( numfmt_get_text_attribute )
FORMATTER_METHOD_INIT_VARS;
/* Parse parameters. */
if( zend_parse_method_parameters( ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Ol",
if( zend_parse_method_parameters( ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Oi",
&object, NumberFormatter_ce_ptr, &attribute ) == FAILURE )
{
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,
@ -145,12 +145,12 @@ PHP_FUNCTION( numfmt_get_text_attribute )
*/
PHP_FUNCTION( numfmt_set_attribute )
{
long attribute;
php_int_t attribute;
zval **value;
FORMATTER_METHOD_INIT_VARS;
/* Parse parameters. */
if( zend_parse_method_parameters( ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "OlZ",
if( zend_parse_method_parameters( ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "OiZ",
&object, NumberFormatter_ce_ptr, &attribute, &value ) == FAILURE)
{
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,
@ -209,13 +209,13 @@ PHP_FUNCTION( numfmt_set_text_attribute )
{
zend_str_size_int slength = 0;
UChar *svalue = NULL;
long attribute;
php_int_t attribute;
char *value;
zend_str_size_int len;
FORMATTER_METHOD_INIT_VARS;
/* Parse parameters. */
if( zend_parse_method_parameters( ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "OlS",
if( zend_parse_method_parameters( ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "OiS",
&object, NumberFormatter_ce_ptr, &attribute, &value, &len ) == FAILURE)
{
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,
@ -249,14 +249,14 @@ PHP_FUNCTION( numfmt_set_text_attribute )
*/
PHP_FUNCTION( numfmt_get_symbol )
{
long symbol;
php_int_t symbol;
UChar value_buf[4];
UChar *value = value_buf;
int length = USIZE(value_buf);
FORMATTER_METHOD_INIT_VARS;
/* Parse parameters. */
if( zend_parse_method_parameters( ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Ol",
if( zend_parse_method_parameters( ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Oi",
&object, NumberFormatter_ce_ptr, &symbol ) == FAILURE )
{
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,
@ -297,7 +297,7 @@ PHP_FUNCTION( numfmt_get_symbol )
*/
PHP_FUNCTION( numfmt_set_symbol )
{
long symbol;
php_int_t symbol;
char* value = NULL;
zend_str_size_int value_len = 0;
UChar* svalue = 0;
@ -305,7 +305,7 @@ PHP_FUNCTION( numfmt_set_symbol )
FORMATTER_METHOD_INIT_VARS;
/* Parse parameters. */
if( zend_parse_method_parameters( ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "OlS",
if( zend_parse_method_parameters( ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "OiS",
&object, NumberFormatter_ce_ptr, &symbol, &value, &value_len ) == FAILURE )
{
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,
@ -426,12 +426,12 @@ PHP_FUNCTION( numfmt_set_pattern )
*/
PHP_FUNCTION( numfmt_get_locale )
{
long type = ULOC_ACTUAL_LOCALE;
php_int_t type = ULOC_ACTUAL_LOCALE;
char* loc;
FORMATTER_METHOD_INIT_VARS;
/* Parse parameters. */
if( zend_parse_method_parameters( ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O|l",
if( zend_parse_method_parameters( ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O|i",
&object, NumberFormatter_ce_ptr, &type ) == FAILURE )
{
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,

6
ext/intl/formatter/formatter_format.c

@ -33,14 +33,14 @@
PHP_FUNCTION( numfmt_format )
{
zval **number;
long type = FORMAT_TYPE_DEFAULT;
php_int_t type = FORMAT_TYPE_DEFAULT;
UChar format_buf[32];
UChar* formatted = format_buf;
zend_str_size_int formatted_len = USIZE(format_buf);
FORMATTER_METHOD_INIT_VARS;
/* Parse parameters. */
if( zend_parse_method_parameters( ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "OZ|l",
if( zend_parse_method_parameters( ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "OZ|i",
&object, NumberFormatter_ce_ptr, &number, &type ) == FAILURE )
{
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,
@ -59,7 +59,7 @@ PHP_FUNCTION( numfmt_format )
if(Z_TYPE_PP(number) == IS_LONG) {
/* take INT32 on 32-bit, int64 on 64-bit */
type = (sizeof(long) == 8)?FORMAT_TYPE_INT64:FORMAT_TYPE_INT32;
type = (sizeof(php_int_t) == 8)?FORMAT_TYPE_INT64:FORMAT_TYPE_INT32;
} else if(Z_TYPE_PP(number) == IS_DOUBLE) {
type = FORMAT_TYPE_DOUBLE;
} else {

4
ext/intl/formatter/formatter_main.c

@ -30,13 +30,13 @@ static void numfmt_ctor(INTERNAL_FUNCTION_PARAMETERS)
const char* locale;
char* pattern = NULL;
zend_str_size_int locale_len = 0, pattern_len = 0;
long style;
php_int_t style;
UChar* spattern = NULL;
zend_str_size_int spattern_len = 0;
FORMATTER_METHOD_INIT_VARS;
/* Parse parameters. */
if( zend_parse_parameters( ZEND_NUM_ARGS() TSRMLS_CC, "Sl|S",
if( zend_parse_parameters( ZEND_NUM_ARGS() TSRMLS_CC, "Si|S",
&locale, &locale_len, &style, &pattern, &pattern_len ) == FAILURE )
{
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,

8
ext/intl/formatter/formatter_parse.c

@ -36,7 +36,7 @@
*/
PHP_FUNCTION( numfmt_parse )
{
long type = FORMAT_TYPE_DOUBLE;
php_int_t type = FORMAT_TYPE_DOUBLE;
UChar* sstr = NULL;
zend_str_size_int sstr_len = 0;
char* str = NULL;
@ -50,7 +50,7 @@ PHP_FUNCTION( numfmt_parse )
FORMATTER_METHOD_INIT_VARS;
/* Parse parameters. */
if( zend_parse_method_parameters( ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "OS|lz!",
if( zend_parse_method_parameters( ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "OS|iz!",
&object, NumberFormatter_ce_ptr, &str, &str_len, &type, &zposition ) == FAILURE )
{
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,
@ -83,10 +83,10 @@ PHP_FUNCTION( numfmt_parse )
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) {
if(val64 > ZEND_INT_MAX || val64 < ZEND_INT_MIN) {
RETVAL_DOUBLE(val64);
} else {
RETVAL_LONG((long)val64);
RETVAL_LONG((php_int_t)val64);
}
break;
case FORMAT_TYPE_DOUBLE:

30
ext/intl/grapheme/grapheme_string.c

@ -110,11 +110,11 @@ PHP_FUNCTION(grapheme_strpos)
unsigned char *haystack, *needle;
zend_str_size_int haystack_len, needle_len;
unsigned char *found;
long loffset = 0;
php_int_t loffset = 0;
int32_t offset = 0;
int ret_pos;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "SS|l", (char **)&haystack, &haystack_len, (char **)&needle, &needle_len, &loffset) == FAILURE) {
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "SS|i", (char **)&haystack, &haystack_len, (char **)&needle, &needle_len, &loffset) == FAILURE) {
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,
"grapheme_strpos: unable to parse input param", 0 TSRMLS_CC );
@ -177,12 +177,12 @@ PHP_FUNCTION(grapheme_stripos)
unsigned char *haystack, *needle, *haystack_dup, *needle_dup;
zend_str_size_int haystack_len, needle_len;
unsigned char *found;
long loffset = 0;
php_int_t loffset = 0;
int32_t offset = 0;
int ret_pos;
int is_ascii;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "SS|l", (char **)&haystack, &haystack_len, (char **)&needle, &needle_len, &loffset) == FAILURE) {
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "SS|i", (char **)&haystack, &haystack_len, (char **)&needle, &needle_len, &loffset) == FAILURE) {
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,
"grapheme_stripos: unable to parse input param", 0 TSRMLS_CC );
@ -251,12 +251,12 @@ PHP_FUNCTION(grapheme_strrpos)
{
unsigned char *haystack, *needle;
zend_str_size_int haystack_len, needle_len;
long loffset = 0;
php_int_t loffset = 0;
int32_t offset = 0;
int32_t ret_pos;
int is_ascii;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "SS|l", (char **)&haystack, &haystack_len, (char **)&needle, &needle_len, &loffset) == FAILURE) {
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "SS|i", (char **)&haystack, &haystack_len, (char **)&needle, &needle_len, &loffset) == FAILURE) {
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,
"grapheme_strrpos: unable to parse input param", 0 TSRMLS_CC );
@ -321,12 +321,12 @@ PHP_FUNCTION(grapheme_strripos)
{
unsigned char *haystack, *needle;
zend_str_size_int haystack_len, needle_len;
long loffset = 0;
php_int_t loffset = 0;
int32_t offset = 0;
int32_t ret_pos;
int is_ascii;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "SS|l", (char **)&haystack, &haystack_len, (char **)&needle, &needle_len, &loffset) == FAILURE) {
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "SS|i", (char **)&haystack, &haystack_len, (char **)&needle, &needle_len, &loffset) == FAILURE) {
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,
"grapheme_strrpos: unable to parse input param", 0 TSRMLS_CC );
@ -400,7 +400,7 @@ PHP_FUNCTION(grapheme_substr)
unsigned char *str, *sub_str;
UChar *ustr;
zend_str_size_int str_len, sub_str_len, ustr_len;
long lstart = 0, length = 0;
php_int_t lstart = 0, length = 0;
int32_t start = 0;
int iter_val;
UErrorCode status;
@ -409,7 +409,7 @@ PHP_FUNCTION(grapheme_substr)
int sub_str_start_pos, sub_str_end_pos;
int32_t (*iter_func)(UBreakIterator *);
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Sl|l", (char **)&str, &str_len, &lstart, &length) == FAILURE) {
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Si|i", (char **)&str, &str_len, &lstart, &length) == FAILURE) {
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,
"grapheme_substr: unable to parse input param", 0 TSRMLS_CC );
@ -810,17 +810,17 @@ PHP_FUNCTION(grapheme_extract)
unsigned char *str, *pstr;
UChar *ustr;
zend_str_size_int str_len, ustr_len;
long size; /* maximum number of grapheme clusters, bytes, or characters (based on extract_type) to return */
long lstart = 0; /* starting position in str in bytes */
php_int_t size; /* maximum number of grapheme clusters, bytes, or characters (based on extract_type) to return */
php_int_t lstart = 0; /* starting position in str in bytes */
int32_t start = 0;
long extract_type = GRAPHEME_EXTRACT_TYPE_COUNT;
php_int_t extract_type = GRAPHEME_EXTRACT_TYPE_COUNT;
UErrorCode status;
unsigned char u_break_iterator_buffer[U_BRK_SAFECLONE_BUFFERSIZE];
UBreakIterator* bi = NULL;
int ret_pos;
zval *next = NULL; /* return offset of next part of the string */
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Sl|llz", (char **)&str, &str_len, &size, &extract_type, &lstart, &next) == FAILURE) {
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Si|iiz", (char **)&str, &str_len, &size, &extract_type, &lstart, &next) == FAILURE) {
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,
"grapheme_extract: unable to parse input param", 0 TSRMLS_CC );
@ -890,7 +890,7 @@ PHP_FUNCTION(grapheme_extract)
*/
if ( grapheme_ascii_check(pstr, size + 1 < str_len ? size + 1 : str_len ) ) {
long nsize = ( size < str_len ? size : str_len );
php_int_t nsize = ( size < str_len ? size : str_len );
if ( NULL != next ) {
ZVAL_LONG(next, start+nsize);
}

16
ext/intl/grapheme/grapheme_util.c

@ -50,25 +50,25 @@ grapheme_close_global_iterator( TSRMLS_D )
/* XXX that's the same mess we have in substr(), revise it with care when int64 is integrated and get rid of this ugly casts */
/* {{{ grapheme_substr_ascii f='from' - starting point, l='length' */
void grapheme_substr_ascii(char *str, zend_str_size_int str_len, long f, long l, int argc, char **sub_str, zend_str_size_int *sub_str_len)
void grapheme_substr_ascii(char *str, zend_str_size_int str_len, php_int_t f, php_int_t l, int argc, char **sub_str, zend_str_size_int *sub_str_len)
{
*sub_str = NULL;
if (argc > 2) {
if ((l < 0 && -l > str_len)) {
return;
} else if (l > (long)str_len) {
} else if (l > (php_int_t)str_len) {
l = str_len;
}
} else {
l = str_len;
}
if (f > (long)str_len || (f < 0 && -f > str_len)) {
if (f > (php_int_t)str_len || (f < 0 && -f > str_len)) {
return;
}
if (l < 0 && (l + (long)str_len - f) < 0) {
if (l < 0 && (l + (php_int_t)str_len - f) < 0) {
return;
}
@ -76,7 +76,7 @@ void grapheme_substr_ascii(char *str, zend_str_size_int str_len, long f, long l,
* of the string
*/
if (f < 0) {
f = (long)str_len + f;
f = (php_int_t)str_len + f;
if (f < 0) {
f = 0;
}
@ -87,17 +87,17 @@ void grapheme_substr_ascii(char *str, zend_str_size_int str_len, long f, long l,
* needed to stop that many chars from the end of the string
*/
if (l < 0) {
l = ((long)str_len - f) + l;
l = ((php_int_t)str_len - f) + l;
if (l < 0) {
l = 0;
}
}
if (f >= (long)str_len) {
if (f >= (php_int_t)str_len) {
return;
}
if ((f + l) > (long)str_len) {
if ((f + l) > (php_int_t)str_len) {
l = str_len - f;
}

2
ext/intl/grapheme/grapheme_util.h

@ -23,7 +23,7 @@
/* get_break_interator: get a break iterator from the global structure */
UBreakIterator* grapheme_get_break_iterator(void *stack_buffer, UErrorCode *status TSRMLS_DC );
void grapheme_substr_ascii(char *str, zend_str_size_int str_len, long f, long l, int argc, char **sub_str, zend_str_size_int *sub_str_len);
void grapheme_substr_ascii(char *str, zend_str_size_int str_len, php_int_t f, php_int_t l, int argc, char **sub_str, zend_str_size_int *sub_str_len);
int grapheme_strrpos_utf16(unsigned char *haystack, int32_t haystack_len, unsigned char*needle, int32_t needle_len, int32_t offset, int f_ignore_case TSRMLS_DC);

6
ext/intl/idn/idn.c

@ -190,7 +190,7 @@ static void php_intl_idn_to_46(INTERNAL_FUNCTION_PARAMETERS,
}
add_assoc_bool_ex(idna_info, "isTransitionalDifferent",
sizeof("isTransitionalDifferent"), info.isTransitionalDifferent);
add_assoc_long_ex(idna_info, "errors", sizeof("errors"), (long)info.errors);
add_assoc_long_ex(idna_info, "errors", sizeof("errors"), (php_int_t)info.errors);
}
if (!buffer_used) {
@ -263,13 +263,13 @@ static void php_intl_idn_handoff(INTERNAL_FUNCTION_PARAMETERS, int mode)
{
char *domain;
zend_str_size_int domain_len;
long option = 0,
php_int_t option = 0,
variant = INTL_IDN_VARIANT_2003;
zval *idna_info = NULL;
intl_error_reset(NULL TSRMLS_CC);
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "S|llz",
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "S|iiz",
&domain, &domain_len, &option, &variant, &idna_info) == FAILURE) {
php_intl_bad_args("bad arguments", mode TSRMLS_CC);
RETURN_NULL(); /* don't set FALSE because that's not the way it was before... */

4
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_long( &ret, (php_int_t ) 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_long( &ret, (php_int_t ) pe->offset );
any = 1;
}

4
ext/intl/msgformat/msgformat_helpers.cpp

@ -392,7 +392,7 @@ U_CFUNC void umsg_format_helper(MessageFormatter_object *mfo,
int key_type;
char *str_index;
zend_str_size_uint str_len;
ulong num_index;
php_uint_t num_index;
for (zend_hash_internal_pointer_reset_ex(args, &pos);
U_SUCCESS(err.code) &&
@ -676,7 +676,7 @@ U_CFUNC void umsg_parse_helper(UMessageFormat *fmt, int *count, zval ***args, UC
if(aInt64 > LONG_MAX || aInt64 < -LONG_MAX) {
ZVAL_DOUBLE((*args)[i], (double)aInt64);
} else {
ZVAL_LONG((*args)[i], (long)aInt64);
ZVAL_LONG((*args)[i], (php_int_t)aInt64);
}
break;

4
ext/intl/normalizer/normalizer_normalize.c

@ -34,7 +34,7 @@ PHP_FUNCTION( normalizer_normalize )
{
char* input = NULL;
/* form is optional, defaults to FORM_C */
long form = NORMALIZER_DEFAULT;
php_int_t form = NORMALIZER_DEFAULT;
zend_str_size_int input_len = 0;
UChar* uinput = NULL;
@ -172,7 +172,7 @@ PHP_FUNCTION( normalizer_is_normalized )
{
char* input = NULL;
/* form is optional, defaults to FORM_C */
long form = NORMALIZER_DEFAULT;
php_int_t form = NORMALIZER_DEFAULT;
zend_str_size_int input_len = 0;
UChar* uinput = NULL;

2
ext/intl/php_intl.h

@ -50,7 +50,7 @@ ZEND_BEGIN_MODULE_GLOBALS(intl)
collator_compare_func_t compare_func;
UBreakIterator* grapheme_iterator;
intl_error g_error;
long error_level;
php_int_t error_level;
zend_bool use_exceptions;
ZEND_END_MODULE_GLOBALS(intl)

2
ext/intl/resourcebundle/resourcebundle.c

@ -32,7 +32,7 @@ void resourcebundle_extract_value( zval *return_value, ResourceBundle_object *so
const int32_t* vfield;
int32_t ilen;
int i;
long lfield;
php_int_t lfield;
ResourceBundle_object* newrb;
restype = ures_getType( source->child );

2
ext/intl/resourcebundle/resourcebundle_class.c

@ -256,7 +256,7 @@ PHP_FUNCTION( resourcebundle_get )
/* }}} */
/* {{{ resourcebundle_array_count */
int resourcebundle_array_count(zval *object, long *count TSRMLS_DC)
int resourcebundle_array_count(zval *object, php_int_t *count TSRMLS_DC)
{
ResourceBundle_object *rb;
RESOURCEBUNDLE_METHOD_FETCH_OBJECT_NO_CHECK;

4
ext/intl/resourcebundle/resourcebundle_iterator.h

@ -25,10 +25,10 @@ typedef struct {
zend_object_iterator intern;
ResourceBundle_object *subject;
zend_bool is_table;
long length;
php_int_t length;
zval *current;
char *currentkey;
long i;
php_int_t i;
} ResourceBundle_iterator;
zend_object_iterator *resourcebundle_get_iterator( zend_class_entry *ce, zval *object, int byref TSRMLS_DC );

4
ext/intl/spoofchecker/spoofchecker_main.c

@ -115,10 +115,10 @@ PHP_METHOD(Spoofchecker, setAllowedLocales)
*/
PHP_METHOD(Spoofchecker, setChecks)
{
long checks;
php_int_t checks;
SPOOFCHECKER_METHOD_INIT_VARS;
if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &checks)) {
if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "i", &checks)) {
return;
}

4
ext/intl/timezone/timezone_class.cpp

@ -320,9 +320,9 @@ static HashTable *TimeZone_get_debug_info(zval *object, int *is_temp TSRMLS_DC)
return Z_ARRVAL(zv);
}
add_assoc_long_ex(&zv, "rawOffset", sizeof("rawOffset"), (long)rawOffset);
add_assoc_long_ex(&zv, "rawOffset", sizeof("rawOffset"), (php_int_t)rawOffset);
add_assoc_long_ex(&zv, "currentOffset", sizeof("currentOffset"),
(long)(rawOffset + dstOffset));
(php_int_t)(rawOffset + dstOffset));
return Z_ARRVAL(zv);
}

26
ext/intl/timezone/timezone_methods.cpp

@ -161,8 +161,8 @@ U_CFUNC PHP_FUNCTION(intltz_create_enumeration)
se = TimeZone::createEnumeration();
} else if (Z_TYPE_PP(arg) == IS_LONG) {
int_offset:
if (Z_LVAL_PP(arg) < (long)INT32_MIN ||
Z_LVAL_PP(arg) > (long)INT32_MAX) {
if (Z_LVAL_PP(arg) < (php_int_t)INT32_MIN ||
Z_LVAL_PP(arg) > (php_int_t)INT32_MAX) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
"intltz_create_enumeration: value is out of range", 0 TSRMLS_CC);
RETURN_FALSE;
@ -174,7 +174,7 @@ double_offset:
convert_to_long_ex(arg);
goto int_offset;
} else if (Z_TYPE_PP(arg) == IS_OBJECT || Z_TYPE_PP(arg) == IS_STRING) {
long lval;
php_int_t lval;
double dval;
convert_to_string_ex(arg);
switch (is_numeric_string(Z_STRVAL_PP(arg), Z_STRSIZE_PP(arg), &lval, &dval, 0)) {
@ -230,13 +230,13 @@ U_CFUNC PHP_FUNCTION(intltz_count_equivalent_ids)
}
int32_t result = TimeZone::countEquivalentIDs(id);
RETURN_LONG((long)result);
RETURN_LONG((php_int_t)result);
}
#if U_ICU_VERSION_MAJOR_NUM * 10 + U_ICU_VERSION_MINOR_NUM >= 48
U_CFUNC PHP_FUNCTION(intltz_create_time_zone_id_enumeration)
{
long zoneType,
php_int_t zoneType,
offset_arg;
char *region = NULL;
zend_str_size_int region_len = 0;
@ -252,7 +252,7 @@ U_CFUNC PHP_FUNCTION(intltz_create_time_zone_id_enumeration)
!= FAILURE && Z_TYPE_PP(zvoffset) == IS_NULL;
}
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l|S!l",
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "i|S!i",
&zoneType, &region, &region_len, &offset_arg) == FAILURE) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
"intltz_create_time_zone_id_enumeration: bad arguments", 0 TSRMLS_CC);
@ -267,7 +267,7 @@ U_CFUNC PHP_FUNCTION(intltz_create_time_zone_id_enumeration)
}
if (ZEND_NUM_ARGS() == 3) {
if (offset_arg < (long)INT32_MIN || offset_arg > (long)INT32_MAX) {
if (offset_arg < (php_int_t)INT32_MIN || offset_arg > (php_int_t)INT32_MAX) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
"intltz_create_time_zone_id_enumeration: offset out of bounds", 0 TSRMLS_CC);
RETURN_FALSE;
@ -381,12 +381,12 @@ U_CFUNC PHP_FUNCTION(intltz_get_equivalent_id)
{
char *str_id;
zend_str_size_int str_id_len;
long index;
php_int_t index;
intl_error_reset(NULL TSRMLS_CC);
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Sl",
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Si",
&str_id, &str_id_len, &index) == FAILURE ||
index < (long)INT32_MIN || index > (long)INT32_MAX) {
index < (php_int_t)INT32_MIN || index > (php_int_t)INT32_MAX) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
"intltz_get_equivalent_id: bad arguments", 0 TSRMLS_CC);
RETURN_FALSE;
@ -535,7 +535,7 @@ static const TimeZone::EDisplayType display_types[] = {
U_CFUNC PHP_FUNCTION(intltz_get_display_name)
{
zend_bool daylight = 0;
long display_type = TimeZone::LONG;
php_int_t display_type = TimeZone::LONG;
const char *locale_str = NULL;
zend_str_size_int dummy = 0;
TIMEZONE_METHOD_INIT_VARS;
@ -590,7 +590,7 @@ U_CFUNC PHP_FUNCTION(intltz_get_dst_savings)
TIMEZONE_METHOD_FETCH_OBJECT;
RETURN_LONG((long)to->utimezone->getDSTSavings());
RETURN_LONG((php_int_t)to->utimezone->getDSTSavings());
}
U_CFUNC PHP_FUNCTION(intltz_to_date_time_zone)
@ -632,7 +632,7 @@ U_CFUNC PHP_FUNCTION(intltz_get_error_code)
if (to == NULL)
RETURN_FALSE;
RETURN_LONG((long)TIMEZONE_ERROR_CODE(to));
RETURN_LONG((php_int_t)TIMEZONE_ERROR_CODE(to));
}
U_CFUNC PHP_FUNCTION(intltz_get_error_message)

18
ext/intl/transliterator/transliterator_methods.c

@ -27,7 +27,7 @@
#include <zend_exceptions.h>
static int create_transliterator( char *str_id, zend_str_size_int str_id_len, long direction, zval *object TSRMLS_DC )
static int create_transliterator( char *str_id, zend_str_size_int str_id_len, php_int_t direction, zval *object TSRMLS_DC )
{
Transliterator_object *to;
UChar *ustr_id = NULL;
@ -105,14 +105,14 @@ PHP_FUNCTION( transliterator_create )
{
char *str_id;
zend_str_size_int str_id_len;
long direction = TRANSLITERATOR_FORWARD;
php_int_t direction = TRANSLITERATOR_FORWARD;
int res;
TRANSLITERATOR_METHOD_INIT_VARS;
(void) to; /* unused */
if( zend_parse_parameters( ZEND_NUM_ARGS() TSRMLS_CC, "S|l",
if( zend_parse_parameters( ZEND_NUM_ARGS() TSRMLS_CC, "S|i",
&str_id, &str_id_len, &direction ) == FAILURE )
{
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,
@ -139,14 +139,14 @@ PHP_FUNCTION( transliterator_create_from_rules )
zend_str_size_int str_rules_len;
UChar *ustr_rules = NULL;
zend_str_size_int ustr_rules_len = 0;
long direction = TRANSLITERATOR_FORWARD;
php_int_t direction = TRANSLITERATOR_FORWARD;
UParseError parse_error = {0, -1};
UTransliterator *utrans;
UChar id[] = {0x52, 0x75, 0x6C, 0x65, 0x73, 0x54, 0x72,
0x61, 0x6E, 0x73, 0x50, 0x48, 0x50, 0}; /* RulesTransPHP */
TRANSLITERATOR_METHOD_INIT_VARS;
if( zend_parse_parameters( ZEND_NUM_ARGS() TSRMLS_CC, "S|l",
if( zend_parse_parameters( ZEND_NUM_ARGS() TSRMLS_CC, "S|i",
&str_rules, &str_rules_len, &direction ) == FAILURE )
{
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,
@ -305,7 +305,7 @@ PHP_FUNCTION( transliterator_transliterate )
zend_str_size_int ustr_len = 0;
int32_t capacity,
uresult_len;
long start = 0,
php_int_t start = 0,
limit = -1;
int success = 0,
temp_trans = 0;
@ -317,7 +317,7 @@ PHP_FUNCTION( transliterator_transliterate )
{
/* in non-OOP version, accept both a transliterator and a string */
zval **arg1;
if( zend_parse_parameters( ZEND_NUM_ARGS() TSRMLS_CC, "ZS|ll",
if( zend_parse_parameters( ZEND_NUM_ARGS() TSRMLS_CC, "ZS|ii",
&arg1, &str, &str_len, &start, &limit ) == FAILURE )
{
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,
@ -353,7 +353,7 @@ PHP_FUNCTION( transliterator_transliterate )
}
}
}
else if( zend_parse_parameters( ZEND_NUM_ARGS() TSRMLS_CC, "S|ll",
else if( zend_parse_parameters( ZEND_NUM_ARGS() TSRMLS_CC, "S|ii",
&str, &str_len, &start, &limit ) == FAILURE )
{
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,
@ -496,7 +496,7 @@ PHP_FUNCTION( transliterator_get_error_code )
if (to == NULL )
RETURN_FALSE;
RETURN_LONG( (long) TRANSLITERATOR_ERROR_CODE( to ) );
RETURN_LONG( (php_int_t) TRANSLITERATOR_ERROR_CODE( to ) );
}
/* }}} */

14
ext/standard/php_smart_str.h

@ -154,15 +154,15 @@
* #define f(..) ({char *r;..;__r;})
*/
static inline char *smart_str_print_long(char *buf, php_int_t num) {
static inline char *smart_str_print_long(char *buf, zend_int_t num) {
char *r;
smart_str_print_long4(buf, num, php_uint_t, r);
smart_str_print_long4(buf, num, zend_uint_t, r);
return r;
}
static inline char *smart_str_print_unsigned(char *buf, php_int_t num) {
static inline char *smart_str_print_unsigned(char *buf, zend_int_t num) {
char *r;
smart_str_print_unsigned4(buf, num, php_uint_t, r);
smart_str_print_unsigned4(buf, num, zend_uint_t, r);
return r;
}
@ -174,16 +174,16 @@ static inline char *smart_str_print_unsigned(char *buf, php_int_t num) {
} while (0)
#define smart_str_append_unsigned_ex(dest, num, type) \
smart_str_append_generic_ex((dest), (num), (type), php_uint_t, _unsigned)
smart_str_append_generic_ex((dest), (num), (type), zend_uint_t, _unsigned)
#define smart_str_append_long_ex(dest, num, type) \
smart_str_append_generic_ex((dest), (num), (type), php_uint_t, _long)
smart_str_append_generic_ex((dest), (num), (type), zend_uint_t, _long)
#define smart_str_append_str_size_ex(dest, num, type) \
smart_str_append_generic_ex((dest), (num), (type), zend_str_size, _long)
#define smart_str_append_php_int_ex(dest, num, type) \
smart_str_append_generic_ex((dest), (num), (type), php_int_t, _long)
smart_str_append_generic_ex((dest), (num), (type), zend_int_t, _long)
#define smart_str_append_off_t_ex(dest, num, type) \
smart_str_append_generic_ex((dest), (num), (type), zend_off_t, _long)

Loading…
Cancel
Save