summaryrefslogtreecommitdiff
path: root/ext/intl/dateformat/dateformat_parse.c
diff options
context:
space:
mode:
Diffstat (limited to 'ext/intl/dateformat/dateformat_parse.c')
-rw-r--r--ext/intl/dateformat/dateformat_parse.c28
1 files changed, 14 insertions, 14 deletions
diff --git a/ext/intl/dateformat/dateformat_parse.c b/ext/intl/dateformat/dateformat_parse.c
index fb3da3e053..eb28a39ba2 100644
--- a/ext/intl/dateformat/dateformat_parse.c
+++ b/ext/intl/dateformat/dateformat_parse.c
@@ -57,24 +57,24 @@ 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, (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 ){
/* 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 );
}
}
@@ -86,7 +86,7 @@ static void internal_parse_to_localtime(IntlDateFormatter_object *dfo, char* tex
UCalendar *parsed_calendar = NULL;
UChar* text_utf16 = NULL;
int32_t 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));
@@ -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);
}
}
/* }}} */