summaryrefslogtreecommitdiff
path: root/ext/intl/collator
diff options
context:
space:
mode:
authorAnatol Belski <ab@php.net>2014-12-13 23:06:14 +0100
committerAnatol Belski <ab@php.net>2014-12-13 23:06:14 +0100
commitbdeb220f48825642f84cdbf3ff23a30613c92e86 (patch)
tree1a6cf34d20420e4815b4becb21311a4457d84103 /ext/intl/collator
parentbb66f385d09e7e55390e9f57fcbca08f6b43ff91 (diff)
downloadphp-git-bdeb220f48825642f84cdbf3ff23a30613c92e86.tar.gz
first shot remove TSRMLS_* things
Diffstat (limited to 'ext/intl/collator')
-rw-r--r--ext/intl/collator/collator.c4
-rw-r--r--ext/intl/collator/collator_attr.c16
-rw-r--r--ext/intl/collator/collator_class.c28
-rw-r--r--ext/intl/collator/collator_class.h12
-rw-r--r--ext/intl/collator/collator_compare.c18
-rw-r--r--ext/intl/collator/collator_convert.c11
-rw-r--r--ext/intl/collator/collator_convert.h2
-rw-r--r--ext/intl/collator/collator_create.c10
-rw-r--r--ext/intl/collator/collator_error.c10
-rw-r--r--ext/intl/collator/collator_locale.c10
-rw-r--r--ext/intl/collator/collator_sort.c62
-rw-r--r--ext/intl/collator/collator_sort.h2
12 files changed, 92 insertions, 93 deletions
diff --git a/ext/intl/collator/collator.c b/ext/intl/collator/collator.c
index 07dc6385c8..d86139c9e0 100644
--- a/ext/intl/collator/collator.c
+++ b/ext/intl/collator/collator.c
@@ -39,8 +39,8 @@ void collator_register_constants( INIT_FUNC_ARGS )
}
#define COLLATOR_EXPOSE_CONST(x) REGISTER_LONG_CONSTANT(#x, x, CONST_PERSISTENT | CONST_CS)
- #define COLLATOR_EXPOSE_CLASS_CONST(x) zend_declare_class_constant_long( Collator_ce_ptr, ZEND_STRS( #x ) - 1, UCOL_##x TSRMLS_CC );
- #define COLLATOR_EXPOSE_CUSTOM_CLASS_CONST(name, value) zend_declare_class_constant_long( Collator_ce_ptr, ZEND_STRS( name ) - 1, value TSRMLS_CC );
+ #define COLLATOR_EXPOSE_CLASS_CONST(x) zend_declare_class_constant_long( Collator_ce_ptr, ZEND_STRS( #x ) - 1, UCOL_##x );
+ #define COLLATOR_EXPOSE_CUSTOM_CLASS_CONST(name, value) zend_declare_class_constant_long( Collator_ce_ptr, ZEND_STRS( name ) - 1, value );
/* UColAttributeValue constants */
COLLATOR_EXPOSE_CUSTOM_CLASS_CONST( "DEFAULT_VALUE", UCOL_DEFAULT );
diff --git a/ext/intl/collator/collator_attr.c b/ext/intl/collator/collator_attr.c
index 8d879de8f7..7063db3562 100644
--- a/ext/intl/collator/collator_attr.c
+++ b/ext/intl/collator/collator_attr.c
@@ -38,11 +38,11 @@ PHP_FUNCTION( collator_get_attribute )
COLLATOR_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(), getThis(), "Ol",
&object, Collator_ce_ptr, &attribute ) == FAILURE )
{
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "collator_get_attribute: unable to parse input params", 0 TSRMLS_CC );
+ "collator_get_attribute: unable to parse input params", 0 );
RETURN_FALSE;
}
@@ -69,11 +69,11 @@ PHP_FUNCTION( collator_set_attribute )
/* Parse parameters. */
- if( zend_parse_method_parameters( ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Oll",
+ if( zend_parse_method_parameters( ZEND_NUM_ARGS(), getThis(), "Oll",
&object, Collator_ce_ptr, &attribute, &value ) == FAILURE)
{
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "collator_set_attribute: unable to parse input params", 0 TSRMLS_CC );
+ "collator_set_attribute: unable to parse input params", 0 );
RETURN_FALSE;
}
@@ -99,11 +99,11 @@ PHP_FUNCTION( collator_get_strength )
COLLATOR_METHOD_INIT_VARS
/* Parse parameters. */
- if( zend_parse_method_parameters( ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O",
+ if( zend_parse_method_parameters( ZEND_NUM_ARGS(), getThis(), "O",
&object, Collator_ce_ptr ) == FAILURE )
{
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "collator_get_strength: unable to parse input params", 0 TSRMLS_CC );
+ "collator_get_strength: unable to parse input params", 0 );
RETURN_FALSE;
}
@@ -128,11 +128,11 @@ PHP_FUNCTION( collator_set_strength )
COLLATOR_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(), getThis(), "Ol",
&object, Collator_ce_ptr, &strength ) == FAILURE )
{
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "collator_set_strength: unable to parse input params", 0 TSRMLS_CC );
+ "collator_set_strength: unable to parse input params", 0 );
RETURN_FALSE;
}
diff --git a/ext/intl/collator/collator_class.c b/ext/intl/collator/collator_class.c
index fd3f08e359..5632dc0f76 100644
--- a/ext/intl/collator/collator_class.c
+++ b/ext/intl/collator/collator_class.c
@@ -36,31 +36,31 @@ static zend_object_handlers Collator_handlers;
*/
/* {{{ Collator_objects_dtor */
-static void Collator_objects_dtor(zend_object *object TSRMLS_DC )
+static void Collator_objects_dtor(zend_object *object )
{
- zend_objects_destroy_object(object TSRMLS_CC );
+ zend_objects_destroy_object(object );
}
/* }}} */
/* {{{ Collator_objects_free */
-void Collator_objects_free(zend_object *object TSRMLS_DC )
+void Collator_objects_free(zend_object *object )
{
Collator_object* co = php_intl_collator_fetch_object(object);
- zend_object_std_dtor(&co->zo TSRMLS_CC );
+ zend_object_std_dtor(&co->zo );
- collator_object_destroy(co TSRMLS_CC );
+ collator_object_destroy(co );
}
/* }}} */
/* {{{ Collator_object_create */
-zend_object *Collator_object_create(zend_class_entry *ce TSRMLS_DC )
+zend_object *Collator_object_create(zend_class_entry *ce )
{
Collator_object* intern;
intern = ecalloc(1, sizeof(Collator_object) + sizeof(zval) * (ce->default_properties_count - 1));
- intl_error_init(COLLATOR_ERROR_P(intern) TSRMLS_CC);
- zend_object_std_init(&intern->zo, ce TSRMLS_CC );
+ intl_error_init(COLLATOR_ERROR_P(intern));
+ zend_object_std_init(&intern->zo, ce );
object_properties_init(&intern->zo, ce);
intern->zo.handlers = &Collator_handlers;
@@ -123,14 +123,14 @@ zend_function_entry Collator_class_functions[] = {
/* {{{ collator_register_Collator_class
* Initialize 'Collator' class
*/
-void collator_register_Collator_class( TSRMLS_D )
+void collator_register_Collator_class( void )
{
zend_class_entry ce;
/* Create and register 'Collator' class. */
INIT_CLASS_ENTRY( ce, "Collator", Collator_class_functions );
ce.create_object = Collator_object_create;
- Collator_ce_ptr = zend_register_internal_class( &ce TSRMLS_CC );
+ Collator_ce_ptr = zend_register_internal_class( &ce );
memcpy(&Collator_handlers, zend_get_std_object_handlers(),
sizeof Collator_handlers);
@@ -156,19 +156,19 @@ void collator_register_Collator_class( TSRMLS_D )
* Initialize internals of Collator_object.
* Must be called before any other call to 'collator_object_...' functions.
*/
-void collator_object_init( Collator_object* co TSRMLS_DC )
+void collator_object_init( Collator_object* co )
{
if( !co )
return;
- intl_error_init( COLLATOR_ERROR_P( co ) TSRMLS_CC );
+ intl_error_init( COLLATOR_ERROR_P( co ) );
}
/* }}} */
/* {{{ void collator_object_destroy( Collator_object* co )
* Clean up mem allocted by internals of Collator_object
*/
-void collator_object_destroy( Collator_object* co TSRMLS_DC )
+void collator_object_destroy( Collator_object* co )
{
if( !co )
return;
@@ -179,7 +179,7 @@ void collator_object_destroy( Collator_object* co TSRMLS_DC )
co->ucoll = NULL;
}
- intl_error_reset( COLLATOR_ERROR_P( co ) TSRMLS_CC );
+ intl_error_reset( COLLATOR_ERROR_P( co ) );
}
/* }}} */
diff --git a/ext/intl/collator/collator_class.h b/ext/intl/collator/collator_class.h
index f9d2cedf88..4ee8aba749 100644
--- a/ext/intl/collator/collator_class.h
+++ b/ext/intl/collator/collator_class.h
@@ -48,9 +48,9 @@ static inline Collator_object *php_intl_collator_fetch_object(zend_object *obj)
}
#define Z_INTL_COLLATOR_P(zv) php_intl_collator_fetch_object(Z_OBJ_P(zv))
-void collator_register_Collator_class( TSRMLS_D );
-void collator_object_init( Collator_object* co TSRMLS_DC );
-void collator_object_destroy( Collator_object* co TSRMLS_DC );
+void collator_register_Collator_class( void );
+void collator_object_init( Collator_object* co );
+void collator_object_destroy( Collator_object* co );
extern zend_class_entry *Collator_ce_ptr;
@@ -59,16 +59,16 @@ extern zend_class_entry *Collator_ce_ptr;
#define COLLATOR_METHOD_INIT_VARS \
zval* object = NULL; \
Collator_object* co = NULL; \
- intl_error_reset( NULL TSRMLS_CC ); \
+ intl_error_reset( NULL ); \
#define COLLATOR_METHOD_FETCH_OBJECT INTL_METHOD_FETCH_OBJECT(INTL_COLLATOR, co)
// Macro to check return value of a ucol_* function call.
#define COLLATOR_CHECK_STATUS( co, msg ) \
- intl_error_set_code( NULL, COLLATOR_ERROR_CODE( co ) TSRMLS_CC ); \
+ intl_error_set_code( NULL, COLLATOR_ERROR_CODE( co ) ); \
if( U_FAILURE( COLLATOR_ERROR_CODE( co ) ) ) \
{ \
- intl_errors_set_custom_msg( COLLATOR_ERROR_P( co ), msg, 0 TSRMLS_CC ); \
+ intl_errors_set_custom_msg( COLLATOR_ERROR_P( co ), msg, 0 ); \
RETURN_FALSE; \
} \
diff --git a/ext/intl/collator/collator_compare.c b/ext/intl/collator/collator_compare.c
index d27ff32ebd..a7bc7f6383 100644
--- a/ext/intl/collator/collator_compare.c
+++ b/ext/intl/collator/collator_compare.c
@@ -46,11 +46,11 @@ PHP_FUNCTION( collator_compare )
COLLATOR_METHOD_INIT_VARS
/* Parse parameters. */
- if( zend_parse_method_parameters( ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Oss",
+ if( zend_parse_method_parameters( ZEND_NUM_ARGS(), getThis(), "Oss",
&object, Collator_ce_ptr, &str1, &str1_len, &str2, &str2_len ) == FAILURE )
{
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "collator_compare: unable to parse input params", 0 TSRMLS_CC );
+ "collator_compare: unable to parse input params", 0 );
RETURN_FALSE;
}
@@ -59,10 +59,10 @@ PHP_FUNCTION( collator_compare )
COLLATOR_METHOD_FETCH_OBJECT;
if (!co || !co->ucoll) {
- intl_error_set_code( NULL, COLLATOR_ERROR_CODE( co ) TSRMLS_CC );
+ intl_error_set_code( NULL, COLLATOR_ERROR_CODE( co ) );
intl_errors_set_custom_msg( COLLATOR_ERROR_P( co ),
- "Object not initialized", 0 TSRMLS_CC );
- php_error_docref(NULL TSRMLS_CC, E_RECOVERABLE_ERROR, "Object not initialized");
+ "Object not initialized", 0 );
+ php_error_docref(NULL, E_RECOVERABLE_ERROR, "Object not initialized");
RETURN_FALSE;
}
@@ -77,11 +77,11 @@ PHP_FUNCTION( collator_compare )
if( U_FAILURE( COLLATOR_ERROR_CODE( co ) ) )
{
/* Set global error code. */
- intl_error_set_code( NULL, COLLATOR_ERROR_CODE( co ) TSRMLS_CC );
+ intl_error_set_code( NULL, COLLATOR_ERROR_CODE( co ) );
/* Set error messages. */
intl_errors_set_custom_msg( COLLATOR_ERROR_P( co ),
- "Error converting first argument to UTF-16", 0 TSRMLS_CC );
+ "Error converting first argument to UTF-16", 0 );
if (ustr1) {
efree( ustr1 );
}
@@ -93,11 +93,11 @@ PHP_FUNCTION( collator_compare )
if( U_FAILURE( COLLATOR_ERROR_CODE( co ) ) )
{
/* Set global error code. */
- intl_error_set_code( NULL, COLLATOR_ERROR_CODE( co ) TSRMLS_CC );
+ intl_error_set_code( NULL, COLLATOR_ERROR_CODE( co ) );
/* Set error messages. */
intl_errors_set_custom_msg( COLLATOR_ERROR_P( co ),
- "Error converting second argument to UTF-16", 0 TSRMLS_CC );
+ "Error converting second argument to UTF-16", 0 );
if (ustr1) {
efree( ustr1 );
}
diff --git a/ext/intl/collator/collator_convert.c b/ext/intl/collator/collator_convert.c
index 607add2fcf..8ff63a902e 100644
--- a/ext/intl/collator/collator_convert.c
+++ b/ext/intl/collator/collator_convert.c
@@ -225,7 +225,7 @@ zval* collator_convert_zstr_utf8_to_utf16( zval* utf8_zval, zval *rv )
/* {{{ collator_convert_object_to_string
* Convert object to UTF16-encoded string.
*/
-zval* collator_convert_object_to_string( zval* obj, zval *rv TSRMLS_DC )
+zval* collator_convert_object_to_string( zval* obj, zval *rv )
{
zval* zstr = NULL;
UErrorCode status = U_ZERO_ERROR;
@@ -241,7 +241,7 @@ zval* collator_convert_object_to_string( zval* obj, zval *rv TSRMLS_DC )
/* Try object's handlers. */
if( Z_OBJ_HT_P(obj)->get )
{
- zstr = Z_OBJ_HT_P(obj)->get( obj, rv TSRMLS_CC );
+ zstr = Z_OBJ_HT_P(obj)->get( obj, rv );
switch( Z_TYPE_P( zstr ) )
{
@@ -265,7 +265,7 @@ zval* collator_convert_object_to_string( zval* obj, zval *rv TSRMLS_DC )
{
zstr = rv;
- if( Z_OBJ_HT_P(obj)->cast_object( obj, zstr, IS_STRING CAST_OBJECT_SHOULD_FREE TSRMLS_CC ) == FAILURE )
+ if( Z_OBJ_HT_P(obj)->cast_object( obj, zstr, IS_STRING CAST_OBJECT_SHOULD_FREE ) == FAILURE )
{
/* cast_object failed => bail out. */
zval_ptr_dtor( zstr );
@@ -400,9 +400,8 @@ zval* collator_make_printable_zval( zval* arg, zval *rv)
if( Z_TYPE_P(arg) != IS_STRING )
{
- TSRMLS_FETCH();
-
- use_copy = zend_make_printable_zval(arg, &arg_copy TSRMLS_CC);
+
+ use_copy = zend_make_printable_zval(arg, &arg_copy);
if( use_copy )
{
diff --git a/ext/intl/collator/collator_convert.h b/ext/intl/collator/collator_convert.h
index bf116bdfd8..4cfc8b56ce 100644
--- a/ext/intl/collator/collator_convert.h
+++ b/ext/intl/collator/collator_convert.h
@@ -28,7 +28,7 @@ zval* collator_convert_zstr_utf16_to_utf8( zval* utf16_zval, zval *rv );
zval* collator_convert_zstr_utf8_to_utf16( zval* utf8_zval, zval *rv );
zval* collator_normalize_sort_argument( zval* arg, zval *rv );
-zval* collator_convert_object_to_string( zval* obj, zval *rv TSRMLS_DC );
+zval* collator_convert_object_to_string( zval* obj, zval *rv );
zval* collator_convert_string_to_number( zval* arg, zval *rv );
zval* collator_convert_string_to_number_if_possible( zval* str, zval *rv );
zval* collator_convert_string_to_double( zval* str, zval *rv );
diff --git a/ext/intl/collator/collator_create.c b/ext/intl/collator/collator_create.c
index 3c59f218e6..3945fb78b3 100644
--- a/ext/intl/collator/collator_create.c
+++ b/ext/intl/collator/collator_create.c
@@ -32,14 +32,14 @@ static void collator_ctor(INTERNAL_FUNCTION_PARAMETERS)
zval* object;
Collator_object* co;
- intl_error_reset( NULL TSRMLS_CC );
+ intl_error_reset( NULL );
object = return_value;
/* Parse parameters. */
- if( zend_parse_parameters( ZEND_NUM_ARGS() TSRMLS_CC, "s",
+ if( zend_parse_parameters( ZEND_NUM_ARGS(), "s",
&locale, &locale_len ) == FAILURE )
{
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "collator_create: unable to parse input params", 0 TSRMLS_CC );
+ "collator_create: unable to parse input params", 0 );
zval_dtor(return_value);
RETURN_NULL();
}
@@ -48,7 +48,7 @@ static void collator_ctor(INTERNAL_FUNCTION_PARAMETERS)
COLLATOR_METHOD_FETCH_OBJECT;
if(locale_len == 0) {
- locale = intl_locale_get_default(TSRMLS_C);
+ locale = intl_locale_get_default();
}
/* Open ICU collator. */
@@ -78,7 +78,7 @@ PHP_METHOD( Collator, __construct )
collator_ctor(INTERNAL_FUNCTION_PARAM_PASSTHRU);
if (Z_TYPE_P(return_value) == IS_OBJECT && Z_OBJ_P(return_value) == NULL) {
- zend_object_store_ctor_failed(Z_OBJ(orig_this) TSRMLS_CC);
+ zend_object_store_ctor_failed(Z_OBJ(orig_this));
zval_dtor(&orig_this);
ZEND_CTOR_MAKE_NULL();
}
diff --git a/ext/intl/collator/collator_error.c b/ext/intl/collator/collator_error.c
index fb8886ef64..5d30b8c655 100644
--- a/ext/intl/collator/collator_error.c
+++ b/ext/intl/collator/collator_error.c
@@ -33,11 +33,11 @@ PHP_FUNCTION( collator_get_error_code )
COLLATOR_METHOD_INIT_VARS
/* Parse parameters. */
- if( zend_parse_method_parameters( ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O",
+ if( zend_parse_method_parameters( ZEND_NUM_ARGS(), getThis(), "O",
&object, Collator_ce_ptr ) == FAILURE )
{
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "collator_get_error_code: unable to parse input params", 0 TSRMLS_CC );
+ "collator_get_error_code: unable to parse input params", 0 );
RETURN_FALSE;
}
@@ -64,11 +64,11 @@ PHP_FUNCTION( collator_get_error_message )
COLLATOR_METHOD_INIT_VARS
/* Parse parameters. */
- if( zend_parse_method_parameters( ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O",
+ if( zend_parse_method_parameters( ZEND_NUM_ARGS(), getThis(), "O",
&object, Collator_ce_ptr ) == FAILURE )
{
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "collator_get_error_message: unable to parse input params", 0 TSRMLS_CC );
+ "collator_get_error_message: unable to parse input params", 0 );
RETURN_FALSE;
}
@@ -79,7 +79,7 @@ PHP_FUNCTION( collator_get_error_message )
RETURN_FALSE;
/* Return last error message. */
- message = intl_error_get_message( COLLATOR_ERROR_P( co ) TSRMLS_CC );
+ message = intl_error_get_message( COLLATOR_ERROR_P( co ) );
RETURN_STR(message);
}
/* }}} */
diff --git a/ext/intl/collator/collator_locale.c b/ext/intl/collator/collator_locale.c
index 76f154bb7c..8e0b32650a 100644
--- a/ext/intl/collator/collator_locale.c
+++ b/ext/intl/collator/collator_locale.c
@@ -39,11 +39,11 @@ PHP_FUNCTION( collator_get_locale )
COLLATOR_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(), getThis(), "Ol",
&object, Collator_ce_ptr, &type ) == FAILURE )
{
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "collator_get_locale: unable to parse input params", 0 TSRMLS_CC );
+ "collator_get_locale: unable to parse input params", 0 );
RETURN_FALSE;
}
@@ -52,10 +52,10 @@ PHP_FUNCTION( collator_get_locale )
COLLATOR_METHOD_FETCH_OBJECT;
if (!co || !co->ucoll) {
- intl_error_set_code( NULL, COLLATOR_ERROR_CODE( co ) TSRMLS_CC );
+ intl_error_set_code( NULL, COLLATOR_ERROR_CODE( co ) );
intl_errors_set_custom_msg( COLLATOR_ERROR_P( co ),
- "Object not initialized", 0 TSRMLS_CC );
- php_error_docref(NULL TSRMLS_CC, E_RECOVERABLE_ERROR, "Object not initialized");
+ "Object not initialized", 0 );
+ php_error_docref(NULL, E_RECOVERABLE_ERROR, "Object not initialized");
RETURN_FALSE;
}
diff --git a/ext/intl/collator/collator_sort.c b/ext/intl/collator/collator_sort.c
index 6f29c9b6de..d0d6b1a9d9 100644
--- a/ext/intl/collator/collator_sort.c
+++ b/ext/intl/collator/collator_sort.c
@@ -50,7 +50,7 @@ static const size_t DEF_SORT_KEYS_INDX_BUF_INCREMENT = 1048576;
static const size_t DEF_UTF16_BUF_SIZE = 1024;
/* {{{ collator_regular_compare_function */
-static int collator_regular_compare_function(zval *result, zval *op1, zval *op2 TSRMLS_DC)
+static int collator_regular_compare_function(zval *result, zval *op1, zval *op2)
{
Collator_object* co = NULL;
int rc = SUCCESS;
@@ -59,8 +59,8 @@ static int collator_regular_compare_function(zval *result, zval *op1, zval *op2
zval norm1, norm2;
zval *num1_p = NULL, *num2_p = NULL;
zval *norm1_p = NULL, *norm2_p = NULL;
- zval* str1_p = collator_convert_object_to_string( op1, &str1 TSRMLS_CC );
- zval* str2_p = collator_convert_object_to_string( op2, &str2 TSRMLS_CC );
+ zval* str1_p = collator_convert_object_to_string( op1, &str1 );
+ zval* str2_p = collator_convert_object_to_string( op2, &str2 );
/* If both args are strings AND either of args is not numeric string
* then use ICU-compare. Otherwise PHP-compare. */
@@ -72,10 +72,10 @@ static int collator_regular_compare_function(zval *result, zval *op1, zval *op2
co = Z_INTL_COLLATOR_P(&INTL_G(current_collator));
if (!co || !co->ucoll) {
- intl_error_set_code( NULL, COLLATOR_ERROR_CODE( co ) TSRMLS_CC );
+ intl_error_set_code( NULL, COLLATOR_ERROR_CODE( co ) );
intl_errors_set_custom_msg( COLLATOR_ERROR_P( co ),
- "Object not initialized", 0 TSRMLS_CC );
- php_error_docref(NULL TSRMLS_CC, E_RECOVERABLE_ERROR, "Object not initialized");
+ "Object not initialized", 0 );
+ php_error_docref(NULL, E_RECOVERABLE_ERROR, "Object not initialized");
}
@@ -120,7 +120,7 @@ static int collator_regular_compare_function(zval *result, zval *op1, zval *op2
norm2_p = collator_normalize_sort_argument( str2_p, &norm2 );
}
- rc = compare_function( result, norm1_p, norm2_p TSRMLS_CC );
+ rc = compare_function( result, norm1_p, norm2_p );
zval_ptr_dtor( norm1_p );
zval_ptr_dtor( norm2_p );
@@ -142,7 +142,7 @@ static int collator_regular_compare_function(zval *result, zval *op1, zval *op2
/* {{{ collator_numeric_compare_function
* Convert input args to double and compare it.
*/
-static int collator_numeric_compare_function(zval *result, zval *op1, zval *op2 TSRMLS_DC)
+static int collator_numeric_compare_function(zval *result, zval *op1, zval *op2)
{
int rc = SUCCESS;
zval num1, num2;
@@ -161,7 +161,7 @@ static int collator_numeric_compare_function(zval *result, zval *op1, zval *op2
op2 = num2_p;
}
- rc = numeric_compare_function( result, op1, op2 TSRMLS_CC);
+ rc = numeric_compare_function( result, op1, op2);
if( num1_p )
zval_ptr_dtor( num1_p );
@@ -175,7 +175,7 @@ static int collator_numeric_compare_function(zval *result, zval *op1, zval *op2
/* {{{ collator_icu_compare_function
* Direct use of ucol_strcoll.
*/
-static int collator_icu_compare_function(zval *result, zval *op1, zval *op2 TSRMLS_DC)
+static int collator_icu_compare_function(zval *result, zval *op1, zval *op2)
{
zval str1, str2;
int rc = SUCCESS;
@@ -205,7 +205,7 @@ static int collator_icu_compare_function(zval *result, zval *op1, zval *op2 TSRM
/* {{{ collator_compare_func
* Taken from PHP7 source (array_data_compare).
*/
-static int collator_compare_func( const void* a, const void* b TSRMLS_DC )
+static int collator_compare_func( const void* a, const void* b )
{
Bucket *f;
Bucket *s;
@@ -219,7 +219,7 @@ static int collator_compare_func( const void* a, const void* b TSRMLS_DC )
first = &f->val;
second = &s->val;
- if( INTL_G(compare_func)( &result, first, second TSRMLS_CC) == FAILURE )
+ if( INTL_G(compare_func)( &result, first, second) == FAILURE )
return 0;
if( Z_TYPE(result) == IS_DOUBLE )
@@ -246,7 +246,7 @@ static int collator_compare_func( const void* a, const void* b TSRMLS_DC )
/* {{{ collator_cmp_sort_keys
* Compare sort keys
*/
-static int collator_cmp_sort_keys( const void *p1, const void *p2 TSRMLS_DC )
+static int collator_cmp_sort_keys( const void *p1, const void *p2 )
{
char* key1 = ((collator_sort_key_index_t*)p1)->key;
char* key2 = ((collator_sort_key_index_t*)p2)->key;
@@ -295,11 +295,11 @@ static void collator_sort_internal( int renumber, INTERNAL_FUNCTION_PARAMETERS )
COLLATOR_METHOD_INIT_VARS
/* Parse parameters. */
- if( zend_parse_method_parameters( ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Oa/|l",
+ if( zend_parse_method_parameters( ZEND_NUM_ARGS(), getThis(), "Oa/|l",
&object, Collator_ce_ptr, &array, &sort_flags ) == FAILURE )
{
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "collator_sort_internal: unable to parse input params", 0 TSRMLS_CC );
+ "collator_sort_internal: unable to parse input params", 0 );
RETURN_FALSE;
}
@@ -321,7 +321,7 @@ static void collator_sort_internal( int renumber, INTERNAL_FUNCTION_PARAMETERS )
ZVAL_COPY_VALUE(&INTL_G( current_collator ), object);
/* Sort specified array. */
- zend_hash_sort( hash, zend_qsort, collator_compare_func, renumber TSRMLS_CC );
+ zend_hash_sort( hash, zend_qsort, collator_compare_func, renumber );
/* Restore saved collator. */
ZVAL_COPY_VALUE(&INTL_G( current_collator ), &saved_collator);
@@ -381,11 +381,11 @@ PHP_FUNCTION( collator_sort_with_sort_keys )
COLLATOR_METHOD_INIT_VARS
/* Parse parameters. */
- if( zend_parse_method_parameters( ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Oa",
+ if( zend_parse_method_parameters( ZEND_NUM_ARGS(), getThis(), "Oa",
&object, Collator_ce_ptr, &array ) == FAILURE )
{
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "collator_sort_with_sort_keys: unable to parse input params", 0 TSRMLS_CC );
+ "collator_sort_with_sort_keys: unable to parse input params", 0 );
RETURN_FALSE;
}
@@ -394,10 +394,10 @@ PHP_FUNCTION( collator_sort_with_sort_keys )
COLLATOR_METHOD_FETCH_OBJECT;
if (!co || !co->ucoll) {
- intl_error_set_code( NULL, COLLATOR_ERROR_CODE( co ) TSRMLS_CC );
+ intl_error_set_code( NULL, COLLATOR_ERROR_CODE( co ) );
intl_errors_set_custom_msg( COLLATOR_ERROR_P( co ),
- "Object not initialized", 0 TSRMLS_CC );
- php_error_docref(NULL TSRMLS_CC, E_RECOVERABLE_ERROR, "Object not initialized");
+ "Object not initialized", 0 );
+ php_error_docref(NULL, E_RECOVERABLE_ERROR, "Object not initialized");
RETURN_FALSE;
}
@@ -428,8 +428,8 @@ PHP_FUNCTION( collator_sort_with_sort_keys )
if( U_FAILURE( COLLATOR_ERROR_CODE( co ) ) )
{
- intl_error_set_code( NULL, COLLATOR_ERROR_CODE( co ) TSRMLS_CC );
- intl_errors_set_custom_msg( COLLATOR_ERROR_P( co ), "Sort with sort keys failed", 0 TSRMLS_CC );
+ intl_error_set_code( NULL, COLLATOR_ERROR_CODE( co ) );
+ intl_errors_set_custom_msg( COLLATOR_ERROR_P( co ), "Sort with sort keys failed", 0 );
if( utf16_buf )
efree( utf16_buf );
@@ -496,7 +496,7 @@ PHP_FUNCTION( collator_sort_with_sort_keys )
sortKeyIndxBuf[j].key = sortKeyBuf + (ptrdiff_t)sortKeyIndxBuf[j].key;
/* sort it */
- zend_qsort( sortKeyIndxBuf, sortKeyCount, sortKeyIndxSize, collator_cmp_sort_keys TSRMLS_CC );
+ zend_qsort( sortKeyIndxBuf, sortKeyCount, sortKeyIndxSize, collator_cmp_sort_keys );
zval_ptr_dtor( array );
/* for resulting hash we'll assign new hash keys rather then reordering */
@@ -545,11 +545,11 @@ PHP_FUNCTION( collator_get_sort_key )
COLLATOR_METHOD_INIT_VARS
/* Parse parameters. */
- if( zend_parse_method_parameters( ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os",
+ if( zend_parse_method_parameters( ZEND_NUM_ARGS(), getThis(), "Os",
&object, Collator_ce_ptr, &str, &str_len ) == FAILURE )
{
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "collator_get_sort_key: unable to parse input params", 0 TSRMLS_CC );
+ "collator_get_sort_key: unable to parse input params", 0 );
RETURN_FALSE;
}
@@ -558,10 +558,10 @@ PHP_FUNCTION( collator_get_sort_key )
COLLATOR_METHOD_FETCH_OBJECT;
if (!co || !co->ucoll) {
- intl_error_set_code( NULL, COLLATOR_ERROR_CODE( co ) TSRMLS_CC );
+ intl_error_set_code( NULL, COLLATOR_ERROR_CODE( co ) );
intl_errors_set_custom_msg( COLLATOR_ERROR_P( co ),
- "Object not initialized", 0 TSRMLS_CC );
- php_error_docref(NULL TSRMLS_CC, E_RECOVERABLE_ERROR, "Object not initialized");
+ "Object not initialized", 0 );
+ php_error_docref(NULL, E_RECOVERABLE_ERROR, "Object not initialized");
RETURN_FALSE;
}
@@ -576,11 +576,11 @@ PHP_FUNCTION( collator_get_sort_key )
if( U_FAILURE( COLLATOR_ERROR_CODE( co ) ) )
{
/* Set global error code. */
- intl_error_set_code( NULL, COLLATOR_ERROR_CODE( co ) TSRMLS_CC );
+ intl_error_set_code( NULL, COLLATOR_ERROR_CODE( co ) );
/* Set error messages. */
intl_errors_set_custom_msg( COLLATOR_ERROR_P( co ),
- "Error converting first argument to UTF-16", 0 TSRMLS_CC );
+ "Error converting first argument to UTF-16", 0 );
efree( ustr );
RETURN_FALSE;
}
diff --git a/ext/intl/collator/collator_sort.h b/ext/intl/collator/collator_sort.h
index b5cb017a8c..ffaf86e664 100644
--- a/ext/intl/collator/collator_sort.h
+++ b/ext/intl/collator/collator_sort.h
@@ -20,7 +20,7 @@
#include <php.h>
-typedef int (*collator_compare_func_t)( zval *result, zval *op1, zval *op2 TSRMLS_DC );
+typedef int (*collator_compare_func_t)( zval *result, zval *op1, zval *op2 );
PHP_FUNCTION( collator_sort );
PHP_FUNCTION( collator_sort_with_sort_keys );