summaryrefslogtreecommitdiff
path: root/ext/intl/msgformat
diff options
context:
space:
mode:
Diffstat (limited to 'ext/intl/msgformat')
-rw-r--r--ext/intl/msgformat/msgformat.c22
-rw-r--r--ext/intl/msgformat/msgformat_attr.c14
-rw-r--r--ext/intl/msgformat/msgformat_class.c32
-rw-r--r--ext/intl/msgformat/msgformat_class.h4
-rw-r--r--ext/intl/msgformat/msgformat_data.c12
-rw-r--r--ext/intl/msgformat/msgformat_data.h6
-rw-r--r--ext/intl/msgformat/msgformat_format.c26
-rw-r--r--ext/intl/msgformat/msgformat_helpers.cpp70
-rw-r--r--ext/intl/msgformat/msgformat_helpers.h2
-rw-r--r--ext/intl/msgformat/msgformat_parse.c24
10 files changed, 106 insertions, 106 deletions
diff --git a/ext/intl/msgformat/msgformat.c b/ext/intl/msgformat/msgformat.c
index 2ca8ed9186..a9999dc141 100644
--- a/ext/intl/msgformat/msgformat.c
+++ b/ext/intl/msgformat/msgformat.c
@@ -35,15 +35,15 @@ static void msgfmt_ctor(INTERNAL_FUNCTION_PARAMETERS)
int spattern_len = 0;
zval* object;
MessageFormatter_object* mfo;
- intl_error_reset( NULL TSRMLS_CC );
+ intl_error_reset( NULL );
object = return_value;
/* Parse parameters. */
- if( zend_parse_parameters( ZEND_NUM_ARGS() TSRMLS_CC, "ss",
+ if( zend_parse_parameters( ZEND_NUM_ARGS(), "ss",
&locale, &locale_len, &pattern, &pattern_len ) == FAILURE )
{
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "msgfmt_create: unable to parse input parameters", 0 TSRMLS_CC );
+ "msgfmt_create: unable to parse input parameters", 0 );
Z_OBJ_P(return_value) = NULL;
return;
}
@@ -61,7 +61,7 @@ static void msgfmt_ctor(INTERNAL_FUNCTION_PARAMETERS)
}
if(locale_len == 0) {
- locale = intl_locale_get_default(TSRMLS_C);
+ locale = intl_locale_get_default();
}
#ifdef MSG_FORMAT_QUOTE_APOS
@@ -71,7 +71,7 @@ static void msgfmt_ctor(INTERNAL_FUNCTION_PARAMETERS)
#endif
if ((mfo)->mf_data.orig_format) {
- msgformat_data_free(&mfo->mf_data TSRMLS_CC);
+ msgformat_data_free(&mfo->mf_data);
}
(mfo)->mf_data.orig_format = estrndup(pattern, pattern_len);
@@ -114,7 +114,7 @@ PHP_METHOD( MessageFormatter, __construct )
msgfmt_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();
}
@@ -132,11 +132,11 @@ PHP_FUNCTION( msgfmt_get_error_code )
MessageFormatter_object* mfo = NULL;
/* 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, MessageFormatter_ce_ptr ) == FAILURE )
{
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "msgfmt_get_error_code: unable to parse input params", 0 TSRMLS_CC );
+ "msgfmt_get_error_code: unable to parse input params", 0 );
RETURN_FALSE;
}
@@ -160,11 +160,11 @@ PHP_FUNCTION( msgfmt_get_error_message )
MessageFormatter_object* mfo = NULL;
/* 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, MessageFormatter_ce_ptr ) == FAILURE )
{
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "msgfmt_get_error_message: unable to parse input params", 0 TSRMLS_CC );
+ "msgfmt_get_error_message: unable to parse input params", 0 );
RETURN_FALSE;
}
@@ -172,7 +172,7 @@ PHP_FUNCTION( msgfmt_get_error_message )
mfo = Z_INTL_MESSAGEFORMATTER_P( object );
/* Return last error message. */
- message = intl_error_get_message( &mfo->mf_data.error TSRMLS_CC );
+ message = intl_error_get_message( &mfo->mf_data.error );
RETURN_STR(message);
}
/* }}} */
diff --git a/ext/intl/msgformat/msgformat_attr.c b/ext/intl/msgformat/msgformat_attr.c
index 79c04266e0..ca117c539f 100644
--- a/ext/intl/msgformat/msgformat_attr.c
+++ b/ext/intl/msgformat/msgformat_attr.c
@@ -36,10 +36,10 @@ PHP_FUNCTION( msgfmt_get_pattern )
MSG_FORMAT_METHOD_INIT_VARS;
/* Parse parameters. */
- if( zend_parse_method_parameters( ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &object, MessageFormatter_ce_ptr ) == FAILURE )
+ if( zend_parse_method_parameters( ZEND_NUM_ARGS(), getThis(), "O", &object, MessageFormatter_ce_ptr ) == FAILURE )
{
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "msgfmt_get_pattern: unable to parse input params", 0 TSRMLS_CC );
+ "msgfmt_get_pattern: unable to parse input params", 0 );
RETURN_FALSE;
}
@@ -68,11 +68,11 @@ PHP_FUNCTION( msgfmt_set_pattern )
MSG_FORMAT_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, MessageFormatter_ce_ptr, &value, &value_len ) == FAILURE )
{
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "msgfmt_set_pattern: unable to parse input params", 0 TSRMLS_CC);
+ "msgfmt_set_pattern: unable to parse input params", 0);
RETURN_FALSE;
}
@@ -85,7 +85,7 @@ PHP_FUNCTION( msgfmt_set_pattern )
#ifdef MSG_FORMAT_QUOTE_APOS
if(msgformat_fix_quotes(&spattern, &spattern_len, &INTL_DATA_ERROR_CODE(mfo)) != SUCCESS) {
intl_error_set( NULL, U_INVALID_FORMAT_ERROR,
- "msgfmt_set_pattern: error converting pattern to quote-friendly format", 0 TSRMLS_CC );
+ "msgfmt_set_pattern: error converting pattern to quote-friendly format", 0 );
RETURN_FALSE;
}
#endif
@@ -124,11 +124,11 @@ PHP_FUNCTION( msgfmt_get_locale )
MSG_FORMAT_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, MessageFormatter_ce_ptr ) == FAILURE )
{
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "msgfmt_get_locale: unable to parse input params", 0 TSRMLS_CC );
+ "msgfmt_get_locale: unable to parse input params", 0 );
RETURN_FALSE;
}
diff --git a/ext/intl/msgformat/msgformat_class.c b/ext/intl/msgformat/msgformat_class.c
index 65f32bf683..9fdd07e607 100644
--- a/ext/intl/msgformat/msgformat_class.c
+++ b/ext/intl/msgformat/msgformat_class.c
@@ -34,31 +34,31 @@ static zend_object_handlers MessageFormatter_handlers;
*/
/* {{{ MessageFormatter_objects_dtor */
-static void MessageFormatter_object_dtor(zend_object *object TSRMLS_DC )
+static void MessageFormatter_object_dtor(zend_object *object )
{
- zend_objects_destroy_object( object TSRMLS_CC );
+ zend_objects_destroy_object( object );
}
/* }}} */
/* {{{ MessageFormatter_objects_free */
-void MessageFormatter_object_free( zend_object *object TSRMLS_DC )
+void MessageFormatter_object_free( zend_object *object )
{
MessageFormatter_object* mfo = php_intl_messageformatter_fetch_object(object);
- zend_object_std_dtor( &mfo->zo TSRMLS_CC );
+ zend_object_std_dtor( &mfo->zo );
- msgformat_data_free( &mfo->mf_data TSRMLS_CC );
+ msgformat_data_free( &mfo->mf_data );
}
/* }}} */
/* {{{ MessageFormatter_object_create */
-zend_object *MessageFormatter_object_create(zend_class_entry *ce TSRMLS_DC)
+zend_object *MessageFormatter_object_create(zend_class_entry *ce)
{
MessageFormatter_object* intern;
intern = ecalloc( 1, sizeof(MessageFormatter_object) + sizeof(zval) * (ce->default_properties_count - 1));
- msgformat_data_init( &intern->mf_data TSRMLS_CC );
- zend_object_std_init( &intern->zo, ce TSRMLS_CC );
+ msgformat_data_init( &intern->mf_data );
+ zend_object_std_init( &intern->zo, ce );
object_properties_init(&intern->zo, ce);
intern->zo.handlers = &MessageFormatter_handlers;
@@ -68,16 +68,16 @@ zend_object *MessageFormatter_object_create(zend_class_entry *ce TSRMLS_DC)
/* }}} */
/* {{{ MessageFormatter_object_clone */
-zend_object *MessageFormatter_object_clone(zval *object TSRMLS_DC)
+zend_object *MessageFormatter_object_clone(zval *object)
{
MessageFormatter_object *mfo, *new_mfo;
zend_object *new_obj;
MSG_FORMAT_METHOD_FETCH_OBJECT_NO_CHECK;
- new_obj = MessageFormatter_ce_ptr->create_object(Z_OBJCE_P(object) TSRMLS_CC);
+ new_obj = MessageFormatter_ce_ptr->create_object(Z_OBJCE_P(object));
new_mfo = php_intl_messageformatter_fetch_object(new_obj);
/* clone standard parts */
- zend_objects_clone_members(&new_mfo->zo, &mfo->zo TSRMLS_CC);
+ zend_objects_clone_members(&new_mfo->zo, &mfo->zo);
/* clone formatter object */
if (MSG_FORMAT_OBJECT(mfo) != NULL) {
@@ -86,11 +86,11 @@ zend_object *MessageFormatter_object_clone(zval *object TSRMLS_DC)
if (U_FAILURE(INTL_DATA_ERROR_CODE(mfo))) {
intl_errors_set(INTL_DATA_ERROR_P(mfo), INTL_DATA_ERROR_CODE(mfo),
- "Failed to clone MessageFormatter object", 0 TSRMLS_CC);
- zend_throw_exception_ex(NULL, 0 TSRMLS_CC, "Failed to clone MessageFormatter object");
+ "Failed to clone MessageFormatter object", 0);
+ zend_throw_exception_ex(NULL, 0, "Failed to clone MessageFormatter object");
}
} else {
- zend_throw_exception_ex(NULL, 0 TSRMLS_CC, "Cannot clone unconstructed MessageFormatter");
+ zend_throw_exception_ex(NULL, 0, "Cannot clone unconstructed MessageFormatter");
}
return new_obj;
}
@@ -150,14 +150,14 @@ static zend_function_entry MessageFormatter_class_functions[] = {
/* {{{ msgformat_register_class
* Initialize 'MessageFormatter' class
*/
-void msgformat_register_class( TSRMLS_D )
+void msgformat_register_class( void )
{
zend_class_entry ce;
/* Create and register 'MessageFormatter' class. */
INIT_CLASS_ENTRY( ce, "MessageFormatter", MessageFormatter_class_functions );
ce.create_object = MessageFormatter_object_create;
- MessageFormatter_ce_ptr = zend_register_internal_class( &ce TSRMLS_CC );
+ MessageFormatter_ce_ptr = zend_register_internal_class( &ce );
memcpy(&MessageFormatter_handlers, zend_get_std_object_handlers(),
sizeof MessageFormatter_handlers);
diff --git a/ext/intl/msgformat/msgformat_class.h b/ext/intl/msgformat/msgformat_class.h
index 8c2c29a7dd..a90042e58f 100644
--- a/ext/intl/msgformat/msgformat_class.h
+++ b/ext/intl/msgformat/msgformat_class.h
@@ -37,7 +37,7 @@ static inline MessageFormatter_object *php_intl_messageformatter_fetch_object(ze
}
#define Z_INTL_MESSAGEFORMATTER_P(zv) php_intl_messageformatter_fetch_object(Z_OBJ_P(zv))
-void msgformat_register_class( TSRMLS_D );
+void msgformat_register_class( void );
extern zend_class_entry *MessageFormatter_ce_ptr;
/* Auxiliary macros */
@@ -48,7 +48,7 @@ extern zend_class_entry *MessageFormatter_ce_ptr;
MSG_FORMAT_METHOD_FETCH_OBJECT_NO_CHECK; \
if (MSG_FORMAT_OBJECT(mfo) == NULL) { \
intl_errors_set(&mfo->mf_data.error, U_ILLEGAL_ARGUMENT_ERROR, \
- "Found unconstructed MessageFormatter", 0 TSRMLS_CC); \
+ "Found unconstructed MessageFormatter", 0); \
RETURN_FALSE; \
}
diff --git a/ext/intl/msgformat/msgformat_data.c b/ext/intl/msgformat/msgformat_data.c
index f94920d3e8..697fba114a 100644
--- a/ext/intl/msgformat/msgformat_data.c
+++ b/ext/intl/msgformat/msgformat_data.c
@@ -26,7 +26,7 @@
/* {{{ void msgformat_data_init( msgformat_data* mf_data )
* Initialize internals of msgformat_data.
*/
-void msgformat_data_init( msgformat_data* mf_data TSRMLS_DC )
+void msgformat_data_init( msgformat_data* mf_data )
{
if( !mf_data )
return;
@@ -35,14 +35,14 @@ void msgformat_data_init( msgformat_data* mf_data TSRMLS_DC )
mf_data->orig_format = NULL;
mf_data->arg_types = NULL;
mf_data->tz_set = 0;
- intl_error_reset( &mf_data->error TSRMLS_CC );
+ intl_error_reset( &mf_data->error );
}
/* }}} */
/* {{{ void msgformat_data_free( msgformat_data* mf_data )
* Clean up memory allocated for msgformat_data
*/
-void msgformat_data_free(msgformat_data* mf_data TSRMLS_DC)
+void msgformat_data_free(msgformat_data* mf_data)
{
if (!mf_data)
return;
@@ -62,18 +62,18 @@ void msgformat_data_free(msgformat_data* mf_data TSRMLS_DC)
}
mf_data->umsgf = NULL;
- intl_error_reset(&mf_data->error TSRMLS_CC);
+ intl_error_reset(&mf_data->error);
}
/* }}} */
/* {{{ msgformat_data* msgformat_data_create()
* Allocate memory for msgformat_data and initialize it with default values.
*/
-msgformat_data* msgformat_data_create( TSRMLS_D )
+msgformat_data* msgformat_data_create( void )
{
msgformat_data* mf_data = ecalloc( 1, sizeof(msgformat_data) );
- msgformat_data_init( mf_data TSRMLS_CC );
+ msgformat_data_init( mf_data );
return mf_data;
}
diff --git a/ext/intl/msgformat/msgformat_data.h b/ext/intl/msgformat/msgformat_data.h
index f3a594d25a..a4226664ae 100644
--- a/ext/intl/msgformat/msgformat_data.h
+++ b/ext/intl/msgformat/msgformat_data.h
@@ -35,9 +35,9 @@ typedef struct {
int tz_set; /* if we've already the time zone in sub-formats */
} msgformat_data;
-msgformat_data* msgformat_data_create( TSRMLS_D );
-void msgformat_data_init( msgformat_data* mf_data TSRMLS_DC );
-void msgformat_data_free( msgformat_data* mf_data TSRMLS_DC );
+msgformat_data* msgformat_data_create( void );
+void msgformat_data_init( msgformat_data* mf_data );
+void msgformat_data_free( msgformat_data* mf_data );
#ifdef MSG_FORMAT_QUOTE_APOS
int msgformat_fix_quotes(UChar **spattern, uint32_t *spattern_len, UErrorCode *ec);
diff --git a/ext/intl/msgformat/msgformat_format.c b/ext/intl/msgformat/msgformat_format.c
index 36cd61c685..dda72249fc 100644
--- a/ext/intl/msgformat/msgformat_format.c
+++ b/ext/intl/msgformat/msgformat_format.c
@@ -32,7 +32,7 @@
#endif
/* {{{ */
-static void msgfmt_do_format(MessageFormatter_object *mfo, zval *args, zval *return_value TSRMLS_DC)
+static void msgfmt_do_format(MessageFormatter_object *mfo, zval *args, zval *return_value)
{
int count;
UChar* formatted = NULL;
@@ -45,7 +45,7 @@ static void msgfmt_do_format(MessageFormatter_object *mfo, zval *args, zval *ret
zend_hash_init(args_copy, count, NULL, ZVAL_PTR_DTOR, 0);
zend_hash_copy(args_copy, Z_ARRVAL_P(args), (copy_ctor_func_t)zval_add_ref);
- umsg_format_helper(mfo, args_copy, &formatted, &formatted_len TSRMLS_CC);
+ umsg_format_helper(mfo, args_copy, &formatted, &formatted_len);
zend_hash_destroy(args_copy);
efree(args_copy);
@@ -74,11 +74,11 @@ PHP_FUNCTION( msgfmt_format )
/* 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, MessageFormatter_ce_ptr, &args ) == FAILURE )
{
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "msgfmt_format: unable to parse input params", 0 TSRMLS_CC );
+ "msgfmt_format: unable to parse input params", 0 );
RETURN_FALSE;
}
@@ -86,7 +86,7 @@ PHP_FUNCTION( msgfmt_format )
/* Fetch the object. */
MSG_FORMAT_METHOD_FETCH_OBJECT;
- msgfmt_do_format(mfo, args, return_value TSRMLS_CC);
+ msgfmt_do_format(mfo, args, return_value);
}
/* }}} */
@@ -108,23 +108,23 @@ PHP_FUNCTION( msgfmt_format_message )
MessageFormatter_object *mfo = &mf;
/* Parse parameters. */
- if( zend_parse_method_parameters( ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "ssa",
+ if( zend_parse_method_parameters( ZEND_NUM_ARGS(), getThis(), "ssa",
&slocale, &slocale_len, &pattern, &pattern_len, &args ) == FAILURE )
{
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "msgfmt_format_message: unable to parse input params", 0 TSRMLS_CC );
+ "msgfmt_format_message: unable to parse input params", 0 );
RETURN_FALSE;
}
- msgformat_data_init(&mfo->mf_data TSRMLS_CC);
+ msgformat_data_init(&mfo->mf_data);
if(pattern && pattern_len) {
intl_convert_utf8_to_utf16(&spattern, &spattern_len, pattern, pattern_len, &INTL_DATA_ERROR_CODE(mfo));
if( U_FAILURE(INTL_DATA_ERROR_CODE((mfo))) )
{
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "msgfmt_format_message: error converting pattern to UTF-16", 0 TSRMLS_CC );
+ "msgfmt_format_message: error converting pattern to UTF-16", 0 );
RETURN_FALSE;
}
} else {
@@ -133,13 +133,13 @@ PHP_FUNCTION( msgfmt_format_message )
}
if(slocale_len == 0) {
- slocale = intl_locale_get_default(TSRMLS_C);
+ slocale = intl_locale_get_default();
}
#ifdef MSG_FORMAT_QUOTE_APOS
if(msgformat_fix_quotes(&spattern, &spattern_len, &INTL_DATA_ERROR_CODE(mfo)) != SUCCESS) {
intl_error_set( NULL, U_INVALID_FORMAT_ERROR,
- "msgfmt_format_message: error converting pattern to quote-friendly format", 0 TSRMLS_CC );
+ "msgfmt_format_message: error converting pattern to quote-friendly format", 0 );
RETURN_FALSE;
}
#endif
@@ -151,10 +151,10 @@ PHP_FUNCTION( msgfmt_format_message )
}
INTL_METHOD_CHECK_STATUS(mfo, "Creating message formatter failed");
- msgfmt_do_format(mfo, args, return_value TSRMLS_CC);
+ msgfmt_do_format(mfo, args, return_value);
/* drop the temporary formatter */
- msgformat_data_free(&mfo->mf_data TSRMLS_CC);
+ msgformat_data_free(&mfo->mf_data);
}
/* }}} */
diff --git a/ext/intl/msgformat/msgformat_helpers.cpp b/ext/intl/msgformat/msgformat_helpers.cpp
index 46ebe25a17..93c4290601 100644
--- a/ext/intl/msgformat/msgformat_helpers.cpp
+++ b/ext/intl/msgformat/msgformat_helpers.cpp
@@ -88,7 +88,7 @@ static void arg_types_dtor(zval *el) {
}
static HashTable *umsg_get_numeric_types(MessageFormatter_object *mfo,
- intl_error& err TSRMLS_DC)
+ intl_error& err)
{
HashTable *ret;
int32_t parts_count;
@@ -114,7 +114,7 @@ static HashTable *umsg_get_numeric_types(MessageFormatter_object *mfo,
const Formattable::Type t = types[i];
if (zend_hash_index_update_mem(ret, (zend_ulong)i, (void*)&t, sizeof(t)) == NULL) {
intl_errors_set(&err, U_MEMORY_ALLOCATION_ERROR,
- "Write to argument types hash table failed", 0 TSRMLS_CC);
+ "Write to argument types hash table failed", 0);
break;
}
}
@@ -134,7 +134,7 @@ static HashTable *umsg_get_numeric_types(MessageFormatter_object *mfo,
#ifdef HAS_MESSAGE_PATTERN
static HashTable *umsg_parse_format(MessageFormatter_object *mfo,
const MessagePattern& mp,
- intl_error& err TSRMLS_DC)
+ intl_error& err)
{
HashTable *ret;
int32_t parts_count;
@@ -144,7 +144,7 @@ static HashTable *umsg_parse_format(MessageFormatter_object *mfo,
}
if (!((MessageFormat *)mfo->mf_data.umsgf)->usesNamedArguments()) {
- return umsg_get_numeric_types(mfo, err TSRMLS_CC);
+ return umsg_get_numeric_types(mfo, err);
}
if (mfo->mf_data.arg_types) {
@@ -189,7 +189,7 @@ static HashTable *umsg_parse_format(MessageFormatter_object *mfo,
if ((storedType = (Formattable::Type*)zend_hash_str_update_mem(ret, (char*)argName.getBuffer(), argName.length(),
(void*)&bogusType, sizeof(bogusType))) == NULL) {
intl_errors_set(&err, U_MEMORY_ALLOCATION_ERROR,
- "Write to argument types hash table failed", 0 TSRMLS_CC);
+ "Write to argument types hash table failed", 0);
continue;
}
}
@@ -197,7 +197,7 @@ static HashTable *umsg_parse_format(MessageFormatter_object *mfo,
int32_t argNumber = name_part.getValue();
if (argNumber < 0) {
intl_errors_set(&err, U_INVALID_FORMAT_ERROR,
- "Found part with negative number", 0 TSRMLS_CC);
+ "Found part with negative number", 0);
continue;
}
if ((storedType = (Formattable::Type*)zend_hash_index_find_ptr(ret, (zend_ulong)argNumber)) == NULL) {
@@ -205,12 +205,12 @@ static HashTable *umsg_parse_format(MessageFormatter_object *mfo,
Formattable::Type bogusType = Formattable::kObject;
if ((storedType = (Formattable::Type*)zend_hash_index_update_mem(ret, (zend_ulong)argNumber, (void*)&bogusType, sizeof(bogusType))) == NULL) {
intl_errors_set(&err, U_MEMORY_ALLOCATION_ERROR,
- "Write to argument types hash table failed", 0 TSRMLS_CC);
+ "Write to argument types hash table failed", 0);
continue;
}
}
} else {
- intl_errors_set(&err, U_INVALID_FORMAT_ERROR, "Invalid part type encountered", 0 TSRMLS_CC);
+ intl_errors_set(&err, U_INVALID_FORMAT_ERROR, "Invalid part type encountered", 0);
continue;
}
@@ -255,7 +255,7 @@ static HashTable *umsg_parse_format(MessageFormatter_object *mfo,
* is broken. */
intl_errors_set(&err, U_PARSE_ERROR,
"Expected UMSGPAT_PART_TYPE_ARG_TYPE part following "
- "UMSGPAT_ARG_TYPE_SIMPLE part", 0 TSRMLS_CC);
+ "UMSGPAT_ARG_TYPE_SIMPLE part", 0);
continue;
}
} else if (argType == UMSGPAT_ARG_TYPE_PLURAL) {
@@ -272,7 +272,7 @@ static HashTable *umsg_parse_format(MessageFormatter_object *mfo,
/* We found a different type for the same arg! */
if (*storedType != Formattable::kObject && *storedType != type) {
intl_errors_set(&err, U_ARGUMENT_TYPE_MISMATCH,
- "Inconsistent types declared for an argument", 0 TSRMLS_CC);
+ "Inconsistent types declared for an argument", 0);
continue;
}
@@ -293,27 +293,27 @@ static HashTable *umsg_parse_format(MessageFormatter_object *mfo,
#endif
static HashTable *umsg_get_types(MessageFormatter_object *mfo,
- intl_error& err TSRMLS_DC)
+ intl_error& err)
{
MessageFormat *mf = (MessageFormat *)mfo->mf_data.umsgf;
#ifdef HAS_MESSAGE_PATTERN
const MessagePattern mp = MessageFormatAdapter::getMessagePattern(mf);
- return umsg_parse_format(mfo, mp, err TSRMLS_CC);
+ return umsg_parse_format(mfo, mp, err);
#else
if (mf->usesNamedArguments()) {
intl_errors_set(&err, U_UNSUPPORTED_ERROR,
"This extension supports named arguments only on ICU 4.8+",
- 0 TSRMLS_CC);
+ 0);
return NULL;
}
- return umsg_get_numeric_types(mfo, err TSRMLS_CC);
+ return umsg_get_numeric_types(mfo, err);
#endif
}
static void umsg_set_timezone(MessageFormatter_object *mfo,
- intl_error& err TSRMLS_DC)
+ intl_error& err)
{
MessageFormat *mf = (MessageFormat *)mfo->mf_data.umsgf;
TimeZone *used_tz = NULL;
@@ -333,7 +333,7 @@ static void umsg_set_timezone(MessageFormatter_object *mfo,
if (formats == NULL) {
intl_errors_set(&err, U_MEMORY_ALLOCATION_ERROR,
- "Out of memory retrieving subformats", 0 TSRMLS_CC);
+ "Out of memory retrieving subformats", 0);
}
for (int i = 0; U_SUCCESS(err.code) && i < count; i++) {
@@ -346,7 +346,7 @@ static void umsg_set_timezone(MessageFormatter_object *mfo,
if (used_tz == NULL) {
zval nullzv, *zvptr = &nullzv;
ZVAL_NULL(zvptr);
- used_tz = timezone_process_timezone_argument(zvptr, &err, "msgfmt_format" TSRMLS_CC);
+ used_tz = timezone_process_timezone_argument(zvptr, &err, "msgfmt_format");
if (used_tz == NULL) {
continue;
}
@@ -363,7 +363,7 @@ static void umsg_set_timezone(MessageFormatter_object *mfo,
U_CFUNC void umsg_format_helper(MessageFormatter_object *mfo,
HashTable *args,
UChar **formatted,
- int *formatted_len TSRMLS_DC)
+ int *formatted_len)
{
int arg_count = zend_hash_num_elements(args);
std::vector<Formattable> fargs;
@@ -376,9 +376,9 @@ U_CFUNC void umsg_format_helper(MessageFormatter_object *mfo,
return;
}
- types = umsg_get_types(mfo, err TSRMLS_CC);
+ types = umsg_get_types(mfo, err);
- umsg_set_timezone(mfo, err TSRMLS_CC);
+ umsg_set_timezone(mfo, err);
fargs.resize(arg_count);
farg_names.resize(arg_count);
@@ -403,7 +403,7 @@ U_CFUNC void umsg_format_helper(MessageFormatter_object *mfo,
/* includes case where index < 0 because it's exposed as unsigned */
if (num_index > (zend_ulong)INT32_MAX) {
intl_errors_set(&err, U_ILLEGAL_ARGUMENT_ERROR,
- "Found negative or too large array key", 0 TSRMLS_CC);
+ "Found negative or too large array key", 0);
continue;
}
@@ -419,7 +419,7 @@ U_CFUNC void umsg_format_helper(MessageFormatter_object *mfo,
char *message;
spprintf(&message, 0,
"Invalid UTF-8 data in argument key: '%s'", str_index->val);
- intl_errors_set(&err, err.code, message, 1 TSRMLS_CC);
+ intl_errors_set(&err, err.code, message, 1);
efree(message);
continue;
}
@@ -453,7 +453,7 @@ U_CFUNC void umsg_format_helper(MessageFormatter_object *mfo,
char *message;
spprintf(&message, 0, "Invalid UTF-8 data in string argument: "
"'%s'", Z_STRVAL_P(elem));
- intl_errors_set(&err, err.code, message, 1 TSRMLS_CC);
+ intl_errors_set(&err, err.code, message, 1);
efree(message);
delete text;
continue;
@@ -470,7 +470,7 @@ U_CFUNC void umsg_format_helper(MessageFormatter_object *mfo,
d = (double)Z_LVAL_P(elem);
} else {
SEPARATE_ZVAL_IF_NOT_REF(elem);
- convert_scalar_to_number(elem TSRMLS_CC);
+ convert_scalar_to_number(elem);
d = (Z_TYPE_P(elem) == IS_DOUBLE)
? Z_DVAL_P(elem)
: (double)Z_LVAL_P(elem);
@@ -487,7 +487,7 @@ retry_klong:
Z_DVAL_P(elem) < (double)INT32_MIN) {
intl_errors_set(&err, U_ILLEGAL_ARGUMENT_ERROR,
"Found PHP float with absolute value too large for "
- "32 bit integer argument", 0 TSRMLS_CC);
+ "32 bit integer argument", 0);
} else {
tInt32 = (int32_t)Z_DVAL_P(elem);
}
@@ -496,13 +496,13 @@ retry_klong:
Z_LVAL_P(elem) < INT32_MIN) {
intl_errors_set(&err, U_ILLEGAL_ARGUMENT_ERROR,
"Found PHP integer with absolute value too large "
- "for 32 bit integer argument", 0 TSRMLS_CC);
+ "for 32 bit integer argument", 0);
} else {
tInt32 = (int32_t)Z_LVAL_P(elem);
}
} else {
SEPARATE_ZVAL_IF_NOT_REF(elem);
- convert_scalar_to_number(elem TSRMLS_CC);
+ convert_scalar_to_number(elem);
goto retry_klong;
}
formattable.setLong(tInt32);
@@ -517,7 +517,7 @@ retry_kint64:
Z_DVAL_P(elem) < (double)U_INT64_MIN) {
intl_errors_set(&err, U_ILLEGAL_ARGUMENT_ERROR,
"Found PHP float with absolute value too large for "
- "64 bit integer argument", 0 TSRMLS_CC);
+ "64 bit integer argument", 0);
} else {
tInt64 = (int64_t)Z_DVAL_P(elem);
}
@@ -526,7 +526,7 @@ retry_kint64:
tInt64 = (int64_t)Z_LVAL_P(elem);
} else {
SEPARATE_ZVAL_IF_NOT_REF(elem);
- convert_scalar_to_number(elem TSRMLS_CC);
+ convert_scalar_to_number(elem);
goto retry_kint64;
}
formattable.setInt64(tInt64);
@@ -534,7 +534,7 @@ retry_kint64:
}
case Formattable::kDate:
{
- double dd = intl_zval_to_millis(elem, &err, "msgfmt_format" TSRMLS_CC);
+ double dd = intl_zval_to_millis(elem, &err, "msgfmt_format");
if (U_FAILURE(err.code)) {
char *message, *key_char;
int key_len;
@@ -543,7 +543,7 @@ retry_kint64:
&status) == SUCCESS) {
spprintf(&message, 0, "The argument for key '%s' "
"cannot be used as a date or time", key_char);
- intl_errors_set(&err, err.code, message, 1 TSRMLS_CC);
+ intl_errors_set(&err, err.code, message, 1);
efree(key_char);
efree(message);
}
@@ -554,7 +554,7 @@ retry_kint64:
}
default:
intl_errors_set(&err, U_ILLEGAL_ARGUMENT_ERROR,
- "Found unsupported argument type", 0 TSRMLS_CC);
+ "Found unsupported argument type", 0);
break;
}
} else {
@@ -589,7 +589,7 @@ retry_kint64:
"value given for the argument with key '%s' "
"is available", key_char);
intl_errors_set(&err,
- U_ILLEGAL_ARGUMENT_ERROR, message, 1 TSRMLS_CC);
+ U_ILLEGAL_ARGUMENT_ERROR, message, 1);
efree(key_char);
efree(message);
}
@@ -612,7 +612,7 @@ retry_kint64:
if (U_FAILURE(err.code)) {
intl_errors_set(&err, err.code,
- "Call to ICU MessageFormat::format() has failed", 0 TSRMLS_CC);
+ "Call to ICU MessageFormat::format() has failed", 0);
return;
}
@@ -621,7 +621,7 @@ retry_kint64:
resultStr.extract(*formatted, *formatted_len+1, err.code);
if (U_FAILURE(err.code)) {
intl_errors_set(&err, err.code,
- "Error copying format() result", 0 TSRMLS_CC);
+ "Error copying format() result", 0);
return;
}
}
diff --git a/ext/intl/msgformat/msgformat_helpers.h b/ext/intl/msgformat/msgformat_helpers.h
index 41d179f8d0..df05259574 100644
--- a/ext/intl/msgformat/msgformat_helpers.h
+++ b/ext/intl/msgformat/msgformat_helpers.h
@@ -19,7 +19,7 @@
int32_t umsg_format_arg_count(UMessageFormat *fmt);
void umsg_format_helper(MessageFormatter_object *mfo, HashTable *args,
- UChar **formatted, int *formatted_len TSRMLS_DC);
+ UChar **formatted, int *formatted_len);
void umsg_parse_helper(UMessageFormat *fmt, int *count, zval **args,
UChar *source, int source_len, UErrorCode *status);
#endif // MSG_FORMAT_HELPERS_H
diff --git a/ext/intl/msgformat/msgformat_parse.c b/ext/intl/msgformat/msgformat_parse.c
index add2f901eb..1474ff6ea8 100644
--- a/ext/intl/msgformat/msgformat_parse.c
+++ b/ext/intl/msgformat/msgformat_parse.c
@@ -28,7 +28,7 @@
#include "intl_convert.h"
/* {{{ */
-static void msgfmt_do_parse(MessageFormatter_object *mfo, char *source, size_t src_len, zval *return_value TSRMLS_DC)
+static void msgfmt_do_parse(MessageFormatter_object *mfo, char *source, size_t src_len, zval *return_value)
{
zval *fargs;
int count = 0;
@@ -66,11 +66,11 @@ PHP_FUNCTION( msgfmt_parse )
/* 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, MessageFormatter_ce_ptr, &source, &source_len ) == FAILURE )
{
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "msgfmt_parse: unable to parse input params", 0 TSRMLS_CC );
+ "msgfmt_parse: unable to parse input params", 0 );
RETURN_FALSE;
}
@@ -78,7 +78,7 @@ PHP_FUNCTION( msgfmt_parse )
/* Fetch the object. */
MSG_FORMAT_METHOD_FETCH_OBJECT;
- msgfmt_do_parse(mfo, source, source_len, return_value TSRMLS_CC);
+ msgfmt_do_parse(mfo, source, source_len, return_value);
}
/* }}} */
@@ -101,23 +101,23 @@ PHP_FUNCTION( msgfmt_parse_message )
MessageFormatter_object *mfo = &mf;
/* Parse parameters. */
- if( zend_parse_parameters( ZEND_NUM_ARGS() TSRMLS_CC, "sss",
+ if( zend_parse_parameters( ZEND_NUM_ARGS(), "sss",
&slocale, &slocale_len, &pattern, &pattern_len, &source, &src_len ) == FAILURE )
{
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "msgfmt_parse_message: unable to parse input params", 0 TSRMLS_CC );
+ "msgfmt_parse_message: unable to parse input params", 0 );
RETURN_FALSE;
}
- msgformat_data_init(&mfo->mf_data TSRMLS_CC);
+ msgformat_data_init(&mfo->mf_data);
if(pattern && pattern_len) {
intl_convert_utf8_to_utf16(&spattern, &spattern_len, pattern, pattern_len, &INTL_DATA_ERROR_CODE(mfo));
if( U_FAILURE(INTL_DATA_ERROR_CODE((mfo))) )
{
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "msgfmt_parse_message: error converting pattern to UTF-16", 0 TSRMLS_CC );
+ "msgfmt_parse_message: error converting pattern to UTF-16", 0 );
RETURN_FALSE;
}
} else {
@@ -126,13 +126,13 @@ PHP_FUNCTION( msgfmt_parse_message )
}
if(slocale_len == 0) {
- slocale = intl_locale_get_default(TSRMLS_C);
+ slocale = intl_locale_get_default();
}
#ifdef MSG_FORMAT_QUOTE_APOS
if(msgformat_fix_quotes(&spattern, &spattern_len, &INTL_DATA_ERROR_CODE(mfo)) != SUCCESS) {
intl_error_set( NULL, U_INVALID_FORMAT_ERROR,
- "msgfmt_parse_message: error converting pattern to quote-friendly format", 0 TSRMLS_CC );
+ "msgfmt_parse_message: error converting pattern to quote-friendly format", 0 );
RETURN_FALSE;
}
#endif
@@ -144,10 +144,10 @@ PHP_FUNCTION( msgfmt_parse_message )
}
INTL_METHOD_CHECK_STATUS(mfo, "Creating message formatter failed");
- msgfmt_do_parse(mfo, source, src_len, return_value TSRMLS_CC);
+ msgfmt_do_parse(mfo, source, src_len, return_value);
/* drop the temporary formatter */
- msgformat_data_free(&mfo->mf_data TSRMLS_CC);
+ msgformat_data_free(&mfo->mf_data);
}
/* }}} */