diff options
Diffstat (limited to 'ext/intl/formatter')
-rw-r--r-- | ext/intl/formatter/formatter_attr.c | 26 | ||||
-rw-r--r-- | ext/intl/formatter/formatter_format.c | 6 | ||||
-rw-r--r-- | ext/intl/formatter/formatter_main.c | 4 | ||||
-rw-r--r-- | ext/intl/formatter/formatter_parse.c | 8 |
4 files changed, 22 insertions, 22 deletions
diff --git a/ext/intl/formatter/formatter_attr.c b/ext/intl/formatter/formatter_attr.c index d58d331ffd..1a1409448a 100644 --- a/ext/intl/formatter/formatter_attr.c +++ b/ext/intl/formatter/formatter_attr.c @@ -32,7 +32,7 @@ */ PHP_FUNCTION( numfmt_get_attribute ) { - long attribute, value; + php_int_t attribute, value; FORMATTER_METHOD_INIT_VARS; /* Parse parameters. */ @@ -101,7 +101,7 @@ PHP_FUNCTION( numfmt_get_attribute ) */ PHP_FUNCTION( numfmt_get_text_attribute ) { - long attribute; + php_int_t attribute; UChar value_buf[64]; int value_buf_size = USIZE( value_buf ); UChar* value = value_buf; @@ -109,7 +109,7 @@ PHP_FUNCTION( numfmt_get_text_attribute ) FORMATTER_METHOD_INIT_VARS; /* Parse parameters. */ - if( zend_parse_method_parameters( ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Ol", + if( zend_parse_method_parameters( ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Oi", &object, NumberFormatter_ce_ptr, &attribute ) == FAILURE ) { intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, @@ -145,12 +145,12 @@ PHP_FUNCTION( numfmt_get_text_attribute ) */ PHP_FUNCTION( numfmt_set_attribute ) { - long attribute; + php_int_t attribute; zval *value; FORMATTER_METHOD_INIT_VARS; /* Parse parameters. */ - if( zend_parse_method_parameters( ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Olz", + if( zend_parse_method_parameters( ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Oiz", &object, NumberFormatter_ce_ptr, &attribute, &value ) == FAILURE) { intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, @@ -209,13 +209,13 @@ PHP_FUNCTION( numfmt_set_text_attribute ) { int slength = 0; UChar *svalue = NULL; - long attribute; + php_int_t attribute; char *value; int len; FORMATTER_METHOD_INIT_VARS; /* Parse parameters. */ - if( zend_parse_method_parameters( ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Ols", + if( zend_parse_method_parameters( ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Ois", &object, NumberFormatter_ce_ptr, &attribute, &value, &len ) == FAILURE) { intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, @@ -249,14 +249,14 @@ PHP_FUNCTION( numfmt_set_text_attribute ) */ PHP_FUNCTION( numfmt_get_symbol ) { - long symbol; + php_int_t symbol; UChar value_buf[4]; UChar *value = value_buf; int length = USIZE(value_buf); FORMATTER_METHOD_INIT_VARS; /* Parse parameters. */ - if( zend_parse_method_parameters( ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Ol", + if( zend_parse_method_parameters( ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Oi", &object, NumberFormatter_ce_ptr, &symbol ) == FAILURE ) { intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, @@ -297,7 +297,7 @@ PHP_FUNCTION( numfmt_get_symbol ) */ PHP_FUNCTION( numfmt_set_symbol ) { - long symbol; + php_int_t symbol; char* value = NULL; int value_len = 0; UChar* svalue = 0; @@ -305,7 +305,7 @@ PHP_FUNCTION( numfmt_set_symbol ) FORMATTER_METHOD_INIT_VARS; /* Parse parameters. */ - if( zend_parse_method_parameters( ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Ols", + if( zend_parse_method_parameters( ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Ois", &object, NumberFormatter_ce_ptr, &symbol, &value, &value_len ) == FAILURE ) { intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, @@ -426,12 +426,12 @@ PHP_FUNCTION( numfmt_set_pattern ) */ PHP_FUNCTION( numfmt_get_locale ) { - long type = ULOC_ACTUAL_LOCALE; + php_int_t type = ULOC_ACTUAL_LOCALE; char* loc; FORMATTER_METHOD_INIT_VARS; /* Parse parameters. */ - if( zend_parse_method_parameters( ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O|l", + if( zend_parse_method_parameters( ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O|i", &object, NumberFormatter_ce_ptr, &type ) == FAILURE ) { intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, diff --git a/ext/intl/formatter/formatter_format.c b/ext/intl/formatter/formatter_format.c index a51c9876b7..3fe5d6abf1 100644 --- a/ext/intl/formatter/formatter_format.c +++ b/ext/intl/formatter/formatter_format.c @@ -33,14 +33,14 @@ PHP_FUNCTION( numfmt_format ) { zval *number; - long type = FORMAT_TYPE_DEFAULT; + php_int_t type = FORMAT_TYPE_DEFAULT; UChar format_buf[32]; UChar* formatted = format_buf; int formatted_len = USIZE(format_buf); FORMATTER_METHOD_INIT_VARS; /* Parse parameters. */ - if( zend_parse_method_parameters( ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Oz|l", + if( zend_parse_method_parameters( ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Oz|i", &object, NumberFormatter_ce_ptr, &number, &type ) == FAILURE ) { intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, @@ -59,7 +59,7 @@ PHP_FUNCTION( numfmt_format ) if(Z_TYPE_P(number) == IS_INT) { /* take INT32 on 32-bit, int64 on 64-bit */ - type = (sizeof(long) == 8)?FORMAT_TYPE_INT64:FORMAT_TYPE_INT32; + type = (sizeof(php_int_t) == 8)?FORMAT_TYPE_INT64:FORMAT_TYPE_INT32; } else if(Z_TYPE_P(number) == IS_DOUBLE) { type = FORMAT_TYPE_DOUBLE; } else { diff --git a/ext/intl/formatter/formatter_main.c b/ext/intl/formatter/formatter_main.c index 3bb46c3204..f24df76f51 100644 --- a/ext/intl/formatter/formatter_main.c +++ b/ext/intl/formatter/formatter_main.c @@ -30,13 +30,13 @@ static void numfmt_ctor(INTERNAL_FUNCTION_PARAMETERS) const char* locale; char* pattern = NULL; int locale_len = 0, pattern_len = 0; - long style; + php_int_t style; UChar* spattern = NULL; int spattern_len = 0; FORMATTER_METHOD_INIT_VARS; /* Parse parameters. */ - if( zend_parse_parameters( ZEND_NUM_ARGS() TSRMLS_CC, "sl|s", + if( zend_parse_parameters( ZEND_NUM_ARGS() TSRMLS_CC, "si|s", &locale, &locale_len, &style, &pattern, &pattern_len ) == FAILURE ) { intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, diff --git a/ext/intl/formatter/formatter_parse.c b/ext/intl/formatter/formatter_parse.c index 57ab4e28d8..3d0c84dab6 100644 --- a/ext/intl/formatter/formatter_parse.c +++ b/ext/intl/formatter/formatter_parse.c @@ -36,7 +36,7 @@ */ PHP_FUNCTION( numfmt_parse ) { - long type = FORMAT_TYPE_DOUBLE; + php_int_t type = FORMAT_TYPE_DOUBLE; UChar* sstr = NULL; int sstr_len = 0; char* str = NULL; @@ -50,7 +50,7 @@ PHP_FUNCTION( numfmt_parse ) FORMATTER_METHOD_INIT_VARS; /* Parse parameters. */ - if( zend_parse_method_parameters( ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os|lz/!", + if( zend_parse_method_parameters( ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os|iz/!", &object, NumberFormatter_ce_ptr, &str, &str_len, &type, &zposition ) == FAILURE ) { intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, @@ -86,10 +86,10 @@ PHP_FUNCTION( numfmt_parse ) break; case FORMAT_TYPE_INT64: val64 = unum_parseInt64(FORMATTER_OBJECT(nfo), sstr, sstr_len, position_p, &INTL_DATA_ERROR_CODE(nfo)); - if(val64 > LONG_MAX || val64 < LONG_MIN) { + if(val64 > ZEND_INT_MAX || val64 < ZEND_INT_MIN) { RETVAL_DOUBLE(val64); } else { - RETVAL_INT((long)val64); + RETVAL_INT((php_int_t)val64); } break; case FORMAT_TYPE_DOUBLE: |