summaryrefslogtreecommitdiff
path: root/ext/intl/calendar
diff options
context:
space:
mode:
authorAnatol Belski <ab@php.net>2014-08-19 22:57:17 +0200
committerAnatol Belski <ab@php.net>2014-08-19 22:57:17 +0200
commit063079b62e383036dd24cd6465d3db31edf6cb6d (patch)
treefdbf5ac3e408fbd7ef46be5ffc3d65b33eaccc24 /ext/intl/calendar
parent729bce4321b54e7054a88c0d90f4d102729ba570 (diff)
downloadphp-git-063079b62e383036dd24cd6465d3db31edf6cb6d.tar.gz
ported ext/intl, bugfixes to go
Diffstat (limited to 'ext/intl/calendar')
-rw-r--r--ext/intl/calendar/calendar_methods.cpp74
-rw-r--r--ext/intl/calendar/gregoriancalendar_methods.cpp6
2 files changed, 40 insertions, 40 deletions
diff --git a/ext/intl/calendar/calendar_methods.cpp b/ext/intl/calendar/calendar_methods.cpp
index 29a131533d..6cd58540b8 100644
--- a/ext/intl/calendar/calendar_methods.cpp
+++ b/ext/intl/calendar/calendar_methods.cpp
@@ -219,12 +219,12 @@ 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;
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);
@@ -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_INT((long)result);
+ RETURN_INT((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;
@@ -399,7 +399,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;
int i;
@@ -423,7 +423,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);
@@ -462,7 +462,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;
@@ -488,7 +488,7 @@ U_CFUNC PHP_FUNCTION(intlcal_roll)
}
bool_variant_val = Z_TYPE(args[1]) == IS_TRUE? 1 : 0;
} 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;
@@ -524,7 +524,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;
@@ -547,7 +547,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;
@@ -572,12 +572,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;
@@ -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_INT((long)result);
+ RETURN_INT((php_int_t)result);
}
U_CFUNC PHP_FUNCTION(intlcal_get_actual_maximum)
@@ -614,11 +614,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;
@@ -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_INT((long)result);
+ RETURN_INT((php_int_t)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_INT((long)result);
+ RETURN_INT((php_int_t)result);
}
static void _php_intlcal_field_ret_in32t_method(
@@ -666,12 +666,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);
@@ -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_INT((long)result);
+ RETURN_INT((php_int_t)result);
}
U_CFUNC PHP_FUNCTION(intlcal_get_greatest_minimum)
@@ -707,11 +707,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;
@@ -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_INT((long)result);
+ RETURN_INT((php_int_t)result);
}
U_CFUNC PHP_FUNCTION(intlcal_get_minimum)
@@ -807,11 +807,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;
@@ -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_INT((long)res);
+ RETURN_INT((php_int_t)res);
}
#endif
@@ -898,11 +898,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;
@@ -953,11 +953,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;
@@ -997,11 +997,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;
@@ -1085,11 +1085,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;
@@ -1110,11 +1110,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;
diff --git a/ext/intl/calendar/gregoriancalendar_methods.cpp b/ext/intl/calendar/gregoriancalendar_methods.cpp
index e62164f7d6..09ad390b96 100644
--- a/ext/intl/calendar/gregoriancalendar_methods.cpp
+++ b/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;
int locale_len;
- long largs[6];
+ php_int_t largs[6];
UErrorCode status = U_ZERO_ERROR;
int variant;
intl_error_reset(NULL TSRMLS_CC);
@@ -242,11 +242,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;