From 4fbaddb4f8b041769bea7efdd12313641387bd14 Mon Sep 17 00:00:00 2001 From: Xinchen Hui Date: Sat, 28 Jun 2014 00:02:50 +0800 Subject: Refactoring ext/intl (incompleted) --- ext/intl/common/common_error.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'ext/intl/common/common_error.c') diff --git a/ext/intl/common/common_error.c b/ext/intl/common/common_error.c index a0ee7c145f..f9289ad23b 100644 --- a/ext/intl/common/common_error.c +++ b/ext/intl/common/common_error.c @@ -37,8 +37,7 @@ PHP_FUNCTION( intl_get_error_code ) */ PHP_FUNCTION( intl_get_error_message ) { - char* message = intl_error_get_message( NULL TSRMLS_CC ); - RETURN_STRING( message, FALSE ); + RETURN_STR(intl_error_get_message( NULL TSRMLS_CC )); } /* }}} */ @@ -63,6 +62,7 @@ PHP_FUNCTION( intl_is_failure ) RETURN_BOOL( U_FAILURE( err_code ) ); } +/* }}} */ /* {{{ proto string intl_error_name() * Return a string for a given error code. @@ -82,7 +82,7 @@ PHP_FUNCTION( intl_error_name ) RETURN_FALSE; } - RETURN_STRING( (char*)u_errorName( err_code ), 1 ); + RETURN_STRING( (char*)u_errorName( err_code ) ); } /* }}} */ -- cgit v1.2.1 From e4e9e80067076074e3e6fd9fd2603ec7698c0d33 Mon Sep 17 00:00:00 2001 From: Xinchen Hui Date: Sat, 28 Jun 2014 20:14:12 +0800 Subject: Fixed segfault while starting up --- ext/intl/common/common_error.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'ext/intl/common/common_error.c') diff --git a/ext/intl/common/common_error.c b/ext/intl/common/common_error.c index f9289ad23b..2db688ac71 100644 --- a/ext/intl/common/common_error.c +++ b/ext/intl/common/common_error.c @@ -91,7 +91,7 @@ PHP_FUNCTION( intl_error_name ) */ void intl_expose_icu_error_codes( INIT_FUNC_ARGS ) { - #define INTL_EXPOSE_CONST(x) REGISTER_LONG_CONSTANT(#x, x, CONST_CS) + #define INTL_EXPOSE_CONST(x) REGISTER_LONG_CONSTANT(#x, x, CONST_PERSISTENT | CONST_CS) /* Warnings */ INTL_EXPOSE_CONST( U_USING_FALLBACK_WARNING ); -- cgit v1.2.1 From 63d3f0b844b3a5f1c94be3c97bca29235dc2b3fc Mon Sep 17 00:00:00 2001 From: Anatol Belski Date: Tue, 19 Aug 2014 08:07:31 +0200 Subject: basic macro replacements, all at once --- ext/intl/common/common_error.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'ext/intl/common/common_error.c') diff --git a/ext/intl/common/common_error.c b/ext/intl/common/common_error.c index 2db688ac71..fbdf82ed9c 100644 --- a/ext/intl/common/common_error.c +++ b/ext/intl/common/common_error.c @@ -28,7 +28,7 @@ */ PHP_FUNCTION( intl_get_error_code ) { - RETURN_LONG( intl_error_get_code( NULL TSRMLS_CC ) ); + RETURN_INT( intl_error_get_code( NULL TSRMLS_CC ) ); } /* }}} */ @@ -91,7 +91,7 @@ PHP_FUNCTION( intl_error_name ) */ void intl_expose_icu_error_codes( INIT_FUNC_ARGS ) { - #define INTL_EXPOSE_CONST(x) REGISTER_LONG_CONSTANT(#x, x, CONST_PERSISTENT | CONST_CS) + #define INTL_EXPOSE_CONST(x) REGISTER_INT_CONSTANT(#x, x, CONST_PERSISTENT | CONST_CS) /* Warnings */ INTL_EXPOSE_CONST( U_USING_FALLBACK_WARNING ); -- cgit v1.2.1 From 063079b62e383036dd24cd6465d3db31edf6cb6d Mon Sep 17 00:00:00 2001 From: Anatol Belski Date: Tue, 19 Aug 2014 22:57:17 +0200 Subject: ported ext/intl, bugfixes to go --- ext/intl/common/common_error.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'ext/intl/common/common_error.c') diff --git a/ext/intl/common/common_error.c b/ext/intl/common/common_error.c index fbdf82ed9c..126c9cc35b 100644 --- a/ext/intl/common/common_error.c +++ b/ext/intl/common/common_error.c @@ -48,10 +48,10 @@ PHP_FUNCTION( intl_get_error_message ) */ PHP_FUNCTION( intl_is_failure ) { - long err_code; + php_int_t err_code; /* Parse parameters. */ - if( zend_parse_parameters( ZEND_NUM_ARGS() TSRMLS_CC, "l", + if( zend_parse_parameters( ZEND_NUM_ARGS() TSRMLS_CC, "i", &err_code ) == FAILURE ) { intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, @@ -70,10 +70,10 @@ PHP_FUNCTION( intl_is_failure ) */ PHP_FUNCTION( intl_error_name ) { - long err_code; + php_int_t err_code; /* Parse parameters. */ - if( zend_parse_parameters( ZEND_NUM_ARGS() TSRMLS_CC, "l", + if( zend_parse_parameters( ZEND_NUM_ARGS() TSRMLS_CC, "i", &err_code ) == FAILURE ) { intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, -- cgit v1.2.1 From c3e3c98ec666812daaaca896cf5ef758a8a6df14 Mon Sep 17 00:00:00 2001 From: Anatol Belski Date: Mon, 25 Aug 2014 19:24:55 +0200 Subject: master renames phase 1 --- ext/intl/common/common_error.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'ext/intl/common/common_error.c') diff --git a/ext/intl/common/common_error.c b/ext/intl/common/common_error.c index 126c9cc35b..f7b739555e 100644 --- a/ext/intl/common/common_error.c +++ b/ext/intl/common/common_error.c @@ -28,7 +28,7 @@ */ PHP_FUNCTION( intl_get_error_code ) { - RETURN_INT( intl_error_get_code( NULL TSRMLS_CC ) ); + RETURN_LONG( intl_error_get_code( NULL TSRMLS_CC ) ); } /* }}} */ @@ -48,10 +48,10 @@ PHP_FUNCTION( intl_get_error_message ) */ PHP_FUNCTION( intl_is_failure ) { - php_int_t err_code; + zend_long err_code; /* Parse parameters. */ - if( zend_parse_parameters( ZEND_NUM_ARGS() TSRMLS_CC, "i", + if( zend_parse_parameters( ZEND_NUM_ARGS() TSRMLS_CC, "l", &err_code ) == FAILURE ) { intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, @@ -70,10 +70,10 @@ PHP_FUNCTION( intl_is_failure ) */ PHP_FUNCTION( intl_error_name ) { - php_int_t err_code; + zend_long err_code; /* Parse parameters. */ - if( zend_parse_parameters( ZEND_NUM_ARGS() TSRMLS_CC, "i", + if( zend_parse_parameters( ZEND_NUM_ARGS() TSRMLS_CC, "l", &err_code ) == FAILURE ) { intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, @@ -91,7 +91,7 @@ PHP_FUNCTION( intl_error_name ) */ void intl_expose_icu_error_codes( INIT_FUNC_ARGS ) { - #define INTL_EXPOSE_CONST(x) REGISTER_INT_CONSTANT(#x, x, CONST_PERSISTENT | CONST_CS) + #define INTL_EXPOSE_CONST(x) REGISTER_LONG_CONSTANT(#x, x, CONST_PERSISTENT | CONST_CS) /* Warnings */ INTL_EXPOSE_CONST( U_USING_FALLBACK_WARNING ); -- cgit v1.2.1 From d0cb715373c3fbe9dc095378ec5ed8c71f799f67 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20Schl=C3=BCter?= Date: Fri, 19 Sep 2014 18:33:14 +0200 Subject: s/PHP 5/PHP 7/ --- ext/intl/common/common_error.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'ext/intl/common/common_error.c') diff --git a/ext/intl/common/common_error.c b/ext/intl/common/common_error.c index f7b739555e..524bb94327 100644 --- a/ext/intl/common/common_error.c +++ b/ext/intl/common/common_error.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | -- cgit v1.2.1