summaryrefslogtreecommitdiff
path: root/ext/intl/calendar/calendar_methods.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'ext/intl/calendar/calendar_methods.cpp')
-rw-r--r--ext/intl/calendar/calendar_methods.cpp86
1 files changed, 43 insertions, 43 deletions
diff --git a/ext/intl/calendar/calendar_methods.cpp b/ext/intl/calendar/calendar_methods.cpp
index 3684c229a1..23fb376604 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_LONG((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);
@@ -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);
@@ -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_LONG((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_LONG((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_LONG((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_LONG((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_LONG((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_LONG((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;
@@ -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,16 +1080,16 @@ 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)
{
- 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;
@@ -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((php_int_t)CALENDAR_ERROR_CODE(co));
}
U_CFUNC PHP_FUNCTION(intlcal_get_error_message)