diff options
Diffstat (limited to 'ext/intl/calendar')
-rw-r--r-- | ext/intl/calendar/calendar_class.cpp | 90 | ||||
-rw-r--r-- | ext/intl/calendar/calendar_methods.cpp | 26 |
2 files changed, 58 insertions, 58 deletions
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) |