diff options
author | Anatol Belski <ab@php.net> | 2014-08-19 08:07:31 +0200 |
---|---|---|
committer | Anatol Belski <ab@php.net> | 2014-08-19 08:07:31 +0200 |
commit | 63d3f0b844b3a5f1c94be3c97bca29235dc2b3fc (patch) | |
tree | e561a58d6e084c5e4cbdde1f84aed16cf4724383 /ext/intl/dateformat/dateformat_parse.c | |
parent | 1e8273964fbd517a2eb9e560f9cdb4afffa0c034 (diff) | |
download | php-git-63d3f0b844b3a5f1c94be3c97bca29235dc2b3fc.tar.gz |
basic macro replacements, all at once
Diffstat (limited to 'ext/intl/dateformat/dateformat_parse.c')
-rw-r--r-- | ext/intl/dateformat/dateformat_parse.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/ext/intl/dateformat/dateformat_parse.c b/ext/intl/dateformat/dateformat_parse.c index fb3da3e053..70d640ac2e 100644 --- a/ext/intl/dateformat/dateformat_parse.c +++ b/ext/intl/dateformat/dateformat_parse.c @@ -57,7 +57,7 @@ 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, (long)result); } } /* }}} */ @@ -69,12 +69,12 @@ static void add_to_localtime_arr( IntlDateFormatter_object *dfo, zval* return_va 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 ); } } @@ -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); } } /* }}} */ |