diff options
author | Anatol Belski <ab@php.net> | 2014-12-13 23:06:14 +0100 |
---|---|---|
committer | Anatol Belski <ab@php.net> | 2014-12-13 23:06:14 +0100 |
commit | bdeb220f48825642f84cdbf3ff23a30613c92e86 (patch) | |
tree | 1a6cf34d20420e4815b4becb21311a4457d84103 /ext/intl | |
parent | bb66f385d09e7e55390e9f57fcbca08f6b43ff91 (diff) | |
download | php-git-bdeb220f48825642f84cdbf3ff23a30613c92e86.tar.gz |
first shot remove TSRMLS_* things
Diffstat (limited to 'ext/intl')
96 files changed, 1488 insertions, 1489 deletions
diff --git a/ext/intl/breakiterator/breakiterator_class.cpp b/ext/intl/breakiterator/breakiterator_class.cpp index 715a866111..813204cd21 100644 --- a/ext/intl/breakiterator/breakiterator_class.cpp +++ b/ext/intl/breakiterator/breakiterator_class.cpp @@ -47,7 +47,7 @@ zend_object_handlers BreakIterator_handlers; /* }}} */ U_CFUNC void breakiterator_object_create(zval *object, - BreakIterator *biter, int brand_new TSRMLS_DC) + BreakIterator *biter, int brand_new) { UClassID classId = biter->getDynamicClassID(); zend_class_entry *ce; @@ -63,11 +63,11 @@ U_CFUNC void breakiterator_object_create(zval *object, if (brand_new) { object_init_ex(object, ce); } - breakiterator_object_construct(object, biter TSRMLS_CC); + breakiterator_object_construct(object, biter); } U_CFUNC void breakiterator_object_construct(zval *object, - BreakIterator *biter TSRMLS_DC) + BreakIterator *biter) { BreakIterator_object *bio; @@ -78,7 +78,7 @@ U_CFUNC void breakiterator_object_construct(zval *object, /* {{{ compare handler for BreakIterator */ static int BreakIterator_compare_objects(zval *object1, - zval *object2 TSRMLS_DC) + zval *object2) { BreakIterator_object *bio1, *bio2; @@ -95,19 +95,19 @@ static int BreakIterator_compare_objects(zval *object1, /* }}} */ /* {{{ clone handler for BreakIterator */ -static zend_object *BreakIterator_clone_obj(zval *object TSRMLS_DC) +static zend_object *BreakIterator_clone_obj(zval *object) { BreakIterator_object *bio_orig, *bio_new; zend_object *ret_val; bio_orig = Z_INTL_BREAKITERATOR_P(object); - intl_errors_reset(INTL_DATA_ERROR_P(bio_orig) TSRMLS_CC); + intl_errors_reset(INTL_DATA_ERROR_P(bio_orig)); - ret_val = BreakIterator_ce_ptr->create_object(Z_OBJCE_P(object) TSRMLS_CC); + ret_val = BreakIterator_ce_ptr->create_object(Z_OBJCE_P(object)); bio_new = php_intl_breakiterator_fetch_object(ret_val); - zend_objects_clone_members(&bio_new->zo, &bio_orig->zo TSRMLS_CC); + zend_objects_clone_members(&bio_new->zo, &bio_orig->zo); if (bio_orig->biter != NULL) { BreakIterator *new_biter; @@ -116,18 +116,18 @@ static zend_object *BreakIterator_clone_obj(zval *object TSRMLS_DC) if (!new_biter) { zend_string *err_msg; intl_errors_set_code(BREAKITER_ERROR_P(bio_orig), - U_MEMORY_ALLOCATION_ERROR TSRMLS_CC); + U_MEMORY_ALLOCATION_ERROR); intl_errors_set_custom_msg(BREAKITER_ERROR_P(bio_orig), - "Could not clone BreakIterator", 0 TSRMLS_CC); - err_msg = intl_error_get_message(BREAKITER_ERROR_P(bio_orig) TSRMLS_CC); - zend_throw_exception(NULL, err_msg->val, 0 TSRMLS_CC); + "Could not clone BreakIterator", 0); + err_msg = intl_error_get_message(BREAKITER_ERROR_P(bio_orig)); + zend_throw_exception(NULL, err_msg->val, 0); zend_string_free(err_msg); } else { bio_new->biter = new_biter; ZVAL_COPY(&bio_new->text, &bio_orig->text); } } else { - zend_throw_exception(NULL, "Cannot clone unconstructed BreakIterator", 0 TSRMLS_CC); + zend_throw_exception(NULL, "Cannot clone unconstructed BreakIterator", 0); } return ret_val; @@ -135,7 +135,7 @@ static zend_object *BreakIterator_clone_obj(zval *object TSRMLS_DC) /* }}} */ /* {{{ get_debug_info handler for BreakIterator */ -static HashTable *BreakIterator_get_debug_info(zval *object, int *is_temp TSRMLS_DC) +static HashTable *BreakIterator_get_debug_info(zval *object, int *is_temp) { zval val; HashTable *debug_info; @@ -176,23 +176,23 @@ static HashTable *BreakIterator_get_debug_info(zval *object, int *is_temp TSRMLS /* {{{ void breakiterator_object_init(BreakIterator_object* to) * Initialize internals of BreakIterator_object not specific to zend standard objects. */ -static void breakiterator_object_init(BreakIterator_object *bio TSRMLS_DC) +static void breakiterator_object_init(BreakIterator_object *bio) { - intl_error_init(BREAKITER_ERROR_P(bio) TSRMLS_CC); + intl_error_init(BREAKITER_ERROR_P(bio)); bio->biter = NULL; ZVAL_UNDEF(&bio->text); } /* }}} */ /* {{{ BreakIterator_objects_dtor */ -static void BreakIterator_objects_dtor(zend_object *object TSRMLS_DC) +static void BreakIterator_objects_dtor(zend_object *object) { - zend_objects_destroy_object(object TSRMLS_CC); + zend_objects_destroy_object(object); } /* }}} */ /* {{{ BreakIterator_objects_free */ -static void BreakIterator_objects_free(zend_object *object TSRMLS_DC) +static void BreakIterator_objects_free(zend_object *object) { BreakIterator_object* bio = php_intl_breakiterator_fetch_object(object); @@ -201,22 +201,22 @@ static void BreakIterator_objects_free(zend_object *object TSRMLS_DC) delete bio->biter; bio->biter = NULL; } - intl_error_reset(BREAKITER_ERROR_P(bio) TSRMLS_CC); + intl_error_reset(BREAKITER_ERROR_P(bio)); - zend_object_std_dtor(&bio->zo TSRMLS_CC); + zend_object_std_dtor(&bio->zo); } /* }}} */ /* {{{ BreakIterator_object_create */ -static zend_object *BreakIterator_object_create(zend_class_entry *ce TSRMLS_DC) +static zend_object *BreakIterator_object_create(zend_class_entry *ce) { BreakIterator_object* intern; intern = (BreakIterator_object*)ecalloc(1, sizeof(BreakIterator_object) + sizeof(zval) * (ce->default_properties_count - 1)); - zend_object_std_init(&intern->zo, ce TSRMLS_CC); + zend_object_std_init(&intern->zo, ce); object_properties_init((zend_object*) intern, ce); - breakiterator_object_init(intern TSRMLS_CC); + breakiterator_object_init(intern); intern->zo.handlers = &BreakIterator_handlers; @@ -316,7 +316,7 @@ static const zend_function_entry CodePointBreakIterator_class_functions[] = { /* {{{ breakiterator_register_BreakIterator_class * Initialize 'BreakIterator' class */ -U_CFUNC void breakiterator_register_BreakIterator_class(TSRMLS_D) +U_CFUNC void breakiterator_register_BreakIterator_class(void) { zend_class_entry ce; @@ -324,7 +324,7 @@ U_CFUNC void breakiterator_register_BreakIterator_class(TSRMLS_D) INIT_CLASS_ENTRY(ce, "IntlBreakIterator", BreakIterator_class_functions); ce.create_object = BreakIterator_object_create; ce.get_iterator = _breakiterator_get_iterator; - BreakIterator_ce_ptr = zend_register_internal_class(&ce TSRMLS_CC); + BreakIterator_ce_ptr = zend_register_internal_class(&ce); memcpy(&BreakIterator_handlers, zend_get_std_object_handlers(), sizeof BreakIterator_handlers); @@ -335,16 +335,16 @@ U_CFUNC void breakiterator_register_BreakIterator_class(TSRMLS_D) BreakIterator_handlers.dtor_obj = BreakIterator_objects_dtor; BreakIterator_handlers.free_obj = BreakIterator_objects_free; - zend_class_implements(BreakIterator_ce_ptr TSRMLS_CC, 1, + zend_class_implements(BreakIterator_ce_ptr, 1, zend_ce_traversable); zend_declare_class_constant_long(BreakIterator_ce_ptr, - "DONE", sizeof("DONE") - 1, BreakIterator::DONE TSRMLS_CC ); + "DONE", sizeof("DONE") - 1, BreakIterator::DONE ); /* Declare constants that are defined in the C header */ #define BREAKITER_DECL_LONG_CONST(name) \ zend_declare_class_constant_long(BreakIterator_ce_ptr, #name, \ - sizeof(#name) - 1, UBRK_ ## name TSRMLS_CC) + sizeof(#name) - 1, UBRK_ ## name) BREAKITER_DECL_LONG_CONST(WORD_NONE); BREAKITER_DECL_LONG_CONST(WORD_NONE_LIMIT); @@ -374,12 +374,12 @@ U_CFUNC void breakiterator_register_BreakIterator_class(TSRMLS_D) INIT_CLASS_ENTRY(ce, "IntlRuleBasedBreakIterator", RuleBasedBreakIterator_class_functions); RuleBasedBreakIterator_ce_ptr = zend_register_internal_class_ex(&ce, - BreakIterator_ce_ptr TSRMLS_CC); + BreakIterator_ce_ptr); /* Create and register 'CodePointBreakIterator' class. */ INIT_CLASS_ENTRY(ce, "IntlCodePointBreakIterator", CodePointBreakIterator_class_functions); CodePointBreakIterator_ce_ptr = zend_register_internal_class_ex(&ce, - BreakIterator_ce_ptr TSRMLS_CC); + BreakIterator_ce_ptr); } /* }}} */ diff --git a/ext/intl/breakiterator/breakiterator_class.h b/ext/intl/breakiterator/breakiterator_class.h index 6333003981..d1b5ebb2c8 100644 --- a/ext/intl/breakiterator/breakiterator_class.h +++ b/ext/intl/breakiterator/breakiterator_class.h @@ -58,15 +58,15 @@ static inline BreakIterator_object *php_intl_breakiterator_fetch_object(zend_obj BREAKITER_METHOD_FETCH_OBJECT_NO_CHECK; \ if (bio->biter == NULL) \ { \ - intl_errors_set(&bio->err, U_ILLEGAL_ARGUMENT_ERROR, "Found unconstructed BreakIterator", 0 TSRMLS_CC); \ + intl_errors_set(&bio->err, U_ILLEGAL_ARGUMENT_ERROR, "Found unconstructed BreakIterator", 0); \ RETURN_FALSE; \ } -void breakiterator_object_create(zval *object, BreakIterator *break_iter, int brand_new TSRMLS_DC); +void breakiterator_object_create(zval *object, BreakIterator *break_iter, int brand_new); -void breakiterator_object_construct(zval *object, BreakIterator *break_iter TSRMLS_DC); +void breakiterator_object_construct(zval *object, BreakIterator *break_iter); -void breakiterator_register_BreakIterator_class(TSRMLS_D); +void breakiterator_register_BreakIterator_class(void); extern zend_class_entry *BreakIterator_ce_ptr, *RuleBasedBreakIterator_ce_ptr; diff --git a/ext/intl/breakiterator/breakiterator_iterators.cpp b/ext/intl/breakiterator/breakiterator_iterators.cpp index 19de7bce34..624a813e54 100644 --- a/ext/intl/breakiterator/breakiterator_iterators.cpp +++ b/ext/intl/breakiterator/breakiterator_iterators.cpp @@ -36,30 +36,30 @@ static zend_object_handlers IntlPartsIterator_handlers; /* BreakIterator's iterator */ -inline BreakIterator *_breakiter_prolog(zend_object_iterator *iter TSRMLS_DC) +inline BreakIterator *_breakiter_prolog(zend_object_iterator *iter) { BreakIterator_object *bio; bio = Z_INTL_BREAKITERATOR_P(&iter->data); - intl_errors_reset(BREAKITER_ERROR_P(bio) TSRMLS_CC); + intl_errors_reset(BREAKITER_ERROR_P(bio)); if (bio->biter == NULL) { intl_errors_set(BREAKITER_ERROR_P(bio), U_INVALID_STATE_ERROR, "The BreakIterator object backing the PHP iterator is not " - "properly constructed", 0 TSRMLS_CC); + "properly constructed", 0); } return bio->biter; } -static void _breakiterator_destroy_it(zend_object_iterator *iter TSRMLS_DC) +static void _breakiterator_destroy_it(zend_object_iterator *iter) { zval_ptr_dtor(&iter->data); } -static void _breakiterator_move_forward(zend_object_iterator *iter TSRMLS_DC) +static void _breakiterator_move_forward(zend_object_iterator *iter) { - BreakIterator *biter = _breakiter_prolog(iter TSRMLS_CC); + BreakIterator *biter = _breakiter_prolog(iter); zoi_with_current *zoi_iter = (zoi_with_current*)iter; - iter->funcs->invalidate_current(iter TSRMLS_CC); + iter->funcs->invalidate_current(iter); if (biter == NULL) { return; @@ -71,9 +71,9 @@ static void _breakiterator_move_forward(zend_object_iterator *iter TSRMLS_DC) } //else we've reached the end of the enum, nothing more is required } -static void _breakiterator_rewind(zend_object_iterator *iter TSRMLS_DC) +static void _breakiterator_rewind(zend_object_iterator *iter) { - BreakIterator *biter = _breakiter_prolog(iter TSRMLS_CC); + BreakIterator *biter = _breakiter_prolog(iter); zoi_with_current *zoi_iter = (zoi_with_current*)iter; int32_t pos = biter->first(); @@ -91,12 +91,12 @@ static zend_object_iterator_funcs breakiterator_iterator_funcs = { }; U_CFUNC zend_object_iterator *_breakiterator_get_iterator( - zend_class_entry *ce, zval *object, int by_ref TSRMLS_DC) + zend_class_entry *ce, zval *object, int by_ref) { BreakIterator_object *bio; if (by_ref) { zend_throw_exception(NULL, - "Iteration by reference is not supported", 0 TSRMLS_CC); + "Iteration by reference is not supported", 0); return NULL; } @@ -105,12 +105,12 @@ U_CFUNC zend_object_iterator *_breakiterator_get_iterator( if (biter == NULL) { zend_throw_exception(NULL, - "The BreakIterator is not properly constructed", 0 TSRMLS_CC); + "The BreakIterator is not properly constructed", 0); return NULL; } zoi_with_current *zoi_iter = static_cast<zoi_with_current*>(emalloc(sizeof *zoi_iter)); - zend_iterator_init(&zoi_iter->zoi TSRMLS_CC); + zend_iterator_init(&zoi_iter->zoi); ZVAL_COPY(&zoi_iter->zoi.data, object); zoi_iter->zoi.funcs = &breakiterator_iterator_funcs; zoi_iter->zoi.index = 0; @@ -129,23 +129,23 @@ typedef struct zoi_break_iter_parts { BreakIterator_object *bio; /* so we don't have to fetch it all the time */ } zoi_break_iter_parts; -static void _breakiterator_parts_destroy_it(zend_object_iterator *iter TSRMLS_DC) +static void _breakiterator_parts_destroy_it(zend_object_iterator *iter) { zval_ptr_dtor(&iter->data); } -static void _breakiterator_parts_get_current_key(zend_object_iterator *iter, zval *key TSRMLS_DC) +static void _breakiterator_parts_get_current_key(zend_object_iterator *iter, zval *key) { /* the actual work is done in move_forward and rewind */ ZVAL_LONG(key, iter->index); } -static void _breakiterator_parts_move_forward(zend_object_iterator *iter TSRMLS_DC) +static void _breakiterator_parts_move_forward(zend_object_iterator *iter) { zoi_break_iter_parts *zoi_bit = (zoi_break_iter_parts*)iter; BreakIterator_object *bio = zoi_bit->bio; - iter->funcs->invalidate_current(iter TSRMLS_CC); + iter->funcs->invalidate_current(iter); int32_t cur, next; @@ -183,18 +183,18 @@ static void _breakiterator_parts_move_forward(zend_object_iterator *iter TSRMLS_ ZVAL_STR(&zoi_bit->zoi_cur.current, res); } -static void _breakiterator_parts_rewind(zend_object_iterator *iter TSRMLS_DC) +static void _breakiterator_parts_rewind(zend_object_iterator *iter) { zoi_break_iter_parts *zoi_bit = (zoi_break_iter_parts*)iter; BreakIterator_object *bio = zoi_bit->bio; if (!Z_ISUNDEF(zoi_bit->zoi_cur.current)) { - iter->funcs->invalidate_current(iter TSRMLS_CC); + iter->funcs->invalidate_current(iter); } bio->biter->first(); - iter->funcs->move_forward(iter TSRMLS_CC); + iter->funcs->move_forward(iter); } static zend_object_iterator_funcs breakiterator_parts_it_funcs = { @@ -209,7 +209,7 @@ static zend_object_iterator_funcs breakiterator_parts_it_funcs = { void IntlIterator_from_BreakIterator_parts(zval *break_iter_zv, zval *object, - parts_iter_key_type key_type TSRMLS_DC) + parts_iter_key_type key_type) { IntlIterator_object *ii; @@ -217,7 +217,7 @@ void IntlIterator_from_BreakIterator_parts(zval *break_iter_zv, ii = Z_INTL_ITERATOR_P(object); ii->iterator = (zend_object_iterator*)emalloc(sizeof(zoi_break_iter_parts)); - zend_iterator_init(ii->iterator TSRMLS_CC); + zend_iterator_init(ii->iterator); ZVAL_COPY(&ii->iterator->data, break_iter_zv); ii->iterator->funcs = &breakiterator_parts_it_funcs; @@ -234,15 +234,15 @@ void IntlIterator_from_BreakIterator_parts(zval *break_iter_zv, ((zoi_break_iter_parts*)ii->iterator)->key_type = key_type; } -U_CFUNC zend_object *IntlPartsIterator_object_create(zend_class_entry *ce TSRMLS_DC) +U_CFUNC zend_object *IntlPartsIterator_object_create(zend_class_entry *ce) { - zend_object *retval = IntlIterator_ce_ptr->create_object(ce TSRMLS_CC); + zend_object *retval = IntlIterator_ce_ptr->create_object(ce); retval->handlers = &IntlPartsIterator_handlers; return retval; } -U_CFUNC zend_function *IntlPartsIterator_get_method(zend_object **object_ptr, zend_string *method, const zval *key TSRMLS_DC) +U_CFUNC zend_function *IntlPartsIterator_get_method(zend_object **object_ptr, zend_string *method, const zval *key) { zend_function *ret; zend_string *lc_method_name; @@ -261,12 +261,12 @@ U_CFUNC zend_function *IntlPartsIterator_get_method(zend_object **object_ptr, ze if (obj->iterator && !Z_ISUNDEF(obj->iterator->data)) { zval *break_iter_zv = &obj->iterator->data; *object_ptr = Z_OBJ_P(break_iter_zv); - ret = Z_OBJ_HANDLER_P(break_iter_zv, get_method)(object_ptr, method, key TSRMLS_CC); + ret = Z_OBJ_HANDLER_P(break_iter_zv, get_method)(object_ptr, method, key); goto end; } } - ret = std_object_handlers.get_method(object_ptr, method, key TSRMLS_CC); + ret = std_object_handlers.get_method(object_ptr, method, key); end: if (key == NULL) { @@ -282,7 +282,7 @@ U_CFUNC PHP_METHOD(IntlPartsIterator, getBreakIterator) if (zend_parse_parameters_none() == FAILURE) { intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, - "IntlPartsIterator::getBreakIterator: bad arguments", 0 TSRMLS_CC); + "IntlPartsIterator::getBreakIterator: bad arguments", 0); return; } @@ -300,14 +300,14 @@ static const zend_function_entry IntlPartsIterator_class_functions[] = { PHP_FE_END }; -U_CFUNC void breakiterator_register_IntlPartsIterator_class(TSRMLS_D) +U_CFUNC void breakiterator_register_IntlPartsIterator_class(void) { zend_class_entry ce; /* Create and register 'BreakIterator' class. */ INIT_CLASS_ENTRY(ce, "IntlPartsIterator", IntlPartsIterator_class_functions); IntlPartsIterator_ce_ptr = zend_register_internal_class_ex(&ce, - IntlIterator_ce_ptr TSRMLS_CC); + IntlIterator_ce_ptr); IntlPartsIterator_ce_ptr->create_object = IntlPartsIterator_object_create; memcpy(&IntlPartsIterator_handlers, &IntlIterator_handlers, @@ -316,7 +316,7 @@ U_CFUNC void breakiterator_register_IntlPartsIterator_class(TSRMLS_D) #define PARTSITER_DECL_LONG_CONST(name) \ zend_declare_class_constant_long(IntlPartsIterator_ce_ptr, #name, \ - sizeof(#name) - 1, PARTS_ITERATOR_ ## name TSRMLS_CC) + sizeof(#name) - 1, PARTS_ITERATOR_ ## name) PARTSITER_DECL_LONG_CONST(KEY_SEQUENTIAL); PARTSITER_DECL_LONG_CONST(KEY_LEFT); diff --git a/ext/intl/breakiterator/breakiterator_iterators.h b/ext/intl/breakiterator/breakiterator_iterators.h index 764f4f4426..71a1e35025 100644 --- a/ext/intl/breakiterator/breakiterator_iterators.h +++ b/ext/intl/breakiterator/breakiterator_iterators.h @@ -32,11 +32,11 @@ typedef enum { #ifdef __cplusplus void IntlIterator_from_BreakIterator_parts(zval *break_iter_zv, zval *object, - parts_iter_key_type key_type TSRMLS_DC); + parts_iter_key_type key_type); #endif U_CFUNC zend_object_iterator *_breakiterator_get_iterator( - zend_class_entry *ce, zval *object, int by_ref TSRMLS_DC); -U_CFUNC void breakiterator_register_IntlPartsIterator_class(TSRMLS_D); + zend_class_entry *ce, zval *object, int by_ref); +U_CFUNC void breakiterator_register_IntlPartsIterator_class(void); #endif diff --git a/ext/intl/breakiterator/breakiterator_methods.cpp b/ext/intl/breakiterator/breakiterator_methods.cpp index 1153340e14..64c85bad73 100644 --- a/ext/intl/breakiterator/breakiterator_methods.cpp +++ b/ext/intl/breakiterator/breakiterator_methods.cpp @@ -37,7 +37,7 @@ U_CFUNC PHP_METHOD(BreakIterator, __construct) { zend_throw_exception( NULL, "An object of this type cannot be created with the new operator", - 0 TSRMLS_CC ); + 0 ); } static void _breakiter_factory(const char *func_name, @@ -49,31 +49,31 @@ static void _breakiter_factory(const char *func_name, size_t dummy; char *msg; UErrorCode status = UErrorCode(); - intl_error_reset(NULL TSRMLS_CC); + intl_error_reset(NULL); - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s!", + if (zend_parse_parameters(ZEND_NUM_ARGS(), "s!", &locale_str, &dummy) == FAILURE) { spprintf(&msg, 0, "%s: bad arguments", func_name); - intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, msg, 1 TSRMLS_CC); + intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, msg, 1); efree(msg); RETURN_NULL(); } if (locale_str == NULL) { - locale_str = intl_locale_get_default(TSRMLS_C); + locale_str = intl_locale_get_default(); } biter = func(Locale::createFromName(locale_str), status); - intl_error_set_code(NULL, status TSRMLS_CC); + intl_error_set_code(NULL, status); if (U_FAILURE(status)) { spprintf(&msg, 0, "%s: error creating BreakIterator", func_name); - intl_error_set_custom_msg(NULL, msg, 1 TSRMLS_CC); + intl_error_set_custom_msg(NULL, msg, 1); efree(msg); RETURN_NULL(); } - breakiterator_object_create(return_value, biter, 1 TSRMLS_CC); + breakiterator_object_create(return_value, biter, 1); } U_CFUNC PHP_FUNCTION(breakiter_create_word_instance) @@ -114,16 +114,16 @@ U_CFUNC PHP_FUNCTION(breakiter_create_title_instance) U_CFUNC PHP_FUNCTION(breakiter_create_code_point_instance) { UErrorCode status = UErrorCode(); - intl_error_reset(NULL TSRMLS_CC); + intl_error_reset(NULL); if (zend_parse_parameters_none() == FAILURE) { intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, - "breakiter_create_code_point_instance: bad arguments", 0 TSRMLS_CC); + "breakiter_create_code_point_instance: bad arguments", 0); RETURN_NULL(); } CodePointBreakIterator *cpbi = new CodePointBreakIterator(); - breakiterator_object_create(return_value, cpbi, 1 TSRMLS_CC); + breakiterator_object_create(return_value, cpbi, 1); } U_CFUNC PHP_FUNCTION(breakiter_get_text) @@ -133,7 +133,7 @@ U_CFUNC PHP_FUNCTION(breakiter_get_text) if (zend_parse_parameters_none() == FAILURE) { intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, - "breakiter_get_text: bad arguments", 0 TSRMLS_CC); + "breakiter_get_text: bad arguments", 0); RETURN_FALSE; } @@ -155,10 +155,10 @@ U_CFUNC PHP_FUNCTION(breakiter_set_text) BREAKITER_METHOD_INIT_VARS; object = getThis(); - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", + if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &text, &text_len) == FAILURE) { intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, - "breakiter_set_text: bad arguments", 0 TSRMLS_CC); + "breakiter_set_text: bad arguments", 0); RETURN_FALSE; } @@ -199,7 +199,7 @@ static void _breakiter_no_args_ret_int32( if (zend_parse_parameters_none() == FAILURE) { spprintf(&msg, 0, "%s: bad arguments", func_name); - intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, msg, 1 TSRMLS_CC); + intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, msg, 1); efree(msg); RETURN_FALSE; } @@ -221,9 +221,9 @@ static void _breakiter_int32_ret_int32( BREAKITER_METHOD_INIT_VARS; object = getThis(); - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &arg) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &arg) == FAILURE) { spprintf(&msg, 0, "%s: bad arguments", func_name); - intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, msg, 1 TSRMLS_CC); + intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, msg, 1); efree(msg); RETURN_FALSE; } @@ -233,7 +233,7 @@ static void _breakiter_int32_ret_int32( if (arg < INT32_MIN || arg > INT32_MAX) { spprintf(&msg, 0, "%s: offset argument is outside bounds of " "a 32-bit wide integer", func_name); - intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, msg, 1 TSRMLS_CC); + intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, msg, 1); efree(msg); RETURN_FALSE; } @@ -300,7 +300,7 @@ U_CFUNC PHP_FUNCTION(breakiter_current) if (zend_parse_parameters_none() == FAILURE) { intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, - "breakiter_current: bad arguments", 0 TSRMLS_CC); + "breakiter_current: bad arguments", 0); RETURN_FALSE; } @@ -331,17 +331,17 @@ U_CFUNC PHP_FUNCTION(breakiter_is_boundary) BREAKITER_METHOD_INIT_VARS; object = getThis(); - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", + if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &offset) == FAILURE) { intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, - "breakiter_is_boundary: bad arguments", 0 TSRMLS_CC); + "breakiter_is_boundary: bad arguments", 0); RETURN_FALSE; } if (offset < INT32_MIN || offset > INT32_MAX) { intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, "breakiter_is_boundary: offset argument is outside bounds of " - "a 32-bit wide integer", 0 TSRMLS_CC); + "a 32-bit wide integer", 0); RETURN_FALSE; } @@ -358,15 +358,15 @@ U_CFUNC PHP_FUNCTION(breakiter_get_locale) BREAKITER_METHOD_INIT_VARS; object = getThis(); - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &locale_type) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &locale_type) == FAILURE) { intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, - "breakiter_get_locale: bad arguments", 0 TSRMLS_CC); + "breakiter_get_locale: bad arguments", 0); RETURN_FALSE; } if (locale_type != ULOC_ACTUAL_LOCALE && locale_type != ULOC_VALID_LOCALE) { intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, - "breakiter_get_locale: invalid locale type", 0 TSRMLS_CC); + "breakiter_get_locale: invalid locale type", 0); RETURN_FALSE; } @@ -386,9 +386,9 @@ U_CFUNC PHP_FUNCTION(breakiter_get_parts_iterator) BREAKITER_METHOD_INIT_VARS; object = getThis(); - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|l", &key_type) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "|l", &key_type) == FAILURE) { intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, - "breakiter_get_parts_iterator: bad arguments", 0 TSRMLS_CC); + "breakiter_get_parts_iterator: bad arguments", 0); RETURN_FALSE; } @@ -396,14 +396,14 @@ U_CFUNC PHP_FUNCTION(breakiter_get_parts_iterator) && key_type != PARTS_ITERATOR_KEY_LEFT && key_type != PARTS_ITERATOR_KEY_RIGHT) { intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, - "breakiter_get_parts_iterator: bad key type", 0 TSRMLS_CC); + "breakiter_get_parts_iterator: bad key type", 0); RETURN_FALSE; } BREAKITER_METHOD_FETCH_OBJECT; IntlIterator_from_BreakIterator_parts( - object, return_value, (parts_iter_key_type)key_type TSRMLS_CC); + object, return_value, (parts_iter_key_type)key_type); } U_CFUNC PHP_FUNCTION(breakiter_get_error_code) @@ -413,7 +413,7 @@ U_CFUNC PHP_FUNCTION(breakiter_get_error_code) if (zend_parse_parameters_none() == FAILURE) { intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, - "breakiter_get_error_code: bad arguments", 0 TSRMLS_CC); + "breakiter_get_error_code: bad arguments", 0); RETURN_FALSE; } @@ -433,7 +433,7 @@ U_CFUNC PHP_FUNCTION(breakiter_get_error_message) if (zend_parse_parameters_none() == FAILURE) { intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, - "breakiter_get_error_message: bad arguments", 0 TSRMLS_CC ); + "breakiter_get_error_message: bad arguments", 0 ); RETURN_FALSE; } @@ -444,6 +444,6 @@ U_CFUNC PHP_FUNCTION(breakiter_get_error_message) RETURN_FALSE; /* Return last error message. */ - message = intl_error_get_message(BREAKITER_ERROR_P(bio) TSRMLS_CC); + message = intl_error_get_message(BREAKITER_ERROR_P(bio)); RETURN_STR(message); } diff --git a/ext/intl/breakiterator/codepointiterator_methods.cpp b/ext/intl/breakiterator/codepointiterator_methods.cpp index d7fe359712..f916915ae2 100644 --- a/ext/intl/breakiterator/codepointiterator_methods.cpp +++ b/ext/intl/breakiterator/codepointiterator_methods.cpp @@ -34,7 +34,7 @@ U_CFUNC PHP_FUNCTION(cpbi_get_last_code_point) if (zend_parse_parameters_none() == FAILURE) { intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, - "cpbi_get_last_code_point: bad arguments", 0 TSRMLS_CC); + "cpbi_get_last_code_point: bad arguments", 0); RETURN_FALSE; } diff --git a/ext/intl/breakiterator/rulebasedbreakiterator_methods.cpp b/ext/intl/breakiterator/rulebasedbreakiterator_methods.cpp index d3b36291b2..be38396466 100644 --- a/ext/intl/breakiterator/rulebasedbreakiterator_methods.cpp +++ b/ext/intl/breakiterator/rulebasedbreakiterator_methods.cpp @@ -36,12 +36,12 @@ static void _php_intlrbbi_constructor_body(INTERNAL_FUNCTION_PARAMETERS) size_t rules_len; zend_bool compiled = 0; UErrorCode status = U_ZERO_ERROR; - intl_error_reset(NULL TSRMLS_CC); + intl_error_reset(NULL); - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|b", + if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|b", &rules, &rules_len, &compiled) == FAILURE) { intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, - "rbbi_create_instance: bad arguments", 0 TSRMLS_CC); + "rbbi_create_instance: bad arguments", 0); Z_OBJ_P(return_value) = NULL; return; } @@ -56,12 +56,12 @@ static void _php_intlrbbi_constructor_body(INTERNAL_FUNCTION_PARAMETERS) == FAILURE) { intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, "rbbi_create_instance: rules were not a valid UTF-8 string", - 0 TSRMLS_CC); + 0); RETURN_NULL(); } rbbi = new RuleBasedBreakIterator(rulesStr, parseError, status); - intl_error_set_code(NULL, status TSRMLS_CC); + intl_error_set_code(NULL, status); if (U_FAILURE(status)) { char *msg; smart_str parse_error_str; @@ -69,7 +69,7 @@ static void _php_intlrbbi_constructor_body(INTERNAL_FUNCTION_PARAMETERS) spprintf(&msg, 0, "rbbi_create_instance: unable to create " "RuleBasedBreakIterator from rules (%s)", parse_error_str.s? parse_error_str.s->val : ""); smart_str_free(&parse_error_str); - intl_error_set_custom_msg(NULL, msg, 1 TSRMLS_CC); + intl_error_set_custom_msg(NULL, msg, 1); efree(msg); delete rbbi; Z_OBJ_P(return_value) = NULL; @@ -80,19 +80,19 @@ static void _php_intlrbbi_constructor_body(INTERNAL_FUNCTION_PARAMETERS) rbbi = new RuleBasedBreakIterator((uint8_t*)rules, rules_len, status); if (U_FAILURE(status)) { intl_error_set(NULL, status, "rbbi_create_instance: unable to " - "create instance from compiled rules", 0 TSRMLS_CC); + "create instance from compiled rules", 0); Z_OBJ_P(return_value) = NULL; return; } #else intl_error_set(NULL, U_UNSUPPORTED_ERROR, "rbbi_create_instance: " - "compiled rules require ICU >= 4.8", 0 TSRMLS_CC); + "compiled rules require ICU >= 4.8", 0); Z_OBJ_P(return_value) = NULL; return; #endif } - breakiterator_object_create(return_value, rbbi, 0 TSRMLS_CC); + breakiterator_object_create(return_value, rbbi, 0); } U_CFUNC PHP_METHOD(IntlRuleBasedBreakIterator, __construct) @@ -103,7 +103,7 @@ U_CFUNC PHP_METHOD(IntlRuleBasedBreakIterator, __construct) _php_intlrbbi_constructor_body(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(); } @@ -116,7 +116,7 @@ U_CFUNC PHP_FUNCTION(rbbi_get_rules) if (zend_parse_parameters_none() == FAILURE) { intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, - "rbbi_get_rules: bad arguments", 0 TSRMLS_CC); + "rbbi_get_rules: bad arguments", 0); RETURN_FALSE; } @@ -130,7 +130,7 @@ U_CFUNC PHP_FUNCTION(rbbi_get_rules) { intl_errors_set(BREAKITER_ERROR_P(bio), BREAKITER_ERROR_CODE(bio), "rbbi_hash_code: Error converting result to UTF-8 string", - 0 TSRMLS_CC); + 0); RETURN_FALSE; } RETVAL_STRINGL(str, str_len); @@ -145,7 +145,7 @@ U_CFUNC PHP_FUNCTION(rbbi_get_rule_status) if (zend_parse_parameters_none() == FAILURE) { intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, - "rbbi_get_rule_status: bad arguments", 0 TSRMLS_CC); + "rbbi_get_rule_status: bad arguments", 0); RETURN_FALSE; } @@ -161,7 +161,7 @@ U_CFUNC PHP_FUNCTION(rbbi_get_rule_status_vec) if (zend_parse_parameters_none() == FAILURE) { intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, - "rbbi_get_rule_status_vec: bad arguments", 0 TSRMLS_CC); + "rbbi_get_rule_status_vec: bad arguments", 0); RETURN_FALSE; } @@ -183,7 +183,7 @@ U_CFUNC PHP_FUNCTION(rbbi_get_rule_status_vec) delete[] rules; intl_errors_set(BREAKITER_ERROR_P(bio), BREAKITER_ERROR_CODE(bio), "rbbi_get_rule_status_vec: failed obtaining the status values", - 0 TSRMLS_CC); + 0); RETURN_FALSE; } @@ -202,7 +202,7 @@ U_CFUNC PHP_FUNCTION(rbbi_get_binary_rules) if (zend_parse_parameters_none() == FAILURE) { intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, - "rbbi_get_binary_rules: bad arguments", 0 TSRMLS_CC); + "rbbi_get_binary_rules: bad arguments", 0); RETURN_FALSE; } @@ -214,7 +214,7 @@ U_CFUNC PHP_FUNCTION(rbbi_get_binary_rules) if (rules_len > INT_MAX - 1) { intl_errors_set(BREAKITER_ERROR_P(bio), BREAKITER_ERROR_CODE(bio), "rbbi_get_binary_rules: the rules are too large", - 0 TSRMLS_CC); + 0); RETURN_FALSE; } diff --git a/ext/intl/calendar/calendar_class.cpp b/ext/intl/calendar/calendar_class.cpp index 7273b1d277..81f6d81546 100644 --- a/ext/intl/calendar/calendar_class.cpp +++ b/ext/intl/calendar/calendar_class.cpp @@ -41,7 +41,7 @@ zend_object_handlers Calendar_handlers; /* }}} */ U_CFUNC void calendar_object_create(zval *object, - Calendar *calendar TSRMLS_DC) + Calendar *calendar) { UClassID classId = calendar->getDynamicClassID(); zend_class_entry *ce; @@ -54,10 +54,10 @@ U_CFUNC void calendar_object_create(zval *object, } object_init_ex(object, ce); - calendar_object_construct(object, calendar TSRMLS_CC); + calendar_object_construct(object, calendar); } -U_CFUNC Calendar *calendar_fetch_native_calendar(zval *object TSRMLS_DC) +U_CFUNC Calendar *calendar_fetch_native_calendar(zval *object) { Calendar_object *co = Z_INTL_CALENDAR_P(object); @@ -65,7 +65,7 @@ U_CFUNC Calendar *calendar_fetch_native_calendar(zval *object TSRMLS_DC) } U_CFUNC void calendar_object_construct(zval *object, - Calendar *calendar TSRMLS_DC) + Calendar *calendar) { Calendar_object *co; @@ -75,20 +75,20 @@ U_CFUNC void calendar_object_construct(zval *object, } /* {{{ clone handler for Calendar */ -static zend_object *Calendar_clone_obj(zval *object TSRMLS_DC) +static zend_object *Calendar_clone_obj(zval *object) { Calendar_object *co_orig, *co_new; zend_object *ret_val; - intl_error_reset(NULL TSRMLS_CC); + intl_error_reset(NULL); co_orig = Z_INTL_CALENDAR_P(object); - intl_error_reset(INTL_DATA_ERROR_P(co_orig) TSRMLS_CC); + intl_error_reset(INTL_DATA_ERROR_P(co_orig)); - ret_val = Calendar_ce_ptr->create_object(Z_OBJCE_P(object) TSRMLS_CC); + ret_val = Calendar_ce_ptr->create_object(Z_OBJCE_P(object)); co_new = php_intl_calendar_fetch_object(ret_val); - zend_objects_clone_members(&co_new->zo, &co_orig->zo TSRMLS_CC); + zend_objects_clone_members(&co_new->zo, &co_orig->zo); if (co_orig->ucal != NULL) { Calendar *newCalendar; @@ -97,17 +97,17 @@ static zend_object *Calendar_clone_obj(zval *object TSRMLS_DC) if (!newCalendar) { zend_string *err_msg; intl_errors_set_code(CALENDAR_ERROR_P(co_orig), - U_MEMORY_ALLOCATION_ERROR TSRMLS_CC); + U_MEMORY_ALLOCATION_ERROR); intl_errors_set_custom_msg(CALENDAR_ERROR_P(co_orig), - "Could not clone IntlCalendar", 0 TSRMLS_CC); - err_msg = intl_error_get_message(CALENDAR_ERROR_P(co_orig) TSRMLS_CC); - zend_throw_exception(NULL, err_msg->val, 0 TSRMLS_CC); + "Could not clone IntlCalendar", 0); + err_msg = intl_error_get_message(CALENDAR_ERROR_P(co_orig)); + zend_throw_exception(NULL, err_msg->val, 0); zend_string_free(err_msg); } else { co_new->ucal = newCalendar; } } else { - zend_throw_exception(NULL, "Cannot clone unconstructed IntlCalendar", 0 TSRMLS_CC); + zend_throw_exception(NULL, "Cannot clone unconstructed IntlCalendar", 0); } return ret_val; @@ -144,7 +144,7 @@ static const struct { }; /* {{{ get_debug_info handler for Calendar */ -static HashTable *Calendar_get_debug_info(zval *object, int *is_temp TSRMLS_DC) +static HashTable *Calendar_get_debug_info(zval *object, int *is_temp) { zval zv, zfields; @@ -176,8 +176,8 @@ static HashTable *Calendar_get_debug_info(zval *object, int *is_temp TSRMLS_DC) int is_tmp; HashTable *debug_info_tz; - timezone_object_construct(&cal->getTimeZone(), &ztz , 0 TSRMLS_CC); - debug_info = Z_OBJ_HANDLER(ztz, get_debug_info)(&ztz, &is_tmp TSRMLS_CC); + timezone_object_construct(&cal->getTimeZone(), &ztz , 0); + debug_info = Z_OBJ_HANDLER(ztz, get_debug_info)(&ztz, &is_tmp); assert(is_tmp == 1); array_init(&ztz_debug); @@ -224,22 +224,22 @@ static HashTable *Calendar_get_debug_info(zval *object, int *is_temp TSRMLS_DC) /* {{{ void calendar_object_init(Calendar_object* to) * Initialize internals of Calendar_object not specific to zend standard objects. */ -static void calendar_object_init(Calendar_object *co TSRMLS_DC) +static void calendar_object_init(Calendar_object *co) { - intl_error_init(CALENDAR_ERROR_P(co) TSRMLS_CC); + intl_error_init(CALENDAR_ERROR_P(co)); co->ucal = NULL; } /* }}} */ /* {{{ Calendar_objects_dtor */ -static void Calendar_objects_dtor(zend_object *object TSRMLS_DC) +static void Calendar_objects_dtor(zend_object *object) { - zend_objects_destroy_object(object TSRMLS_CC); + zend_objects_destroy_object(object); } /* }}} */ /* {{{ Calendar_objects_free */ -static void Calendar_objects_free(zend_object *object TSRMLS_DC) +static void Calendar_objects_free(zend_object *object) { Calendar_object* co = php_intl_calendar_fetch_object(object); @@ -247,22 +247,22 @@ static void Calendar_objects_free(zend_object *object TSRMLS_DC) delete co->ucal; co->ucal = NULL; } - intl_error_reset(CALENDAR_ERROR_P(co) TSRMLS_CC); + intl_error_reset(CALENDAR_ERROR_P(co)); - zend_object_std_dtor(&co->zo TSRMLS_CC); + zend_object_std_dtor(&co->zo); } /* }}} */ /* {{{ Calendar_object_create */ -static zend_object *Calendar_object_create(zend_class_entry *ce TSRMLS_DC) +static zend_object *Calendar_object_create(zend_class_entry *ce) { Calendar_object* intern; intern = (Calendar_object*)ecalloc(1, sizeof(Calendar_object) + sizeof(zval) * (ce->default_properties_count - 1)); - zend_object_std_init(&intern->zo, ce TSRMLS_CC); + zend_object_std_init(&intern->zo, ce); object_properties_init((zend_object*) intern, ce); - calendar_object_init(intern TSRMLS_CC); + calendar_object_init(intern); intern->zo.handlers = &Calendar_handlers; @@ -455,17 +455,17 @@ static const zend_function_entry GregorianCalendar_class_functions[] = { /* {{{ calendar_register_IntlCalendar_class * Initialize 'IntlCalendar' class */ -void calendar_register_IntlCalendar_class(TSRMLS_D) +void calendar_register_IntlCalendar_class(void) { zend_class_entry ce; /* Create and register 'IntlCalendar' class. */ INIT_CLASS_ENTRY(ce, "IntlCalendar", Calendar_class_functions); ce.create_object = Calendar_object_create; - Calendar_ce_ptr = zend_register_internal_class(&ce TSRMLS_CC); + Calendar_ce_ptr = zend_register_internal_class(&ce); if (!Calendar_ce_ptr) { //can't happen now without bigger problems before - php_error_docref0(NULL TSRMLS_CC, E_ERROR, + php_error_docref0(NULL, E_ERROR, "IntlCalendar: class registration has failed."); return; } @@ -480,10 +480,10 @@ void calendar_register_IntlCalendar_class(TSRMLS_D) /* Create and register 'IntlGregorianCalendar' class. */ INIT_CLASS_ENTRY(ce, "IntlGregorianCalendar", GregorianCalendar_class_functions); GregorianCalendar_ce_ptr = zend_register_internal_class_ex(&ce, - Calendar_ce_ptr TSRMLS_CC); + Calendar_ce_ptr); if (!GregorianCalendar_ce_ptr) { //can't happen know without bigger problems before - php_error_docref0(NULL TSRMLS_CC, E_ERROR, + php_error_docref0(NULL, E_ERROR, "IntlGregorianCalendar: class registration has failed."); return; } @@ -491,7 +491,7 @@ void calendar_register_IntlCalendar_class(TSRMLS_D) /* Declare 'IntlCalendar' class constants */ #define CALENDAR_DECL_LONG_CONST(name, val) \ zend_declare_class_constant_long(Calendar_ce_ptr, name, sizeof(name) - 1, \ - val TSRMLS_CC) + val) CALENDAR_DECL_LONG_CONST("FIELD_ERA", UCAL_ERA); CALENDAR_DECL_LONG_CONST("FIELD_YEAR", UCAL_YEAR); diff --git a/ext/intl/calendar/calendar_class.h b/ext/intl/calendar/calendar_class.h index 47f991f118..a884580a9a 100644 --- a/ext/intl/calendar/calendar_class.h +++ b/ext/intl/calendar/calendar_class.h @@ -55,17 +55,17 @@ static inline Calendar_object *php_intl_calendar_fetch_object(zend_object *obj) CALENDAR_METHOD_FETCH_OBJECT_NO_CHECK; \ if (co->ucal == NULL) \ { \ - intl_errors_set(&co->err, U_ILLEGAL_ARGUMENT_ERROR, "Found unconstructed IntlCalendar", 0 TSRMLS_CC); \ + intl_errors_set(&co->err, U_ILLEGAL_ARGUMENT_ERROR, "Found unconstructed IntlCalendar", 0); \ RETURN_FALSE; \ } -void calendar_object_create(zval *object, Calendar *calendar TSRMLS_DC); +void calendar_object_create(zval *object, Calendar *calendar); -Calendar *calendar_fetch_native_calendar(zval *object TSRMLS_DC); +Calendar *calendar_fetch_native_calendar(zval *object); -void calendar_object_construct(zval *object, Calendar *calendar TSRMLS_DC); +void calendar_object_construct(zval *object, Calendar *calendar); -void calendar_register_IntlCalendar_class(TSRMLS_D); +void calendar_register_IntlCalendar_class(void); extern zend_class_entry *Calendar_ce_ptr, *GregorianCalendar_ce_ptr; diff --git a/ext/intl/calendar/calendar_methods.cpp b/ext/intl/calendar/calendar_methods.cpp index eaa1930e42..da338db46b 100644 --- a/ext/intl/calendar/calendar_methods.cpp +++ b/ext/intl/calendar/calendar_methods.cpp @@ -44,7 +44,7 @@ U_CFUNC PHP_METHOD(IntlCalendar, __construct) { zend_throw_exception( NULL, "An object of this type cannot be created with the new operator", - 0 TSRMLS_CC ); + 0 ); } U_CFUNC PHP_FUNCTION(intlcal_create_instance) @@ -54,34 +54,34 @@ U_CFUNC PHP_FUNCTION(intlcal_create_instance) size_t dummy; TimeZone *timeZone; UErrorCode status = U_ZERO_ERROR; - intl_error_reset(NULL TSRMLS_CC); + intl_error_reset(NULL); - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|zs!", + if (zend_parse_parameters(ZEND_NUM_ARGS(), "|zs!", &zv_timezone, &locale_str, &dummy) == FAILURE) { intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, - "intlcal_create_calendar: bad arguments", 0 TSRMLS_CC); + "intlcal_create_calendar: bad arguments", 0); RETURN_NULL(); } timeZone = timezone_process_timezone_argument(zv_timezone, NULL, - "intlcal_create_instance" TSRMLS_CC); + "intlcal_create_instance"); if (timeZone == NULL) { RETURN_NULL(); } if (!locale_str) { - locale_str = intl_locale_get_default(TSRMLS_C); + locale_str = intl_locale_get_default(); } Calendar *cal = Calendar::createInstance(timeZone, Locale::createFromName(locale_str), status); if (cal == NULL) { delete timeZone; - intl_error_set(NULL, status, "Error creating ICU Calendar object", 0 TSRMLS_CC); + intl_error_set(NULL, status, "Error creating ICU Calendar object", 0); RETURN_NULL(); } - calendar_object_create(return_value, cal TSRMLS_CC); + calendar_object_create(return_value, cal); } #if U_ICU_VERSION_MAJOR_NUM * 10 + U_ICU_VERSION_MINOR_NUM >= 42 @@ -146,12 +146,12 @@ U_CFUNC PHP_FUNCTION(intlcal_get_keyword_values_for_locale) size_t key_len, locale_len; zend_bool commonly_used; - intl_error_reset(NULL TSRMLS_CC); + intl_error_reset(NULL); - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ssb", + if (zend_parse_parameters(ZEND_NUM_ARGS(), "ssb", &key, &key_len, &locale, &locale_len, &commonly_used) == FAILURE) { intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, - "intlcal_get_keyword_values_for_locale: bad arguments", 0 TSRMLS_CC); + "intlcal_get_keyword_values_for_locale: bad arguments", 0); RETURN_FALSE; } @@ -162,7 +162,7 @@ U_CFUNC PHP_FUNCTION(intlcal_get_keyword_values_for_locale) status); if (se == NULL) { intl_error_set(NULL, status, "intlcal_get_keyword_values_for_locale: " - "error calling underlying method", 0 TSRMLS_CC); + "error calling underlying method", 0); RETURN_FALSE; } #else @@ -171,24 +171,24 @@ U_CFUNC PHP_FUNCTION(intlcal_get_keyword_values_for_locale) if (U_FAILURE(status)) { uenum_close(uenum); intl_error_set(NULL, status, "intlcal_get_keyword_values_for_locale: " - "error calling underlying method", 0 TSRMLS_CC); + "error calling underlying method", 0); RETURN_FALSE; } StringEnumeration *se = new BugStringCharEnumeration(uenum); #endif - IntlIterator_from_StringEnumeration(se, return_value TSRMLS_CC); + IntlIterator_from_StringEnumeration(se, return_value); } #endif //ICU 4.2 only U_CFUNC PHP_FUNCTION(intlcal_get_now) { - intl_error_reset(NULL TSRMLS_CC); + intl_error_reset(NULL); if (zend_parse_parameters_none() == FAILURE) { intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, - "intlcal_get_now: bad arguments", 0 TSRMLS_CC); + "intlcal_get_now: bad arguments", 0); RETURN_FALSE; } @@ -197,11 +197,11 @@ U_CFUNC PHP_FUNCTION(intlcal_get_now) U_CFUNC PHP_FUNCTION(intlcal_get_available_locales) { - intl_error_reset(NULL TSRMLS_CC); + intl_error_reset(NULL); if (zend_parse_parameters_none() == FAILURE) { intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, - "intlcal_get_available_locales: bad arguments", 0 TSRMLS_CC); + "intlcal_get_available_locales: bad arguments", 0); RETURN_FALSE; } @@ -223,17 +223,17 @@ static void _php_intlcal_field_uec_ret_in32t_method( char *message; CALENDAR_METHOD_INIT_VARS; - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), + if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Ol", &object, Calendar_ce_ptr, &field) == FAILURE) { spprintf(&message, 0, "%s: bad arguments", method_name); - intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, message, 1 TSRMLS_CC); + intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, message, 1); efree(message); RETURN_FALSE; } if (field < 0 || field >= UCAL_FIELD_COUNT) { spprintf(&message, 0, "%s: invalid field", method_name); - intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, message, 1 TSRMLS_CC); + intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, message, 1); efree(message); RETURN_FALSE; } @@ -257,10 +257,10 @@ U_CFUNC PHP_FUNCTION(intlcal_get_time) { CALENDAR_METHOD_INIT_VARS; - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", + if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O", &object, Calendar_ce_ptr) == FAILURE) { intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, - "intlcal_get_time: bad arguments", 0 TSRMLS_CC); + "intlcal_get_time: bad arguments", 0); RETURN_FALSE; } @@ -278,10 +278,10 @@ U_CFUNC PHP_FUNCTION(intlcal_set_time) double time_arg; CALENDAR_METHOD_INIT_VARS; - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Od", + if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Od", &object, Calendar_ce_ptr, &time_arg) == FAILURE) { intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, - "intlcal_set_time: bad arguments", 0 TSRMLS_CC); + "intlcal_set_time: bad arguments", 0); RETURN_FALSE; } @@ -299,21 +299,21 @@ U_CFUNC PHP_FUNCTION(intlcal_add) amount; CALENDAR_METHOD_INIT_VARS; - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), + if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Oll", &object, Calendar_ce_ptr, &field, &amount) == FAILURE) { intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, - "intlcal_add: bad arguments", 0 TSRMLS_CC); + "intlcal_add: bad arguments", 0); RETURN_FALSE; } if (field < 0 || field >= UCAL_FIELD_COUNT) { intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, - "intlcal_add: invalid field", 0 TSRMLS_CC); + "intlcal_add: invalid field", 0); RETURN_FALSE; } if (amount < INT32_MIN || amount > INT32_MAX) { intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, - "intlcal_add: amount out of bounds", 0 TSRMLS_CC); + "intlcal_add: amount out of bounds", 0); RETURN_FALSE; } @@ -331,10 +331,10 @@ U_CFUNC PHP_FUNCTION(intlcal_set_time_zone) TimeZone *timeZone; CALENDAR_METHOD_INIT_VARS; - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), + if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Oz!", &object, Calendar_ce_ptr, &zv_timezone) == FAILURE) { intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, - "intlcal_set_time_zone: bad arguments", 0 TSRMLS_CC); + "intlcal_set_time_zone: bad arguments", 0); RETURN_FALSE; } @@ -345,7 +345,7 @@ U_CFUNC PHP_FUNCTION(intlcal_set_time_zone) } timeZone = timezone_process_timezone_argument(zv_timezone, - CALENDAR_ERROR_P(co), "intlcal_set_time_zone" TSRMLS_CC); + CALENDAR_ERROR_P(co), "intlcal_set_time_zone"); if (timeZone == NULL) { RETURN_FALSE; } @@ -364,11 +364,11 @@ static void _php_intlcal_before_after( Calendar_object *when_co; CALENDAR_METHOD_INIT_VARS; - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), + if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "OO", &object, Calendar_ce_ptr, &when_object, Calendar_ce_ptr) == FAILURE) { intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, - "intlcal_before/after: bad arguments", 0 TSRMLS_CC); + "intlcal_before/after: bad arguments", 0); RETURN_FALSE; } @@ -377,7 +377,7 @@ static void _php_intlcal_before_after( when_co = Z_INTL_CALENDAR_P(when_object); if (when_co->ucal == NULL) { intl_errors_set(&co->err, U_ILLEGAL_ARGUMENT_ERROR, - "intlcal_before/after: Other IntlCalendar was unconstructed", 0 TSRMLS_CC); + "intlcal_before/after: Other IntlCalendar was unconstructed", 0); RETURN_FALSE; } @@ -410,7 +410,7 @@ U_CFUNC PHP_FUNCTION(intlcal_set) if (ZEND_NUM_ARGS() > (getThis() ? 6 : 7) || zend_get_parameters_array_ex(ZEND_NUM_ARGS(), args) == FAILURE) { intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, - "intlcal_set: too many arguments", 0 TSRMLS_CC); + "intlcal_set: too many arguments", 0); RETURN_FALSE; } if (!getThis()) { @@ -422,11 +422,11 @@ U_CFUNC PHP_FUNCTION(intlcal_set) } if (variant == 4 || - zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), + zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Oll|llll", &object, Calendar_ce_ptr, &arg1, &arg2, &arg3, &arg4, &arg5, &arg6) == FAILURE) { intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, - "intlcal_set: bad arguments", 0 TSRMLS_CC); + "intlcal_set: bad arguments", 0); RETURN_FALSE; } @@ -434,14 +434,14 @@ U_CFUNC PHP_FUNCTION(intlcal_set) if (Z_LVAL(args[i]) < INT32_MIN || Z_LVAL(args[i]) > INT32_MAX) { intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, "intlcal_set: at least one of the arguments has an absolute " - "value that is too large", 0 TSRMLS_CC); + "value that is too large", 0); RETURN_FALSE; } } if (variant == 2 && (arg1 < 0 || arg1 >= UCAL_FIELD_COUNT)) { intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, - "intlcal_set: invalid field", 0 TSRMLS_CC); + "intlcal_set: invalid field", 0); RETURN_FALSE; } @@ -472,37 +472,37 @@ U_CFUNC PHP_FUNCTION(intlcal_roll) if (ZEND_NUM_ARGS() > (getThis() ? 2 :3) || zend_get_parameters_array_ex(ZEND_NUM_ARGS(), args) == FAILURE) { intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, - "intlcal_set: too many arguments", 0 TSRMLS_CC); + "intlcal_set: too many arguments", 0); RETURN_FALSE; } if (!getThis()) { args++; } if (!Z_ISUNDEF(args[1]) && (Z_TYPE(args[1]) == IS_TRUE || Z_TYPE(args[1]) == IS_FALSE)) { - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), + if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Olb", &object, Calendar_ce_ptr, &field, &bool_variant_val) == FAILURE) { intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, - "intlcal_roll: bad arguments", 0 TSRMLS_CC); + "intlcal_roll: bad arguments", 0); RETURN_FALSE; } bool_variant_val = Z_TYPE(args[1]) == IS_TRUE? 1 : 0; - } else if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), + } else if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Oll", &object, Calendar_ce_ptr, &field, &value) == FAILURE) { intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, - "intlcal_roll: bad arguments", 0 TSRMLS_CC); + "intlcal_roll: bad arguments", 0); RETURN_FALSE; } if (field < 0 || field >= UCAL_FIELD_COUNT) { intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, - "intlcal_roll: invalid field", 0 TSRMLS_CC); + "intlcal_roll: invalid field", 0); RETURN_FALSE; } if (bool_variant_val == (zend_bool)-1 && (value < INT32_MIN || value > INT32_MAX)) { intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, - "intlcal_roll: value out of bounds", 0 TSRMLS_CC); + "intlcal_roll: value out of bounds", 0); RETURN_FALSE; } @@ -531,7 +531,7 @@ U_CFUNC PHP_FUNCTION(intlcal_clear) if (ZEND_NUM_ARGS() > (getThis() ? 1 : 2) || zend_get_parameters_array_ex(ZEND_NUM_ARGS(), args) == FAILURE) { intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, - "intlcal_clear: too many arguments", 0 TSRMLS_CC); + "intlcal_clear: too many arguments", 0); RETURN_FALSE; } if (!getThis()) { @@ -539,21 +539,21 @@ U_CFUNC PHP_FUNCTION(intlcal_clear) } if (Z_ISUNDEF(args[0]) || Z_TYPE(args[0]) == IS_NULL) { zval *dummy; /* we know it's null */ - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, + if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O|z", &object, Calendar_ce_ptr, &dummy) == FAILURE) { intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, - "intlcal_clear: bad arguments", 0 TSRMLS_CC); + "intlcal_clear: bad arguments", 0); RETURN_FALSE; } variant = 0; - } else if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, + } else if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Ol", &object, Calendar_ce_ptr, &field) == FAILURE) { intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, - "intlcal_clear: bad arguments", 0 TSRMLS_CC); + "intlcal_clear: bad arguments", 0); RETURN_FALSE; } else if (field < 0 || field >= UCAL_FIELD_COUNT) { intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, - "intlcal_clear: invalid field", 0 TSRMLS_CC); + "intlcal_clear: invalid field", 0); RETURN_FALSE; } else { variant = 1; @@ -576,16 +576,16 @@ U_CFUNC PHP_FUNCTION(intlcal_field_difference) double when; CALENDAR_METHOD_INIT_VARS; - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), + if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Odl", &object, Calendar_ce_ptr, &when, &field) == FAILURE) { intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, - "intlcal_field_difference: bad arguments", 0 TSRMLS_CC); + "intlcal_field_difference: bad arguments", 0); RETURN_FALSE; } if (field < 0 || field >= UCAL_FIELD_COUNT) { intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, - "intlcal_field_difference: invalid field", 0 TSRMLS_CC); + "intlcal_field_difference: invalid field", 0); RETURN_FALSE; } @@ -617,16 +617,16 @@ U_CFUNC PHP_FUNCTION(intlcal_get_day_of_week_type) zend_ulong dow; CALENDAR_METHOD_INIT_VARS; - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), + if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Ol", &object, Calendar_ce_ptr, &dow) == FAILURE) { intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, - "intlcal_get_day_of_week_type: bad arguments", 0 TSRMLS_CC); + "intlcal_get_day_of_week_type: bad arguments", 0); RETURN_FALSE; } if (dow < UCAL_SUNDAY || dow > UCAL_SATURDAY) { intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, - "intlcal_get_day_of_week_type: invalid day of week", 0 TSRMLS_CC); + "intlcal_get_day_of_week_type: invalid day of week", 0); RETURN_FALSE; } @@ -645,10 +645,10 @@ U_CFUNC PHP_FUNCTION(intlcal_get_first_day_of_week) { CALENDAR_METHOD_INIT_VARS; - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), + if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O", &object, Calendar_ce_ptr) == FAILURE) { intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, - "intlcal_get_first_day_of_week: bad arguments", 0 TSRMLS_CC); + "intlcal_get_first_day_of_week: bad arguments", 0); RETURN_FALSE; } @@ -670,17 +670,17 @@ static void _php_intlcal_field_ret_in32t_method( char *message; CALENDAR_METHOD_INIT_VARS; - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), + if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Ol", &object, Calendar_ce_ptr, &field) == FAILURE) { spprintf(&message, 0, "%s: bad arguments", method_name); - intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, message, 1 TSRMLS_CC); + intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, message, 1); efree(message); RETURN_FALSE; } if (field < 0 || field >= UCAL_FIELD_COUNT) { spprintf(&message, 0, "%s: invalid field", method_name); - intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, message, 1 TSRMLS_CC); + intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, message, 1); efree(message); RETURN_FALSE; } @@ -710,16 +710,16 @@ U_CFUNC PHP_FUNCTION(intlcal_get_locale) zend_long locale_type; CALENDAR_METHOD_INIT_VARS; - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), + if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Ol", &object, Calendar_ce_ptr, &locale_type) == FAILURE) { intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, - "intlcal_get_locale: bad arguments", 0 TSRMLS_CC); + "intlcal_get_locale: bad arguments", 0); RETURN_FALSE; } if (locale_type != ULOC_ACTUAL_LOCALE && locale_type != ULOC_VALID_LOCALE) { intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, - "intlcal_get_locale: invalid locale type", 0 TSRMLS_CC); + "intlcal_get_locale: invalid locale type", 0); RETURN_FALSE; } @@ -743,10 +743,10 @@ U_CFUNC PHP_FUNCTION(intlcal_get_minimal_days_in_first_week) { CALENDAR_METHOD_INIT_VARS; - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), + if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O", &object, Calendar_ce_ptr) == FAILURE) { intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, - "intlcal_get_minimal_days_in_first_week: bad arguments", 0 TSRMLS_CC); + "intlcal_get_minimal_days_in_first_week: bad arguments", 0); RETURN_FALSE; } @@ -769,10 +769,10 @@ U_CFUNC PHP_FUNCTION(intlcal_get_time_zone) { CALENDAR_METHOD_INIT_VARS; - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), + if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O", &object, Calendar_ce_ptr) == FAILURE) { intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, - "intlcal_get_time_zone: bad arguments", 0 TSRMLS_CC); + "intlcal_get_time_zone: bad arguments", 0); RETURN_FALSE; } @@ -781,21 +781,21 @@ U_CFUNC PHP_FUNCTION(intlcal_get_time_zone) TimeZone *tz = co->ucal->getTimeZone().clone(); if (tz == NULL) { intl_errors_set(CALENDAR_ERROR_P(co), U_MEMORY_ALLOCATION_ERROR, - "intlcal_get_time_zone: could not clone TimeZone", 0 TSRMLS_CC); + "intlcal_get_time_zone: could not clone TimeZone", 0); RETURN_FALSE; } - timezone_object_construct(tz, return_value, 1 TSRMLS_CC); + timezone_object_construct(tz, return_value, 1); } U_CFUNC PHP_FUNCTION(intlcal_get_type) { CALENDAR_METHOD_INIT_VARS; - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), + if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O", &object, Calendar_ce_ptr) == FAILURE) { intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, - "intlcal_get_type: bad arguments", 0 TSRMLS_CC); + "intlcal_get_type: bad arguments", 0); RETURN_FALSE; } @@ -810,16 +810,16 @@ U_CFUNC PHP_FUNCTION(intlcal_get_weekend_transition) zend_long dow; CALENDAR_METHOD_INIT_VARS; - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), + if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Ol", &object, Calendar_ce_ptr, &dow) == FAILURE) { intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, - "intlcal_get_weekend_transition: bad arguments", 0 TSRMLS_CC); + "intlcal_get_weekend_transition: bad arguments", 0); RETURN_FALSE; } if (dow < UCAL_SUNDAY || dow > UCAL_SATURDAY) { intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, - "intlcal_get_weekend_transition: invalid day of week", 0 TSRMLS_CC); + "intlcal_get_weekend_transition: invalid day of week", 0); RETURN_FALSE; } @@ -838,10 +838,10 @@ U_CFUNC PHP_FUNCTION(intlcal_in_daylight_time) { CALENDAR_METHOD_INIT_VARS; - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), + if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O", &object, Calendar_ce_ptr) == FAILURE) { intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, - "intlcal_in_daylight_time: bad arguments", 0 TSRMLS_CC); + "intlcal_in_daylight_time: bad arguments", 0); RETURN_FALSE; } @@ -860,18 +860,18 @@ U_CFUNC PHP_FUNCTION(intlcal_is_equivalent_to) Calendar_object *other_co; CALENDAR_METHOD_INIT_VARS; - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), + if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "OO", &object, Calendar_ce_ptr, &other_object, Calendar_ce_ptr) == FAILURE) { intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, - "intlcal_is_equivalent_to: bad arguments", 0 TSRMLS_CC); + "intlcal_is_equivalent_to: bad arguments", 0); RETURN_FALSE; } other_co = Z_INTL_CALENDAR_P(other_object); if (other_co->ucal == NULL) { intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, "intlcal_is_equivalent_to:" - " Other IntlCalendar is unconstructed", 0 TSRMLS_CC); + " Other IntlCalendar is unconstructed", 0); RETURN_FALSE; } @@ -884,10 +884,10 @@ U_CFUNC PHP_FUNCTION(intlcal_is_lenient) { CALENDAR_METHOD_INIT_VARS; - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), + if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O", &object, Calendar_ce_ptr) == FAILURE) { intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, - "intlcal_is_lenient: bad arguments", 0 TSRMLS_CC); + "intlcal_is_lenient: bad arguments", 0); RETURN_FALSE; } @@ -901,16 +901,16 @@ U_CFUNC PHP_FUNCTION(intlcal_is_set) zend_long field; CALENDAR_METHOD_INIT_VARS; - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), + if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Ol", &object, Calendar_ce_ptr, &field) == FAILURE) { intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, - "intlcal_is_set: bad arguments", 0 TSRMLS_CC); + "intlcal_is_set: bad arguments", 0); RETURN_FALSE; } if (field < 0 || field >= UCAL_FIELD_COUNT) { intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, - "intlcal_is_set: invalid field", 0 TSRMLS_CC); + "intlcal_is_set: invalid field", 0); RETURN_FALSE; } @@ -927,13 +927,13 @@ U_CFUNC PHP_FUNCTION(intlcal_is_weekend) CALENDAR_METHOD_INIT_VARS; if (zend_parse_method_parameters_ex(ZEND_PARSE_PARAMS_QUIET, - ZEND_NUM_ARGS() TSRMLS_CC, getThis(), + ZEND_NUM_ARGS(), getThis(), "O|z!", &object, Calendar_ce_ptr, &rawDate) == FAILURE || (rawDate != NULL && - zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), + zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O|d", &object, Calendar_ce_ptr, &date) == FAILURE)) { intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, - "intlcal_is_weekend: bad arguments", 0 TSRMLS_CC); + "intlcal_is_weekend: bad arguments", 0); RETURN_FALSE; } @@ -956,16 +956,16 @@ U_CFUNC PHP_FUNCTION(intlcal_set_first_day_of_week) zend_long dow; CALENDAR_METHOD_INIT_VARS; - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), + if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Ol", &object, Calendar_ce_ptr, &dow) == FAILURE) { intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, - "intlcal_set_first_day_of_week: bad arguments", 0 TSRMLS_CC); + "intlcal_set_first_day_of_week: bad arguments", 0); RETURN_FALSE; } if (dow < UCAL_SUNDAY || dow > UCAL_SATURDAY) { intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, - "intlcal_set_first_day_of_week: invalid day of week", 0 TSRMLS_CC); + "intlcal_set_first_day_of_week: invalid day of week", 0); RETURN_FALSE; } @@ -981,10 +981,10 @@ U_CFUNC PHP_FUNCTION(intlcal_set_lenient) zend_bool is_lenient; CALENDAR_METHOD_INIT_VARS; - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), + if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Ob", &object, Calendar_ce_ptr, &is_lenient) == FAILURE) { intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, - "intlcal_set_lenient: bad arguments", 0 TSRMLS_CC); + "intlcal_set_lenient: bad arguments", 0); RETURN_FALSE; } @@ -1000,17 +1000,17 @@ U_CFUNC PHP_FUNCTION(intlcal_set_minimal_days_in_first_week) zend_long num_days; CALENDAR_METHOD_INIT_VARS; - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), + if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Ol", &object, Calendar_ce_ptr, &num_days) == FAILURE) { intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, - "intlcal_set_minimal_days_in_first_week: bad arguments", 0 TSRMLS_CC); + "intlcal_set_minimal_days_in_first_week: bad arguments", 0); RETURN_FALSE; } if (num_days < 1 || num_days > 7) { intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, "intlcal_set_minimal_days_in_first_week: invalid number of days; " - "must be between 1 and 7", 0 TSRMLS_CC); + "must be between 1 and 7", 0); RETURN_FALSE; } @@ -1027,11 +1027,11 @@ U_CFUNC PHP_FUNCTION(intlcal_equals) Calendar_object *other_co; CALENDAR_METHOD_INIT_VARS; - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), + if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "OO", &object, Calendar_ce_ptr, &other_object, Calendar_ce_ptr) == FAILURE) { intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, - "intlcal_equals: bad arguments", 0 TSRMLS_CC); + "intlcal_equals: bad arguments", 0); RETURN_FALSE; } @@ -1039,7 +1039,7 @@ U_CFUNC PHP_FUNCTION(intlcal_equals) other_co = Z_INTL_CALENDAR_P(other_object); if (other_co->ucal == NULL) { intl_errors_set(&co->err, U_ILLEGAL_ARGUMENT_ERROR, - "intlcal_equals: The second IntlCalendar is unconstructed", 0 TSRMLS_CC); + "intlcal_equals: The second IntlCalendar is unconstructed", 0); RETURN_FALSE; } @@ -1055,10 +1055,10 @@ U_CFUNC PHP_FUNCTION(intlcal_get_repeated_wall_time_option) { CALENDAR_METHOD_INIT_VARS; - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), + if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O", &object, Calendar_ce_ptr) == FAILURE) { intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, - "intlcal_get_repeated_wall_time_option: bad arguments", 0 TSRMLS_CC); + "intlcal_get_repeated_wall_time_option: bad arguments", 0); RETURN_FALSE; } @@ -1071,10 +1071,10 @@ U_CFUNC PHP_FUNCTION(intlcal_get_skipped_wall_time_option) { CALENDAR_METHOD_INIT_VARS; - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), + if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O", &object, Calendar_ce_ptr) == FAILURE) { intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, - "intlcal_get_skipped_wall_time_option: bad arguments", 0 TSRMLS_CC); + "intlcal_get_skipped_wall_time_option: bad arguments", 0); RETURN_FALSE; } @@ -1088,16 +1088,16 @@ U_CFUNC PHP_FUNCTION(intlcal_set_repeated_wall_time_option) zend_long option; CALENDAR_METHOD_INIT_VARS; - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), + if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Ol", &object, Calendar_ce_ptr, &option) == FAILURE) { intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, - "intlcal_set_repeated_wall_time_option: bad arguments", 0 TSRMLS_CC); + "intlcal_set_repeated_wall_time_option: bad arguments", 0); RETURN_FALSE; } if (option != UCAL_WALLTIME_FIRST && option != UCAL_WALLTIME_LAST) { intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, - "intlcal_set_repeated_wall_time_option: invalid option", 0 TSRMLS_CC); + "intlcal_set_repeated_wall_time_option: invalid option", 0); RETURN_FALSE; } @@ -1113,17 +1113,17 @@ U_CFUNC PHP_FUNCTION(intlcal_set_skipped_wall_time_option) zend_long option; CALENDAR_METHOD_INIT_VARS; - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), + if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Ol", &object, Calendar_ce_ptr, &option) == FAILURE) { intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, - "intlcal_set_skipped_wall_time_option: bad arguments", 0 TSRMLS_CC); + "intlcal_set_skipped_wall_time_option: bad arguments", 0); RETURN_FALSE; } if (option != UCAL_WALLTIME_FIRST && option != UCAL_WALLTIME_LAST && option != UCAL_WALLTIME_NEXT_VALID) { intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, - "intlcal_set_skipped_wall_time_option: invalid option", 0 TSRMLS_CC); + "intlcal_set_skipped_wall_time_option: invalid option", 0); RETURN_FALSE; } @@ -1148,21 +1148,21 @@ U_CFUNC PHP_FUNCTION(intlcal_from_date_time) TimeZone *timeZone; UErrorCode status = U_ZERO_ERROR; Calendar *cal; - intl_error_reset(NULL TSRMLS_CC); + intl_error_reset(NULL); - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z|s!", + if (zend_parse_parameters(ZEND_NUM_ARGS(), "z|s!", &zv_arg, &locale_str, &locale_str_len) == FAILURE) { intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, - "intlcal_from_date_time: bad arguments", 0 TSRMLS_CC); + "intlcal_from_date_time: bad arguments", 0); RETURN_NULL(); } if (!(Z_TYPE_P(zv_arg) == IS_OBJECT && instanceof_function( - Z_OBJCE_P(zv_arg), php_date_get_date_ce() TSRMLS_CC))) { + Z_OBJCE_P(zv_arg), php_date_get_date_ce()))) { object_init_ex(&zv_tmp, php_date_get_date_ce()); zend_call_method_with_1_params(&zv_tmp, NULL, NULL, "__construct", NULL, zv_arg); if (EG(exception)) { - zend_object_store_ctor_failed(Z_OBJ(zv_tmp) TSRMLS_CC); + zend_object_store_ctor_failed(Z_OBJ(zv_tmp)); goto error; } zv_datetime = &zv_tmp; @@ -1174,7 +1174,7 @@ U_CFUNC PHP_FUNCTION(intlcal_from_date_time) if (!datetime->time) { intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, "intlcal_from_date_time: DateTime object is unconstructed", - 0 TSRMLS_CC); + 0); goto error; } @@ -1182,7 +1182,7 @@ U_CFUNC PHP_FUNCTION(intlcal_from_date_time) if (Z_TYPE(zv_timestamp) != IS_LONG) { intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, "intlcal_from_date_time: bad DateTime; call to " - "DateTime::getTimestamp() failed", 0 TSRMLS_CC); + "DateTime::getTimestamp() failed", 0); zval_ptr_dtor(&zv_timestamp); goto error; } @@ -1191,14 +1191,14 @@ U_CFUNC PHP_FUNCTION(intlcal_from_date_time) timeZone = TimeZone::getGMT()->clone(); } else { timeZone = timezone_convert_datetimezone(datetime->time->zone_type, - datetime, 1, NULL, "intlcal_from_date_time" TSRMLS_CC); + datetime, 1, NULL, "intlcal_from_date_time"); if (timeZone == NULL) { goto error; } } if (!locale_str) { - locale_str = const_cast<char*>(intl_locale_get_default(TSRMLS_C)); + locale_str = const_cast<char*>(intl_locale_get_default()); } cal = Calendar::createInstance(timeZone, @@ -1206,7 +1206,7 @@ U_CFUNC PHP_FUNCTION(intlcal_from_date_time) if (cal == NULL) { delete timeZone; intl_error_set(NULL, status, "intlcal_from_date_time: " - "error creating ICU Calendar object", 0 TSRMLS_CC); + "error creating ICU Calendar object", 0); goto error; } cal->setTime(((UDate)Z_LVAL(zv_timestamp)) * 1000., status); @@ -1214,11 +1214,11 @@ U_CFUNC PHP_FUNCTION(intlcal_from_date_time) /* time zone was adopted by cal; should not be deleted here */ delete cal; intl_error_set(NULL, status, "intlcal_from_date_time: " - "error creating ICU Calendar::setTime()", 0 TSRMLS_CC); + "error creating ICU Calendar::setTime()", 0); goto error; } - calendar_object_create(return_value, cal TSRMLS_CC); + calendar_object_create(return_value, cal); error: if (zv_datetime && zv_datetime != zv_arg) { @@ -1231,10 +1231,10 @@ U_CFUNC PHP_FUNCTION(intlcal_to_date_time) zval retval; CALENDAR_METHOD_INIT_VARS; - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", + if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O", &object, Calendar_ce_ptr) == FAILURE) { intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, - "intlcal_to_date_time: bad arguments", 0 TSRMLS_CC); + "intlcal_to_date_time: bad arguments", 0); RETURN_FALSE; } @@ -1253,7 +1253,7 @@ U_CFUNC PHP_FUNCTION(intlcal_to_date_time) if (date > (double)U_INT64_MAX || date < (double)U_INT64_MIN) { intl_errors_set(CALENDAR_ERROR_P(co), U_ILLEGAL_ARGUMENT_ERROR, "intlcal_to_date_time: The calendar date is out of the " - "range for a 64-bit integer", 0 TSRMLS_CC); + "range for a 64-bit integer", 0); RETURN_FALSE; } @@ -1266,7 +1266,7 @@ U_CFUNC PHP_FUNCTION(intlcal_to_date_time) /* Now get the time zone */ const TimeZone& tz = co->ucal->getTimeZone(); zval *timezone_zval = timezone_convert_to_datetimezone( - &tz, CALENDAR_ERROR_P(co), "intlcal_to_date_time", &tmp TSRMLS_CC); + &tz, CALENDAR_ERROR_P(co), "intlcal_to_date_time", &tmp); if (timezone_zval == NULL) { RETURN_FALSE; } @@ -1279,8 +1279,8 @@ U_CFUNC PHP_FUNCTION(intlcal_to_date_time) if (EG(exception)) { intl_errors_set(CALENDAR_ERROR_P(co), U_ILLEGAL_ARGUMENT_ERROR, "intlcal_to_date_time: DateTime constructor has thrown exception", - 1 TSRMLS_CC); - zend_object_store_ctor_failed(Z_OBJ_P(return_value) TSRMLS_CC); + 1); + zend_object_store_ctor_failed(Z_OBJ_P(return_value)); zval_ptr_dtor(return_value); zval_ptr_dtor(&ts_zval); @@ -1295,7 +1295,7 @@ U_CFUNC PHP_FUNCTION(intlcal_to_date_time) if (Z_ISUNDEF(retval) || Z_TYPE(retval) == IS_FALSE) { intl_errors_set(CALENDAR_ERROR_P(co), U_ILLEGAL_ARGUMENT_ERROR, "intlcal_to_date_time: call to DateTime::setTimeZone has failed", - 1 TSRMLS_CC); + 1); zval_ptr_dtor(return_value); RETVAL_FALSE; goto error; @@ -1310,10 +1310,10 @@ U_CFUNC PHP_FUNCTION(intlcal_get_error_code) { CALENDAR_METHOD_INIT_VARS; - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", + if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O", &object, Calendar_ce_ptr) == FAILURE) { intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, - "intlcal_get_error_code: bad arguments", 0 TSRMLS_CC); + "intlcal_get_error_code: bad arguments", 0); RETURN_FALSE; } @@ -1330,10 +1330,10 @@ U_CFUNC PHP_FUNCTION(intlcal_get_error_message) zend_string* message = NULL; CALENDAR_METHOD_INIT_VARS; - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", + if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O", &object, Calendar_ce_ptr) == FAILURE) { intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, - "intlcal_get_error_message: bad arguments", 0 TSRMLS_CC ); + "intlcal_get_error_message: bad arguments", 0 ); RETURN_FALSE; } @@ -1344,6 +1344,6 @@ U_CFUNC PHP_FUNCTION(intlcal_get_error_message) RETURN_FALSE; /* Return last error message. */ - message = intl_error_get_message(CALENDAR_ERROR_P(co) TSRMLS_CC); + message = intl_error_get_message(CALENDAR_ERROR_P(co)); RETURN_STR(message); } diff --git a/ext/intl/calendar/gregoriancalendar_methods.cpp b/ext/intl/calendar/gregoriancalendar_methods.cpp index b0c8a964f6..8484f09629 100644 --- a/ext/intl/calendar/gregoriancalendar_methods.cpp +++ b/ext/intl/calendar/gregoriancalendar_methods.cpp @@ -46,13 +46,13 @@ static void _php_intlgregcal_constructor_body(INTERNAL_FUNCTION_PARAMETERS) zend_long largs[6]; UErrorCode status = U_ZERO_ERROR; int variant; - intl_error_reset(NULL TSRMLS_CC); + intl_error_reset(NULL); // parameter number validation / variant determination if (ZEND_NUM_ARGS() > 6 || zend_get_parameters_array_ex(ZEND_NUM_ARGS(), args) == FAILURE) { intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, - "intlgregcal_create_instance: too many arguments", 0 TSRMLS_CC); + "intlgregcal_create_instance: too many arguments", 0); Z_OBJ_P(return_value) = NULL; return; } @@ -62,26 +62,26 @@ static void _php_intlgregcal_constructor_body(INTERNAL_FUNCTION_PARAMETERS) if (variant == 4) { intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, "intlgregcal_create_instance: no variant with 4 arguments " - "(excluding trailing NULLs)", 0 TSRMLS_CC); + "(excluding trailing NULLs)", 0); Z_OBJ_P(return_value) = NULL; return; } // argument parsing if (variant <= 2) { - if (zend_parse_parameters(MIN(ZEND_NUM_ARGS(), 2) TSRMLS_CC, + if (zend_parse_parameters(MIN(ZEND_NUM_ARGS(), 2), "|z!s!", &tz_object, &locale, &locale_len) == FAILURE) { intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, - "intlgregcal_create_instance: bad arguments", 0 TSRMLS_CC); + "intlgregcal_create_instance: bad arguments", 0); Z_OBJ_P(return_value) = NULL; return; } } - if (variant > 2 && zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, + if (variant > 2 && zend_parse_parameters(ZEND_NUM_ARGS(), "lll|lll", &largs[0], &largs[1], &largs[2], &largs[3], &largs[4], &largs[5]) == FAILURE) { intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, - "intlgregcal_create_instance: bad arguments", 0 TSRMLS_CC); + "intlgregcal_create_instance: bad arguments", 0); Z_OBJ_P(return_value) = NULL; return; } @@ -92,20 +92,20 @@ static void _php_intlgregcal_constructor_body(INTERNAL_FUNCTION_PARAMETERS) if (variant <= 2) { // From timezone and locale (0 to 2 arguments) TimeZone *tz = timezone_process_timezone_argument(tz_object, NULL, - "intlgregcal_create_instance" TSRMLS_CC); + "intlgregcal_create_instance"); if (tz == NULL) { Z_OBJ_P(return_value) = NULL; return; } if (!locale) { - locale = const_cast<char*>(intl_locale_get_default(TSRMLS_C)); + locale = const_cast<char*>(intl_locale_get_default()); } gcal = new GregorianCalendar(tz, Locale::createFromName(locale), status); if (U_FAILURE(status)) { intl_error_set(NULL, status, "intlgregcal_create_instance: error " - "creating ICU GregorianCalendar from time zone and locale", 0 TSRMLS_CC); + "creating ICU GregorianCalendar from time zone and locale", 0); if (gcal) { delete gcal; } @@ -119,7 +119,7 @@ static void _php_intlgregcal_constructor_body(INTERNAL_FUNCTION_PARAMETERS) if (largs[i] < INT32_MIN || largs[i] > INT32_MAX) { intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, "intlgregcal_create_instance: at least one of the arguments" - " has an absolute value that is too large", 0 TSRMLS_CC); + " has an absolute value that is too large", 0); Z_OBJ_P(return_value) = NULL; return; } @@ -138,7 +138,7 @@ static void _php_intlgregcal_constructor_body(INTERNAL_FUNCTION_PARAMETERS) } if (U_FAILURE(status)) { intl_error_set(NULL, status, "intlgregcal_create_instance: error " - "creating ICU GregorianCalendar from date", 0 TSRMLS_CC); + "creating ICU GregorianCalendar from date", 0); if (gcal) { delete gcal; } @@ -146,7 +146,7 @@ static void _php_intlgregcal_constructor_body(INTERNAL_FUNCTION_PARAMETERS) return; } - timelib_tzinfo *tzinfo = get_timezone_info(TSRMLS_C); + timelib_tzinfo *tzinfo = get_timezone_info(); #if U_ICU_VERSION_MAJOR_NUM * 10 + U_ICU_VERSION_MINOR_NUM >= 42 UnicodeString tzstr = UnicodeString::fromUTF8(StringPiece(tzinfo->name)); #else @@ -157,7 +157,7 @@ static void _php_intlgregcal_constructor_body(INTERNAL_FUNCTION_PARAMETERS) intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, "intlgregcal_create_instance: could not create UTF-8 string " "from PHP's default timezone name (see date_default_timezone_get())", - 0 TSRMLS_CC); + 0); delete gcal; Z_OBJ_P(return_value) = NULL; return; @@ -174,7 +174,7 @@ static void _php_intlgregcal_constructor_body(INTERNAL_FUNCTION_PARAMETERS) U_CFUNC PHP_FUNCTION(intlgregcal_create_instance) { zval orig; - intl_error_reset(NULL TSRMLS_CC); + intl_error_reset(NULL); object_init_ex(return_value, GregorianCalendar_ce_ptr); ZVAL_COPY_VALUE(&orig, return_value); @@ -190,14 +190,14 @@ U_CFUNC PHP_FUNCTION(intlgregcal_create_instance) U_CFUNC PHP_METHOD(IntlGregorianCalendar, __construct) { zval orig_this = *getThis(); - intl_error_reset(NULL TSRMLS_CC); + intl_error_reset(NULL); return_value = getThis(); //changes this to IS_NULL (without first destroying) if there's an error _php_intlgregcal_constructor_body(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(); } @@ -208,10 +208,10 @@ U_CFUNC PHP_FUNCTION(intlgregcal_set_gregorian_change) double date; CALENDAR_METHOD_INIT_VARS; - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), + if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Od", &object, GregorianCalendar_ce_ptr, &date) == FAILURE) { intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, - "intlgregcal_set_gregorian_change: bad arguments", 0 TSRMLS_CC); + "intlgregcal_set_gregorian_change: bad arguments", 0); RETURN_FALSE; } @@ -228,10 +228,10 @@ U_CFUNC PHP_FUNCTION(intlgregcal_get_gregorian_change) { CALENDAR_METHOD_INIT_VARS; - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), + if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O", &object, GregorianCalendar_ce_ptr) == FAILURE) { intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, - "intlgregcal_get_gregorian_change: bad arguments", 0 TSRMLS_CC); + "intlgregcal_get_gregorian_change: bad arguments", 0); RETURN_FALSE; } @@ -245,16 +245,16 @@ U_CFUNC PHP_FUNCTION(intlgregcal_is_leap_year) zend_long year; CALENDAR_METHOD_INIT_VARS; - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), + if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Ol", &object, GregorianCalendar_ce_ptr, &year) == FAILURE) { intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, - "intlgregcal_is_leap_year: bad arguments", 0 TSRMLS_CC); + "intlgregcal_is_leap_year: bad arguments", 0); RETURN_FALSE; } if (year < INT32_MIN || year > INT32_MAX) { intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, - "intlgregcal_is_leap_year: year out of bounds", 0 TSRMLS_CC); + "intlgregcal_is_leap_year: year out of bounds", 0); RETURN_FALSE; } 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 ); diff --git a/ext/intl/common/common_date.cpp b/ext/intl/common/common_date.cpp index 23dc342080..326e8c01c9 100644 --- a/ext/intl/common/common_date.cpp +++ b/ext/intl/common/common_date.cpp @@ -39,7 +39,7 @@ U_CFUNC TimeZone *timezone_convert_datetimezone(int type, void *object, int is_datetime, intl_error *outside_error, - const char *func TSRMLS_DC) + const char *func) { char *id = NULL, offset_id[] = "GMT+00:00"; @@ -66,7 +66,7 @@ U_CFUNC TimeZone *timezone_convert_datetimezone(int type, spprintf(&message, 0, "%s: object has an time zone offset " "that's too large", func); intl_errors_set(outside_error, U_ILLEGAL_ARGUMENT_ERROR, - message, 1 TSRMLS_CC); + message, 1); efree(message); return NULL; } @@ -97,7 +97,7 @@ U_CFUNC TimeZone *timezone_convert_datetimezone(int type, spprintf(&message, 0, "%s: time zone id '%s' " "extracted from ext/date DateTimeZone not recognized", func, id); intl_errors_set(outside_error, U_ILLEGAL_ARGUMENT_ERROR, - message, 1 TSRMLS_CC); + message, 1); efree(message); delete timeZone; return NULL; @@ -107,7 +107,7 @@ U_CFUNC TimeZone *timezone_convert_datetimezone(int type, /* }}} */ U_CFUNC int intl_datetime_decompose(zval *z, double *millis, TimeZone **tz, - intl_error *err, const char *func TSRMLS_DC) + intl_error *err, const char *func) { zval retval; zval zfuncname; @@ -126,12 +126,12 @@ U_CFUNC int intl_datetime_decompose(zval *z, double *millis, TimeZone **tz, if (millis) { ZVAL_STRING(&zfuncname, "getTimestamp"); - if (call_user_function(NULL, z, &zfuncname, &retval, 0, NULL TSRMLS_CC) + if (call_user_function(NULL, z, &zfuncname, &retval, 0, NULL) != SUCCESS || Z_TYPE(retval) != IS_LONG) { spprintf(&message, 0, "%s: error calling ::getTimeStamp() on the " "object", func); intl_errors_set(err, U_INTERNAL_PROGRAM_ERROR, - message, 1 TSRMLS_CC); + message, 1); efree(message); zval_ptr_dtor(&zfuncname); return FAILURE; @@ -148,7 +148,7 @@ U_CFUNC int intl_datetime_decompose(zval *z, double *millis, TimeZone **tz, spprintf(&message, 0, "%s: the DateTime object is not properly " "initialized", func); intl_errors_set(err, U_ILLEGAL_ARGUMENT_ERROR, - message, 1 TSRMLS_CC); + message, 1); efree(message); return FAILURE; } @@ -156,12 +156,12 @@ U_CFUNC int intl_datetime_decompose(zval *z, double *millis, TimeZone **tz, *tz = TimeZone::getGMT()->clone(); } else { *tz = timezone_convert_datetimezone(datetime->time->zone_type, - datetime, 1, NULL, func TSRMLS_CC); + datetime, 1, NULL, func); if (*tz == NULL) { spprintf(&message, 0, "%s: could not convert DateTime's " "time zone", func); intl_errors_set(err, U_ILLEGAL_ARGUMENT_ERROR, - message, 1 TSRMLS_CC); + message, 1); efree(message); return FAILURE; } @@ -171,7 +171,7 @@ U_CFUNC int intl_datetime_decompose(zval *z, double *millis, TimeZone **tz, return SUCCESS; } -U_CFUNC double intl_zval_to_millis(zval *z, intl_error *err, const char *func TSRMLS_DC) +U_CFUNC double intl_zval_to_millis(zval *z, intl_error *err, const char *func) { double rv = NAN; zend_long lv; @@ -194,7 +194,7 @@ U_CFUNC double intl_zval_to_millis(zval *z, intl_error *err, const char *func TS "which would be required for it to be a valid date", func, Z_STRVAL_P(z)); intl_errors_set(err, U_ILLEGAL_ARGUMENT_ERROR, - message, 1 TSRMLS_CC); + message, 1); efree(message); } break; @@ -205,15 +205,15 @@ U_CFUNC double intl_zval_to_millis(zval *z, intl_error *err, const char *func TS rv = U_MILLIS_PER_SECOND * Z_DVAL_P(z); break; case IS_OBJECT: - if (instanceof_function(Z_OBJCE_P(z), php_date_get_date_ce() TSRMLS_CC)) { - intl_datetime_decompose(z, &rv, NULL, err, func TSRMLS_CC); - } else if (instanceof_function(Z_OBJCE_P(z), Calendar_ce_ptr TSRMLS_CC)) { + if (instanceof_function(Z_OBJCE_P(z), php_date_get_date_ce())) { + intl_datetime_decompose(z, &rv, NULL, err, func); + } else if (instanceof_function(Z_OBJCE_P(z), Calendar_ce_ptr)) { Calendar_object *co = Z_INTL_CALENDAR_P(z); if (co->ucal == NULL) { spprintf(&message, 0, "%s: IntlCalendar object is not properly " "constructed", func); intl_errors_set(err, U_ILLEGAL_ARGUMENT_ERROR, - message, 1 TSRMLS_CC); + message, 1); efree(message); } else { UErrorCode status = UErrorCode(); @@ -221,7 +221,7 @@ U_CFUNC double intl_zval_to_millis(zval *z, intl_error *err, const char *func TS if (U_FAILURE(status)) { spprintf(&message, 0, "%s: call to internal " "Calendar::getTime() has failed", func); - intl_errors_set(err, status, message, 1 TSRMLS_CC); + intl_errors_set(err, status, message, 1); efree(message); } } @@ -230,14 +230,14 @@ U_CFUNC double intl_zval_to_millis(zval *z, intl_error *err, const char *func TS spprintf(&message, 0, "%s: invalid object type for date/time " "(only IntlCalendar and DateTime permitted)", func); intl_errors_set(err, U_ILLEGAL_ARGUMENT_ERROR, - message, 1 TSRMLS_CC); + message, 1); efree(message); } break; default: spprintf(&message, 0, "%s: invalid PHP type for date", func); intl_errors_set(err, U_ILLEGAL_ARGUMENT_ERROR, - message, 1 TSRMLS_CC); + message, 1); efree(message); break; } diff --git a/ext/intl/common/common_date.h b/ext/intl/common/common_date.h index e8ab66f40d..d6b7c20719 100644 --- a/ext/intl/common/common_date.h +++ b/ext/intl/common/common_date.h @@ -28,13 +28,13 @@ U_CDECL_END #include <unicode/timezone.h> -U_CFUNC TimeZone *timezone_convert_datetimezone(int type, void *object, int is_datetime, intl_error *outside_error, const char *func TSRMLS_DC); +U_CFUNC TimeZone *timezone_convert_datetimezone(int type, void *object, int is_datetime, intl_error *outside_error, const char *func); U_CFUNC int intl_datetime_decompose(zval *z, double *millis, TimeZone **tz, - intl_error *err, const char *func TSRMLS_DC); + intl_error *err, const char *func); #endif -U_CFUNC double intl_zval_to_millis(zval *z, intl_error *err, const char *func TSRMLS_DC); +U_CFUNC double intl_zval_to_millis(zval *z, intl_error *err, const char *func); #endif /* COMMON_DATE_H */ diff --git a/ext/intl/common/common_enum.cpp b/ext/intl/common/common_enum.cpp index 952b39edca..cea9dc71c5 100644 --- a/ext/intl/common/common_enum.cpp +++ b/ext/intl/common/common_enum.cpp @@ -33,7 +33,7 @@ extern "C" { zend_class_entry *IntlIterator_ce_ptr; zend_object_handlers IntlIterator_handlers; -void zoi_with_current_dtor(zend_object_iterator *iter TSRMLS_DC) +void zoi_with_current_dtor(zend_object_iterator *iter) { zoi_with_current *zoiwc = (zoi_with_current*)iter; @@ -52,22 +52,22 @@ void zoi_with_current_dtor(zend_object_iterator *iter TSRMLS_DC) * precedes the object free phase. Therefore there's no risk on this * function being called by the iterator wrapper destructor function and * not finding the memory of this iterator allocated anymore. */ - iter->funcs->invalidate_current(iter TSRMLS_CC); - zoiwc->destroy_it(iter TSRMLS_CC); + iter->funcs->invalidate_current(iter); + zoiwc->destroy_it(iter); } } -U_CFUNC int zoi_with_current_valid(zend_object_iterator *iter TSRMLS_DC) +U_CFUNC int zoi_with_current_valid(zend_object_iterator *iter) { return Z_ISUNDEF(((zoi_with_current*)iter)->current)? FAILURE : SUCCESS; } -U_CFUNC zval *zoi_with_current_get_current_data(zend_object_iterator *iter TSRMLS_DC) +U_CFUNC zval *zoi_with_current_get_current_data(zend_object_iterator *iter) { return &((zoi_with_current*)iter)->current; } -U_CFUNC void zoi_with_current_invalidate_current(zend_object_iterator *iter TSRMLS_DC) +U_CFUNC void zoi_with_current_invalidate_current(zend_object_iterator *iter) { zoi_with_current *zoi_iter = (zoi_with_current*)iter; if (!Z_ISUNDEF(zoi_iter->current)) { @@ -76,12 +76,12 @@ U_CFUNC void zoi_with_current_invalidate_current(zend_object_iterator *iter TSRM } } -static void string_enum_current_move_forward(zend_object_iterator *iter TSRMLS_DC) +static void string_enum_current_move_forward(zend_object_iterator *iter) { zoi_with_current *zoi_iter = (zoi_with_current*)iter; INTLITERATOR_METHOD_INIT_VARS; - iter->funcs->invalidate_current(iter TSRMLS_CC); + iter->funcs->invalidate_current(iter); object = &zoi_iter->wrapping_obj; INTLITERATOR_METHOD_FETCH_OBJECT_NO_CHECK; @@ -90,22 +90,22 @@ static void string_enum_current_move_forward(zend_object_iterator *iter TSRMLS_D const char *result = ((StringEnumeration*)Z_PTR(iter->data))->next( &result_length, INTLITERATOR_ERROR_CODE(ii)); - intl_error_set_code(NULL, INTLITERATOR_ERROR_CODE(ii) TSRMLS_CC); + intl_error_set_code(NULL, INTLITERATOR_ERROR_CODE(ii)); if (U_FAILURE(INTLITERATOR_ERROR_CODE(ii))) { intl_errors_set_custom_msg(INTL_DATA_ERROR_P(ii), - "Error fetching next iteration element", 0 TSRMLS_CC); + "Error fetching next iteration element", 0); } else if (result) { ZVAL_STRINGL(&zoi_iter->current, result, result_length); } //else we've reached the end of the enum, nothing more is required } -static void string_enum_rewind(zend_object_iterator *iter TSRMLS_DC) +static void string_enum_rewind(zend_object_iterator *iter) { zoi_with_current *zoi_iter = (zoi_with_current*)iter; INTLITERATOR_METHOD_INIT_VARS; if (!Z_ISUNDEF(zoi_iter->current)) { - iter->funcs->invalidate_current(iter TSRMLS_CC); + iter->funcs->invalidate_current(iter); } object = &zoi_iter->wrapping_obj; @@ -113,16 +113,16 @@ static void string_enum_rewind(zend_object_iterator *iter TSRMLS_DC) ((StringEnumeration*)Z_PTR(iter->data))->reset(INTLITERATOR_ERROR_CODE(ii)); - intl_error_set_code(NULL, INTLITERATOR_ERROR_CODE(ii) TSRMLS_CC); + intl_error_set_code(NULL, INTLITERATOR_ERROR_CODE(ii)); if (U_FAILURE(INTLITERATOR_ERROR_CODE(ii))) { intl_errors_set_custom_msg(INTL_DATA_ERROR_P(ii), - "Error resetting enumeration", 0 TSRMLS_CC); + "Error resetting enumeration", 0); } else { - iter->funcs->move_forward(iter TSRMLS_CC); + iter->funcs->move_forward(iter); } } -static void string_enum_destroy_it(zend_object_iterator *iter TSRMLS_DC) +static void string_enum_destroy_it(zend_object_iterator *iter) { delete (StringEnumeration*)Z_PTR(iter->data); } @@ -137,13 +137,13 @@ static zend_object_iterator_funcs string_enum_object_iterator_funcs = { zoi_with_current_invalidate_current }; -U_CFUNC void IntlIterator_from_StringEnumeration(StringEnumeration *se, zval *object TSRMLS_DC) +U_CFUNC void IntlIterator_from_StringEnumeration(StringEnumeration *se, zval *object) { IntlIterator_object *ii; object_init_ex(object, IntlIterator_ce_ptr); ii = Z_INTL_ITERATOR_P(object); ii->iterator = (zend_object_iterator*)emalloc(sizeof(zoi_with_current)); - zend_iterator_init(ii->iterator TSRMLS_CC); + zend_iterator_init(ii->iterator); ZVAL_PTR(&ii->iterator->data, se); ii->iterator->funcs = &string_enum_object_iterator_funcs; ii->iterator->index = 0; @@ -152,26 +152,26 @@ U_CFUNC void IntlIterator_from_StringEnumeration(StringEnumeration *se, zval *ob ZVAL_UNDEF(&((zoi_with_current*)ii->iterator)->current); } -static void IntlIterator_objects_free(zend_object *object TSRMLS_DC) +static void IntlIterator_objects_free(zend_object *object) { IntlIterator_object *ii = php_intl_iterator_fetch_object(object); if (ii->iterator) { zval *wrapping_objp = &((zoi_with_current*)ii->iterator)->wrapping_obj; ZVAL_UNDEF(wrapping_objp); - zend_iterator_dtor(ii->iterator TSRMLS_CC); + zend_iterator_dtor(ii->iterator); } - intl_error_reset(INTLITERATOR_ERROR_P(ii) TSRMLS_CC); + intl_error_reset(INTLITERATOR_ERROR_P(ii)); - zend_object_std_dtor(&ii->zo TSRMLS_CC); + zend_object_std_dtor(&ii->zo); } static zend_object_iterator *IntlIterator_get_iterator( - zend_class_entry *ce, zval *object, int by_ref TSRMLS_DC) + zend_class_entry *ce, zval *object, int by_ref) { if (by_ref) { zend_throw_exception(NULL, - "Iteration by reference is not supported", 0 TSRMLS_CC); + "Iteration by reference is not supported", 0); return NULL; } @@ -179,7 +179,7 @@ static zend_object_iterator *IntlIterator_get_iterator( if (ii->iterator == NULL) { zend_throw_exception(NULL, - "The IntlIterator is not properly constructed", 0 TSRMLS_CC); + "The IntlIterator is not properly constructed", 0); return NULL; } @@ -188,15 +188,15 @@ static zend_object_iterator *IntlIterator_get_iterator( return ii->iterator; } -static zend_object *IntlIterator_object_create(zend_class_entry *ce TSRMLS_DC) +static zend_object *IntlIterator_object_create(zend_class_entry *ce) { IntlIterator_object *intern; intern = (IntlIterator_object*)ecalloc(1, sizeof(IntlIterator_object) + sizeof(zval) * (ce->default_properties_count - 1)); - zend_object_std_init(&intern->zo, ce TSRMLS_CC); + zend_object_std_init(&intern->zo, ce); object_properties_init(&intern->zo, ce); - intl_error_init(INTLITERATOR_ERROR_P(intern) TSRMLS_CC); + intl_error_init(INTLITERATOR_ERROR_P(intern)); intern->iterator = NULL; @@ -212,12 +212,12 @@ static PHP_METHOD(IntlIterator, current) if (zend_parse_parameters_none() == FAILURE) { intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, - "IntlIterator::current: bad arguments", 0 TSRMLS_CC); + "IntlIterator::current: bad arguments", 0); return; } INTLITERATOR_METHOD_FETCH_OBJECT; - data = ii->iterator->funcs->get_current_data(ii->iterator TSRMLS_CC); + data = ii->iterator->funcs->get_current_data(ii->iterator); if (data) { RETURN_ZVAL(data, 1, 0); } @@ -229,14 +229,14 @@ static PHP_METHOD(IntlIterator, key) if (zend_parse_parameters_none() == FAILURE) { intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, - "IntlIterator::key: bad arguments", 0 TSRMLS_CC); + "IntlIterator::key: bad arguments", 0); return; } INTLITERATOR_METHOD_FETCH_OBJECT; if (ii->iterator->funcs->get_current_key) { - ii->iterator->funcs->get_current_key(ii->iterator, return_value TSRMLS_CC); + ii->iterator->funcs->get_current_key(ii->iterator, return_value); } else { RETURN_LONG(ii->iterator->index); } @@ -248,12 +248,12 @@ static PHP_METHOD(IntlIterator, next) if (zend_parse_parameters_none() == FAILURE) { intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, - "IntlIterator::next: bad arguments", 0 TSRMLS_CC); + "IntlIterator::next: bad arguments", 0); return; } INTLITERATOR_METHOD_FETCH_OBJECT; - ii->iterator->funcs->move_forward(ii->iterator TSRMLS_CC); + ii->iterator->funcs->move_forward(ii->iterator); /* foreach also advances the index after the last iteration, * so I see no problem in incrementing the index here unconditionally */ ii->iterator->index++; @@ -265,16 +265,16 @@ static PHP_METHOD(IntlIterator, rewind) if (zend_parse_parameters_none() == FAILURE) { intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, - "IntlIterator::rewind: bad arguments", 0 TSRMLS_CC); + "IntlIterator::rewind: bad arguments", 0); return; } INTLITERATOR_METHOD_FETCH_OBJECT; if (ii->iterator->funcs->rewind) { - ii->iterator->funcs->rewind(ii->iterator TSRMLS_CC); + ii->iterator->funcs->rewind(ii->iterator); } else { intl_errors_set(INTLITERATOR_ERROR_P(ii), U_UNSUPPORTED_ERROR, - "IntlIterator::rewind: rewind not supported", 0 TSRMLS_CC); + "IntlIterator::rewind: rewind not supported", 0); } } @@ -284,12 +284,12 @@ static PHP_METHOD(IntlIterator, valid) if (zend_parse_parameters_none() == FAILURE) { intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, - "IntlIterator::valid: bad arguments", 0 TSRMLS_CC); + "IntlIterator::valid: bad arguments", 0); return; } INTLITERATOR_METHOD_FETCH_OBJECT; - RETURN_BOOL(ii->iterator->funcs->valid(ii->iterator TSRMLS_CC) == SUCCESS); + RETURN_BOOL(ii->iterator->funcs->valid(ii->iterator) == SUCCESS); } ZEND_BEGIN_ARG_INFO_EX(ainfo_se_void, 0, 0, 0) @@ -308,16 +308,16 @@ static zend_function_entry IntlIterator_class_functions[] = { /* {{{ intl_register_IntlIterator_class * Initialize 'IntlIterator' class */ -U_CFUNC void intl_register_IntlIterator_class(TSRMLS_D) +U_CFUNC void intl_register_IntlIterator_class(void) { zend_class_entry ce; /* Create and register 'IntlIterator' class. */ INIT_CLASS_ENTRY(ce, "IntlIterator", IntlIterator_class_functions); ce.create_object = IntlIterator_object_create; - IntlIterator_ce_ptr = zend_register_internal_class(&ce TSRMLS_CC); + IntlIterator_ce_ptr = zend_register_internal_class(&ce); IntlIterator_ce_ptr->get_iterator = IntlIterator_get_iterator; - zend_class_implements(IntlIterator_ce_ptr TSRMLS_CC, 1, + zend_class_implements(IntlIterator_ce_ptr, 1, zend_ce_iterator); memcpy(&IntlIterator_handlers, zend_get_std_object_handlers(), diff --git a/ext/intl/common/common_enum.h b/ext/intl/common/common_enum.h index af46a47751..b9b87c17e0 100644 --- a/ext/intl/common/common_enum.h +++ b/ext/intl/common/common_enum.h @@ -43,7 +43,7 @@ extern "C" { object = getThis(); \ INTLITERATOR_METHOD_FETCH_OBJECT_NO_CHECK; \ if (ii->iterator == NULL) { \ - intl_errors_set(&ii->err, U_ILLEGAL_ARGUMENT_ERROR, "Found unconstructed IntlIterator", 0 TSRMLS_CC); \ + intl_errors_set(&ii->err, U_ILLEGAL_ARGUMENT_ERROR, "Found unconstructed IntlIterator", 0); \ RETURN_FALSE; \ } @@ -63,21 +63,21 @@ typedef struct { zend_object_iterator zoi; zval current; zval wrapping_obj; - void (*destroy_it)(zend_object_iterator *iterator TSRMLS_DC); + void (*destroy_it)(zend_object_iterator *iterator); } zoi_with_current; extern zend_class_entry *IntlIterator_ce_ptr; extern zend_object_handlers IntlIterator_handlers; -U_CFUNC void zoi_with_current_dtor(zend_object_iterator *iter TSRMLS_DC); -U_CFUNC int zoi_with_current_valid(zend_object_iterator *iter TSRMLS_DC); -U_CFUNC zval *zoi_with_current_get_current_data(zend_object_iterator *iter TSRMLS_DC); -U_CFUNC void zoi_with_current_invalidate_current(zend_object_iterator *iter TSRMLS_DC); +U_CFUNC void zoi_with_current_dtor(zend_object_iterator *iter); +U_CFUNC int zoi_with_current_valid(zend_object_iterator *iter); +U_CFUNC zval *zoi_with_current_get_current_data(zend_object_iterator *iter); +U_CFUNC void zoi_with_current_invalidate_current(zend_object_iterator *iter); #ifdef __cplusplus -U_CFUNC void IntlIterator_from_StringEnumeration(StringEnumeration *se, zval *object TSRMLS_DC); +U_CFUNC void IntlIterator_from_StringEnumeration(StringEnumeration *se, zval *object); #endif -U_CFUNC void intl_register_IntlIterator_class(TSRMLS_D); +U_CFUNC void intl_register_IntlIterator_class(void); #endif // INTL_COMMON_ENUM_H diff --git a/ext/intl/common/common_error.c b/ext/intl/common/common_error.c index 524bb94327..16933c587f 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_LONG( intl_error_get_code( NULL ) ); } /* }}} */ @@ -37,7 +37,7 @@ PHP_FUNCTION( intl_get_error_code ) */ PHP_FUNCTION( intl_get_error_message ) { - RETURN_STR(intl_error_get_message( NULL TSRMLS_CC )); + RETURN_STR(intl_error_get_message( NULL )); } /* }}} */ @@ -51,11 +51,11 @@ PHP_FUNCTION( intl_is_failure ) zend_long err_code; /* Parse parameters. */ - if( zend_parse_parameters( ZEND_NUM_ARGS() TSRMLS_CC, "l", + if( zend_parse_parameters( ZEND_NUM_ARGS(), "l", &err_code ) == FAILURE ) { intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, - "intl_is_failure: unable to parse input params", 0 TSRMLS_CC ); + "intl_is_failure: unable to parse input params", 0 ); RETURN_FALSE; } @@ -73,11 +73,11 @@ PHP_FUNCTION( intl_error_name ) zend_long err_code; /* Parse parameters. */ - if( zend_parse_parameters( ZEND_NUM_ARGS() TSRMLS_CC, "l", + if( zend_parse_parameters( ZEND_NUM_ARGS(), "l", &err_code ) == FAILURE ) { intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, - "intl_error_name: unable to parse input params", 0 TSRMLS_CC ); + "intl_error_name: unable to parse input params", 0 ); RETURN_FALSE; } diff --git a/ext/intl/converter/converter.c b/ext/intl/converter/converter.c index eb37ce00f1..f52d0490cc 100644 --- a/ext/intl/converter/converter.c +++ b/ext/intl/converter/converter.c @@ -41,11 +41,11 @@ static zend_class_entry *php_converter_ce; static zend_object_handlers php_converter_object_handlers; #define CONV_GET(pzv) (Z_INTL_CONVERTER_P((pzv))) -#define THROW_UFAILURE(obj, fname, error) php_converter_throw_failure(obj, error TSRMLS_CC, \ +#define THROW_UFAILURE(obj, fname, error) php_converter_throw_failure(obj, error, \ fname "() returned error " ZEND_LONG_FMT ": %s", (zend_long)error, u_errorName(error)) /* {{{ php_converter_throw_failure */ -static inline void php_converter_throw_failure(php_converter_object *objval, UErrorCode error TSRMLS_DC, const char *format, ...) { +static inline void php_converter_throw_failure(php_converter_object *objval, UErrorCode error, const char *format, ...) { intl_error *err = objval ? &(objval->error) : NULL; char message[1024]; va_list vargs; @@ -54,12 +54,12 @@ static inline void php_converter_throw_failure(php_converter_object *objval, UEr vsnprintf(message, sizeof(message), format, vargs); va_end(vargs); - intl_errors_set(err, error, message, 1 TSRMLS_CC); + intl_errors_set(err, error, message, 1); } /* }}} */ /* {{{ php_converter_default_callback */ -static void php_converter_default_callback(zval *return_value, zval *zobj, zend_long reason, zval *error TSRMLS_DC) { +static void php_converter_default_callback(zval *return_value, zval *zobj, zend_long reason, zval *error) { ZVAL_DEREF(error); zval_dtor(error); ZVAL_LONG(error, U_ZERO_ERROR); @@ -74,7 +74,7 @@ static void php_converter_default_callback(zval *return_value, zval *zobj, zend_ int8_t chars_len = sizeof(chars); UErrorCode uerror = U_ZERO_ERROR; if(!objval->src) { - php_converter_throw_failure(objval, U_INVALID_STATE_ERROR TSRMLS_CC, "Source Converter has not been initialized yet"); + php_converter_throw_failure(objval, U_INVALID_STATE_ERROR, "Source Converter has not been initialized yet"); chars[0] = 0x1A; chars[1] = 0; chars_len = 1; @@ -117,12 +117,12 @@ static PHP_METHOD(UConverter, toUCallback) { zend_long reason; zval *source, *codeUnits, *error; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "lzzz", + if (zend_parse_parameters(ZEND_NUM_ARGS(), "lzzz", &reason, &source, &codeUnits, &error) == FAILURE) { return; } - php_converter_default_callback(return_value, getThis(), reason, error TSRMLS_CC); + php_converter_default_callback(return_value, getThis(), reason, error); } /* }}} */ @@ -139,29 +139,29 @@ static PHP_METHOD(UConverter, fromUCallback) { zend_long reason; zval *source, *codePoint, *error; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "lzzz", + if (zend_parse_parameters(ZEND_NUM_ARGS(), "lzzz", &reason, &source, &codePoint, &error) == FAILURE) { return; } - php_converter_default_callback(return_value, getThis(), reason, error TSRMLS_CC); + php_converter_default_callback(return_value, getThis(), reason, error); } /* }}} */ /* {{{ php_converter_check_limits */ -static inline zend_bool php_converter_check_limits(php_converter_object *objval, zend_long available, zend_long needed TSRMLS_DC) { +static inline zend_bool php_converter_check_limits(php_converter_object *objval, zend_long available, zend_long needed) { if (available < needed) { - php_converter_throw_failure(objval, U_BUFFER_OVERFLOW_ERROR TSRMLS_CC, "Buffer overrun %pd bytes needed, %pd available", needed, available); + php_converter_throw_failure(objval, U_BUFFER_OVERFLOW_ERROR, "Buffer overrun %pd bytes needed, %pd available", needed, available); return 0; } return 1; } /* }}} */ -#define TARGET_CHECK(cnvargs, needed) php_converter_check_limits(objval, cnvargs->targetLimit - cnvargs->target, needed TSRMLS_CC) +#define TARGET_CHECK(cnvargs, needed) php_converter_check_limits(objval, cnvargs->targetLimit - cnvargs->target, needed) /* {{{ php_converter_append_toUnicode_target */ -static void php_converter_append_toUnicode_target(zval *val, UConverterToUnicodeArgs *args, php_converter_object *objval TSRMLS_DC) { +static void php_converter_append_toUnicode_target(zval *val, UConverterToUnicodeArgs *args, php_converter_object *objval) { switch (Z_TYPE_P(val)) { case IS_NULL: /* Code unit is being skipped */ @@ -170,7 +170,7 @@ static void php_converter_append_toUnicode_target(zval *val, UConverterToUnicode { zend_long lval = Z_LVAL_P(val); if ((lval < 0) || (lval > 0x10FFFF)) { - php_converter_throw_failure(objval, U_ILLEGAL_ARGUMENT_ERROR TSRMLS_CC, "Invalid codepoint U+%04lx", lval); + php_converter_throw_failure(objval, U_ILLEGAL_ARGUMENT_ERROR, "Invalid codepoint U+%04lx", lval); return; } if (lval > 0xFFFF) { @@ -206,12 +206,12 @@ static void php_converter_append_toUnicode_target(zval *val, UConverterToUnicode zval *tmpzval; ZEND_HASH_FOREACH_VAL(ht, tmpzval) { - php_converter_append_toUnicode_target(tmpzval, args, objval TSRMLS_CC); + php_converter_append_toUnicode_target(tmpzval, args, objval); } ZEND_HASH_FOREACH_END(); return; } default: - php_converter_throw_failure(objval, U_ILLEGAL_ARGUMENT_ERROR TSRMLS_CC, + php_converter_throw_failure(objval, U_ILLEGAL_ARGUMENT_ERROR, "toUCallback() specified illegal type for substitution character"); } } @@ -236,11 +236,11 @@ static void php_converter_to_u_callback(const void *context, objval->to_cb.params = zargs; objval->to_cb.retval = &retval; objval->to_cb.no_separation = 0; - if (zend_call_function(&(objval->to_cb), &(objval->to_cache) TSRMLS_CC) == FAILURE) { + if (zend_call_function(&(objval->to_cb), &(objval->to_cache)) == FAILURE) { /* Unlikely */ - php_converter_throw_failure(objval, U_INTERNAL_PROGRAM_ERROR TSRMLS_CC, "Unexpected failure calling toUCallback()"); + php_converter_throw_failure(objval, U_INTERNAL_PROGRAM_ERROR, "Unexpected failure calling toUCallback()"); } else if (!Z_ISUNDEF(retval)) { - php_converter_append_toUnicode_target(&retval, args, objval TSRMLS_CC); + php_converter_append_toUnicode_target(&retval, args, objval); zval_ptr_dtor(&retval); } @@ -258,7 +258,7 @@ static void php_converter_to_u_callback(const void *context, /* }}} */ /* {{{ php_converter_append_fromUnicode_target */ -static void php_converter_append_fromUnicode_target(zval *val, UConverterFromUnicodeArgs *args, php_converter_object *objval TSRMLS_DC) { +static void php_converter_append_fromUnicode_target(zval *val, UConverterFromUnicodeArgs *args, php_converter_object *objval) { switch (Z_TYPE_P(val)) { case IS_NULL: /* Ignore */ @@ -282,12 +282,12 @@ static void php_converter_append_fromUnicode_target(zval *val, UConverterFromUni HashTable *ht = Z_ARRVAL_P(val); zval *tmpzval; ZEND_HASH_FOREACH_VAL(ht, tmpzval) { - php_converter_append_fromUnicode_target(tmpzval, args, objval TSRMLS_CC); + php_converter_append_fromUnicode_target(tmpzval, args, objval); } ZEND_HASH_FOREACH_END(); return; } default: - php_converter_throw_failure(objval, U_ILLEGAL_ARGUMENT_ERROR TSRMLS_CC, "fromUCallback() specified illegal type for substitution character"); + php_converter_throw_failure(objval, U_ILLEGAL_ARGUMENT_ERROR, "fromUCallback() specified illegal type for substitution character"); } } /* }}} */ @@ -318,11 +318,11 @@ static void php_converter_from_u_callback(const void *context, objval->from_cb.params = zargs; objval->from_cb.retval = &retval; objval->from_cb.no_separation = 0; - if (zend_call_function(&(objval->from_cb), &(objval->from_cache) TSRMLS_CC) == FAILURE) { + if (zend_call_function(&(objval->from_cb), &(objval->from_cache)) == FAILURE) { /* Unlikely */ - php_converter_throw_failure(objval, U_INTERNAL_PROGRAM_ERROR TSRMLS_CC, "Unexpected failure calling fromUCallback()"); + php_converter_throw_failure(objval, U_INTERNAL_PROGRAM_ERROR, "Unexpected failure calling fromUCallback()"); } else if (!Z_ISUNDEF(retval)) { - php_converter_append_fromUnicode_target(&retval, args, objval TSRMLS_CC); + php_converter_append_fromUnicode_target(&retval, args, objval); zval_ptr_dtor(&retval); } @@ -340,7 +340,7 @@ static void php_converter_from_u_callback(const void *context, /* }}} */ /* {{{ php_converter_set_callbacks */ -static inline zend_bool php_converter_set_callbacks(php_converter_object *objval, UConverter *cnv TSRMLS_DC) { +static inline zend_bool php_converter_set_callbacks(php_converter_object *objval, UConverter *cnv) { zend_bool ret = 1; UErrorCode error = U_ZERO_ERROR; @@ -373,7 +373,7 @@ static inline zend_bool php_converter_set_callbacks(php_converter_object *objval static zend_bool php_converter_set_encoding(php_converter_object *objval, UConverter **pcnv, const char *enc, int enc_len - TSRMLS_DC) { + ) { UErrorCode error = U_ZERO_ERROR; UConverter *cnv = ucnv_open(enc, &error); @@ -384,17 +384,17 @@ static zend_bool php_converter_set_encoding(php_converter_object *objval, /* Should never happen */ actual_encoding = "(unknown)"; } - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Ambiguous encoding specified, using %s", actual_encoding); + php_error_docref(NULL, E_WARNING, "Ambiguous encoding specified, using %s", actual_encoding); } else if (U_FAILURE(error)) { if (objval) { THROW_UFAILURE(objval, "ucnv_open", error); } else { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Error setting encoding: %d - %s", (int)error, u_errorName(error)); + php_error_docref(NULL, E_WARNING, "Error setting encoding: %d - %s", (int)error, u_errorName(error)); } return 0; } - if (objval && !php_converter_set_callbacks(objval, cnv TSRMLS_CC)) { + if (objval && !php_converter_set_callbacks(objval, cnv)) { return 0; } @@ -415,14 +415,14 @@ static void php_converter_do_set_encoding(UConverter *cnv, INTERNAL_FUNCTION_PAR char *enc; size_t enc_len; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &enc, &enc_len) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &enc, &enc_len) == FAILURE) { intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, "Bad arguments, " - "expected one string argument", 0 TSRMLS_CC); + "expected one string argument", 0); RETURN_FALSE; } - intl_errors_reset(&objval->error TSRMLS_CC); + intl_errors_reset(&objval->error); - RETURN_BOOL(php_converter_set_encoding(objval, &(objval->src), enc, enc_len TSRMLS_CC)); + RETURN_BOOL(php_converter_set_encoding(objval, &(objval->src), enc, enc_len)); } /* }}} */ @@ -447,11 +447,11 @@ static void php_converter_do_get_encoding(php_converter_object *objval, UConvert const char *name; if (zend_parse_parameters_none() == FAILURE) { - intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, "Expected no arguments", 0 TSRMLS_CC); + intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, "Expected no arguments", 0); RETURN_FALSE; } - intl_errors_reset(&objval->error TSRMLS_CC); + intl_errors_reset(&objval->error); if (!cnv) { RETURN_NULL(); @@ -488,10 +488,10 @@ static void php_converter_do_get_type(php_converter_object *objval, UConverter * UConverterType t; if (zend_parse_parameters_none() == FAILURE) { - intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, "Expected no arguments", 0 TSRMLS_CC); + intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, "Expected no arguments", 0); RETURN_FALSE; } - intl_errors_reset(&objval->error TSRMLS_CC); + intl_errors_reset(&objval->error); if (!cnv) { RETURN_NULL(); @@ -526,7 +526,7 @@ static void php_converter_resolve_callback(zval *zobj, php_converter_object *objval, const char *callback_name, zend_fcall_info *finfo, - zend_fcall_info_cache *fcache TSRMLS_DC) { + zend_fcall_info_cache *fcache) { char *errstr = NULL; zval caller; @@ -534,8 +534,8 @@ static void php_converter_resolve_callback(zval *zobj, Z_ADDREF_P(zobj); add_index_zval(&caller, 0, zobj); add_index_string(&caller, 1, callback_name); - if (zend_fcall_info_init(&caller, 0, finfo, fcache, NULL, &errstr TSRMLS_CC) == FAILURE) { - php_converter_throw_failure(objval, U_INTERNAL_PROGRAM_ERROR TSRMLS_CC, "Error setting converter callback: %s", errstr); + if (zend_fcall_info_init(&caller, 0, finfo, fcache, NULL, &errstr) == FAILURE) { + php_converter_throw_failure(objval, U_INTERNAL_PROGRAM_ERROR, "Error setting converter callback: %s", errstr); } zval_dtor(&caller); if (errstr) { @@ -557,19 +557,19 @@ static PHP_METHOD(UConverter, __construct) { char *dest = src; size_t dest_len = src_len; - intl_error_reset(NULL TSRMLS_CC); + intl_error_reset(NULL); - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|s!s!", + if (zend_parse_parameters(ZEND_NUM_ARGS(), "|s!s!", &dest, &dest_len, &src, &src_len) == FAILURE) { intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, - "UConverter::__construct(): bad arguments", 0 TSRMLS_CC); + "UConverter::__construct(): bad arguments", 0); return; } - php_converter_set_encoding(objval, &(objval->src), src, src_len TSRMLS_CC); - php_converter_set_encoding(objval, &(objval->dest), dest, dest_len TSRMLS_CC); - php_converter_resolve_callback(getThis(), objval, "toUCallback", &(objval->to_cb), &(objval->to_cache) TSRMLS_CC); - php_converter_resolve_callback(getThis(), objval, "fromUCallback", &(objval->from_cb), &(objval->from_cache) TSRMLS_CC); + php_converter_set_encoding(objval, &(objval->src), src, src_len ); + php_converter_set_encoding(objval, &(objval->dest), dest, dest_len); + php_converter_resolve_callback(getThis(), objval, "toUCallback", &(objval->to_cb), &(objval->to_cache)); + php_converter_resolve_callback(getThis(), objval, "fromUCallback", &(objval->from_cb), &(objval->from_cache)); } /* }}} */ @@ -584,12 +584,12 @@ static PHP_METHOD(UConverter, setSubstChars) { size_t chars_len; int ret = 1; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &chars, &chars_len) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &chars, &chars_len) == FAILURE) { intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, - "UConverter::setSubstChars(): bad arguments", 0 TSRMLS_CC); + "UConverter::setSubstChars(): bad arguments", 0); RETURN_FALSE; } - intl_errors_reset(&objval->error TSRMLS_CC); + intl_errors_reset(&objval->error); if (objval->src) { UErrorCode error = U_ZERO_ERROR; @@ -599,7 +599,7 @@ static PHP_METHOD(UConverter, setSubstChars) { ret = 0; } } else { - php_converter_throw_failure(objval, U_INVALID_STATE_ERROR TSRMLS_CC, "Source Converter has not been initialized yet"); + php_converter_throw_failure(objval, U_INVALID_STATE_ERROR, "Source Converter has not been initialized yet"); ret = 0; } @@ -611,7 +611,7 @@ static PHP_METHOD(UConverter, setSubstChars) { ret = 0; } } else { - php_converter_throw_failure(objval, U_INVALID_STATE_ERROR TSRMLS_CC, "Destination Converter has not been initialized yet"); + php_converter_throw_failure(objval, U_INVALID_STATE_ERROR, "Destination Converter has not been initialized yet"); ret = 0; } @@ -631,10 +631,10 @@ static PHP_METHOD(UConverter, getSubstChars) { if (zend_parse_parameters_none() == FAILURE) { intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, - "UConverter::getSubstChars(): expected no arguments", 0 TSRMLS_CC); + "UConverter::getSubstChars(): expected no arguments", 0); RETURN_FALSE; } - intl_errors_reset(&objval->error TSRMLS_CC); + intl_errors_reset(&objval->error); if (!objval->src) { RETURN_NULL(); @@ -657,7 +657,7 @@ static PHP_METHOD(UConverter, getSubstChars) { static zend_bool php_converter_do_convert(UConverter *dest_cnv, char **pdest, int32_t *pdest_len, UConverter *src_cnv, const char *src, int32_t src_len, php_converter_object *objval - TSRMLS_DC) { + ) { UErrorCode error = U_ZERO_ERROR; int32_t dest_len, temp_len; @@ -665,7 +665,7 @@ static zend_bool php_converter_do_convert(UConverter *dest_cnv, char **pdest, in UChar *temp; if (!src_cnv || !dest_cnv) { - php_converter_throw_failure(objval, U_INVALID_STATE_ERROR TSRMLS_CC, + php_converter_throw_failure(objval, U_INVALID_STATE_ERROR, "Internal converters not initialized"); return 0; } @@ -725,12 +725,12 @@ ZEND_END_ARG_INFO(); static PHP_METHOD(UConverter, reasonText) { zend_long reason; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &reason) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &reason) == FAILURE) { intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, - "UConverter::reasonText(): bad arguments", 0 TSRMLS_CC); + "UConverter::reasonText(): bad arguments", 0); RETURN_FALSE; } - intl_error_reset(NULL TSRMLS_CC); + intl_error_reset(NULL); switch (reason) { UCNV_REASON_CASE(UNASSIGNED) @@ -740,7 +740,7 @@ static PHP_METHOD(UConverter, reasonText) { UCNV_REASON_CASE(CLOSE) UCNV_REASON_CASE(CLONE) default: - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown UConverterCallbackReason: %pd", reason); + php_error_docref(NULL, E_WARNING, "Unknown UConverterCallbackReason: %pd", reason); RETURN_FALSE; } } @@ -759,19 +759,19 @@ static PHP_METHOD(UConverter, convert) { int32_t dest_len; zend_bool reverse = 0; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|b", + if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|b", &str, &str_len, &reverse) == FAILURE) { intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, - "UConverter::convert(): bad arguments", 0 TSRMLS_CC); + "UConverter::convert(): bad arguments", 0); RETURN_FALSE; } - intl_errors_reset(&objval->error TSRMLS_CC); + intl_errors_reset(&objval->error); if (php_converter_do_convert(reverse ? objval->src : objval->dest, &dest, &dest_len, reverse ? objval->dest : objval->src, str, str_len, - objval TSRMLS_CC)) { + objval)) { RETVAL_STRINGL(dest, dest_len); //??? efree(dest); @@ -796,16 +796,16 @@ static PHP_METHOD(UConverter, transcode) { zval *options = NULL; UConverter *src_cnv = NULL, *dest_cnv = NULL; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sss|a!", + if (zend_parse_parameters(ZEND_NUM_ARGS(), "sss|a!", &str, &str_len, &dest, &dest_len, &src, &src_len, &options) == FAILURE) { intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, - "UConverter::transcode(): bad arguments", 0 TSRMLS_CC); + "UConverter::transcode(): bad arguments", 0); RETURN_FALSE; } - intl_error_reset(NULL TSRMLS_CC); + intl_error_reset(NULL); - if (php_converter_set_encoding(NULL, &src_cnv, src, src_len TSRMLS_CC) && - php_converter_set_encoding(NULL, &dest_cnv, dest, dest_len TSRMLS_CC)) { + if (php_converter_set_encoding(NULL, &src_cnv, src, src_len) && + php_converter_set_encoding(NULL, &dest_cnv, dest, dest_len)) { char *out = NULL; int out_len = 0; UErrorCode error = U_ZERO_ERROR; @@ -828,7 +828,7 @@ static PHP_METHOD(UConverter, transcode) { } if (U_SUCCESS(error) && - php_converter_do_convert(dest_cnv, &out, &out_len, src_cnv, str, str_len, NULL TSRMLS_CC)) { + php_converter_do_convert(dest_cnv, &out, &out_len, src_cnv, str, str_len, NULL)) { RETVAL_STRINGL(out, out_len); //??? efree(out); @@ -860,11 +860,11 @@ static PHP_METHOD(UConverter, getErrorCode) { if (zend_parse_parameters_none() == FAILURE) { intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, - "UConverter::getErrorCode(): expected no arguments", 0 TSRMLS_CC); + "UConverter::getErrorCode(): expected no arguments", 0); RETURN_FALSE; } - RETURN_LONG(intl_error_get_code(&(objval->error) TSRMLS_CC)); + RETURN_LONG(intl_error_get_code(&(objval->error))); } /* }}} */ @@ -873,11 +873,11 @@ ZEND_BEGIN_ARG_INFO_EX(php_converter_geterrormsg_arginfo, 0, ZEND_RETURN_VALUE, ZEND_END_ARG_INFO(); static PHP_METHOD(UConverter, getErrorMessage) { php_converter_object *objval = CONV_GET(getThis()); - zend_string *message = intl_error_get_message(&(objval->error) TSRMLS_CC); + zend_string *message = intl_error_get_message(&(objval->error)); if (zend_parse_parameters_none() == FAILURE) { intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, - "UConverter::getErrorMessage(): expected no arguments", 0 TSRMLS_CC); + "UConverter::getErrorMessage(): expected no arguments", 0); RETURN_FALSE; } @@ -898,10 +898,10 @@ static PHP_METHOD(UConverter, getAvailable) { if (zend_parse_parameters_none() == FAILURE) { intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, - "UConverter::getErrorMessage(): expected no arguments", 0 TSRMLS_CC); + "UConverter::getErrorMessage(): expected no arguments", 0); RETURN_FALSE; } - intl_error_reset(NULL TSRMLS_CC); + intl_error_reset(NULL); array_init(return_value); for(i = 0; i < count; i++) { @@ -921,12 +921,12 @@ static PHP_METHOD(UConverter, getAliases) { UErrorCode error = U_ZERO_ERROR; uint16_t i, count; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &name, &name_len) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &name, &name_len) == FAILURE) { intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, - "UConverter::getAliases(): bad arguments", 0 TSRMLS_CC); + "UConverter::getAliases(): bad arguments", 0); RETURN_FALSE; } - intl_error_reset(NULL TSRMLS_CC); + intl_error_reset(NULL); count = ucnv_countAliases(name, &error); if (U_FAILURE(error)) { @@ -958,10 +958,10 @@ static PHP_METHOD(UConverter, getStandards) { if (zend_parse_parameters_none() == FAILURE) { intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, - "UConverter::getStandards(): expected no arguments", 0 TSRMLS_CC); + "UConverter::getStandards(): expected no arguments", 0); RETURN_FALSE; } - intl_error_reset(NULL TSRMLS_CC); + intl_error_reset(NULL); array_init(return_value); count = ucnv_countStandards(); @@ -1016,7 +1016,7 @@ static zend_function_entry php_converter_methods[] = { }; /* {{{ Converter create/clone/destroy */ -static void php_converter_dtor_object(zend_object *obj TSRMLS_DC) { +static void php_converter_dtor_object(zend_object *obj) { php_converter_object *objval = php_converter_fetch_object(obj); if (objval->src) { @@ -1027,16 +1027,16 @@ static void php_converter_dtor_object(zend_object *obj TSRMLS_DC) { ucnv_close(objval->dest); } - intl_error_reset(&(objval->error) TSRMLS_CC); + intl_error_reset(&(objval->error)); } -static zend_object *php_converter_object_ctor(zend_class_entry *ce, php_converter_object **pobjval TSRMLS_DC) { +static zend_object *php_converter_object_ctor(zend_class_entry *ce, php_converter_object **pobjval) { php_converter_object *objval; objval = ecalloc(1, sizeof(php_converter_object) + sizeof(zval) * (ce->default_properties_count - 1)); - zend_object_std_init(&objval->obj, ce TSRMLS_CC ); - intl_error_init(&(objval->error) TSRMLS_CC); + zend_object_std_init(&objval->obj, ce ); + intl_error_init(&(objval->error)); objval->obj.handlers = &php_converter_object_handlers; *pobjval = objval; @@ -1044,21 +1044,21 @@ static zend_object *php_converter_object_ctor(zend_class_entry *ce, php_converte return &objval->obj; } -static zend_object *php_converter_create_object(zend_class_entry *ce TSRMLS_DC) { +static zend_object *php_converter_create_object(zend_class_entry *ce) { php_converter_object *objval = NULL; - zend_object *retval = php_converter_object_ctor(ce, &objval TSRMLS_CC); + zend_object *retval = php_converter_object_ctor(ce, &objval); object_properties_init(&(objval->obj), ce); return retval; } -static zend_object *php_converter_clone_object(zval *object TSRMLS_DC) { +static zend_object *php_converter_clone_object(zval *object) { php_converter_object *objval, *oldobj = Z_INTL_CONVERTER_P(object); - zend_object *retval = php_converter_object_ctor(Z_OBJCE_P(object), &objval TSRMLS_CC); + zend_object *retval = php_converter_object_ctor(Z_OBJCE_P(object), &objval); UErrorCode error = U_ZERO_ERROR; - intl_errors_reset(&oldobj->error TSRMLS_CC); + intl_errors_reset(&oldobj->error); objval->src = ucnv_safeClone(oldobj->src, NULL, NULL, &error); if (U_SUCCESS(error)) { @@ -1069,18 +1069,18 @@ static zend_object *php_converter_clone_object(zval *object TSRMLS_DC) { zend_string *err_msg; THROW_UFAILURE(oldobj, "ucnv_safeClone", error); - err_msg = intl_error_get_message(&oldobj->error TSRMLS_CC); - zend_throw_exception(NULL, err_msg->val, 0 TSRMLS_CC); + err_msg = intl_error_get_message(&oldobj->error); + zend_throw_exception(NULL, err_msg->val, 0); zend_string_release(err_msg); return retval; } /* Update contexts for converter error handlers */ - php_converter_set_callbacks(objval, objval->src TSRMLS_CC); - php_converter_set_callbacks(objval, objval->dest TSRMLS_CC); + php_converter_set_callbacks(objval, objval->src ); + php_converter_set_callbacks(objval, objval->dest); - zend_objects_clone_members(&(objval->obj), &(oldobj->obj) TSRMLS_CC); + zend_objects_clone_members(&(objval->obj), &(oldobj->obj)); /* Newly cloned object deliberately does not inherit error state from original object */ @@ -1088,15 +1088,15 @@ static zend_object *php_converter_clone_object(zval *object TSRMLS_DC) { } /* }}} */ -#define CONV_REASON_CONST(v) zend_declare_class_constant_long(php_converter_ce, "REASON_" #v, sizeof("REASON_" #v) - 1, UCNV_ ## v TSRMLS_CC) -#define CONV_TYPE_CONST(v) zend_declare_class_constant_long(php_converter_ce, #v , sizeof(#v) - 1, UCNV_ ## v TSRMLS_CC) +#define CONV_REASON_CONST(v) zend_declare_class_constant_long(php_converter_ce, "REASON_" #v, sizeof("REASON_" #v) - 1, UCNV_ ## v) +#define CONV_TYPE_CONST(v) zend_declare_class_constant_long(php_converter_ce, #v , sizeof(#v) - 1, UCNV_ ## v) /* {{{ php_converter_minit */ int php_converter_minit(INIT_FUNC_ARGS) { zend_class_entry ce; INIT_CLASS_ENTRY(ce, "UConverter", php_converter_methods); - php_converter_ce = zend_register_internal_class(&ce TSRMLS_CC); + php_converter_ce = zend_register_internal_class(&ce); php_converter_ce->create_object = php_converter_create_object; memcpy(&php_converter_object_handlers, zend_get_std_object_handlers(), sizeof(zend_object_handlers)); php_converter_object_handlers.offset = XtOffsetOf(php_converter_object, obj); diff --git a/ext/intl/dateformat/dateformat.c b/ext/intl/dateformat/dateformat.c index ffa606a9cd..b1821ce0d3 100644 --- a/ext/intl/dateformat/dateformat.c +++ b/ext/intl/dateformat/dateformat.c @@ -35,10 +35,10 @@ void dateformat_register_constants( INIT_FUNC_ARGS ) } #define DATEFORMATTER_EXPOSE_CONST(x) REGISTER_LONG_CONSTANT(#x, x, CONST_PERSISTENT | CONST_CS) - #define DATEFORMATTER_EXPOSE_CLASS_CONST(x) zend_declare_class_constant_long( IntlDateFormatter_ce_ptr, ZEND_STRS( #x ) - 1, UDAT_##x TSRMLS_CC ); - #define DATEFORMATTER_EXPOSE_CUSTOM_CLASS_CONST(name, value) zend_declare_class_constant_long( IntlDateFormatter_ce_ptr, ZEND_STRS( name ) - 1, value TSRMLS_CC ); + #define DATEFORMATTER_EXPOSE_CLASS_CONST(x) zend_declare_class_constant_long( IntlDateFormatter_ce_ptr, ZEND_STRS( #x ) - 1, UDAT_##x ); + #define DATEFORMATTER_EXPOSE_CUSTOM_CLASS_CONST(name, value) zend_declare_class_constant_long( IntlDateFormatter_ce_ptr, ZEND_STRS( name ) - 1, value ); - #define DATEFORMATTER_EXPOSE_UCAL_CLASS_CONST(x) zend_declare_class_constant_long( IntlDateFormatter_ce_ptr, ZEND_STRS( #x ) - 1, UCAL_##x TSRMLS_CC ); + #define DATEFORMATTER_EXPOSE_UCAL_CLASS_CONST(x) zend_declare_class_constant_long( IntlDateFormatter_ce_ptr, ZEND_STRS( #x ) - 1, UCAL_##x ); /* UDateFormatStyle constants */ DATEFORMATTER_EXPOSE_CLASS_CONST( FULL ); @@ -74,11 +74,11 @@ PHP_FUNCTION( datefmt_get_error_code ) DATE_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, IntlDateFormatter_ce_ptr ) == FAILURE ) { intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, - "datefmt_get_error_code: unable to parse input params", 0 TSRMLS_CC ); + "datefmt_get_error_code: unable to parse input params", 0 ); RETURN_FALSE; } @@ -100,11 +100,11 @@ PHP_FUNCTION( datefmt_get_error_message ) DATE_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, IntlDateFormatter_ce_ptr ) == FAILURE ) { intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, - "datefmt_get_error_message: unable to parse input params", 0 TSRMLS_CC ); + "datefmt_get_error_message: unable to parse input params", 0 ); RETURN_FALSE; } @@ -112,7 +112,7 @@ PHP_FUNCTION( datefmt_get_error_message ) dfo = Z_INTL_DATEFORMATTER_P( object ); /* Return last error message. */ - message = intl_error_get_message( INTL_DATA_ERROR_P(dfo) TSRMLS_CC ); + message = intl_error_get_message( INTL_DATA_ERROR_P(dfo) ); RETURN_STR( message); } /* }}} */ diff --git a/ext/intl/dateformat/dateformat_attr.c b/ext/intl/dateformat/dateformat_attr.c index 314ae730c7..ee8b91dbed 100644 --- a/ext/intl/dateformat/dateformat_attr.c +++ b/ext/intl/dateformat/dateformat_attr.c @@ -36,10 +36,10 @@ PHP_FUNCTION( datefmt_get_datetype ) DATE_FORMAT_METHOD_INIT_VARS; /* Parse parameters. */ - if( zend_parse_method_parameters( ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &object, IntlDateFormatter_ce_ptr ) == FAILURE ) + if( zend_parse_method_parameters( ZEND_NUM_ARGS(), getThis(), "O", &object, IntlDateFormatter_ce_ptr ) == FAILURE ) { intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, - "datefmt_get_datetype: unable to parse input params", 0 TSRMLS_CC ); + "datefmt_get_datetype: unable to parse input params", 0 ); RETURN_FALSE; } @@ -62,10 +62,10 @@ PHP_FUNCTION( datefmt_get_timetype ) DATE_FORMAT_METHOD_INIT_VARS; /* Parse parameters. */ - if( zend_parse_method_parameters( ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &object, IntlDateFormatter_ce_ptr ) == FAILURE ) + if( zend_parse_method_parameters( ZEND_NUM_ARGS(), getThis(), "O", &object, IntlDateFormatter_ce_ptr ) == FAILURE ) { intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, - "datefmt_get_timetype: unable to parse input params", 0 TSRMLS_CC ); + "datefmt_get_timetype: unable to parse input params", 0 ); RETURN_FALSE; } @@ -93,10 +93,10 @@ PHP_FUNCTION( datefmt_get_pattern ) DATE_FORMAT_METHOD_INIT_VARS; /* Parse parameters. */ - if( zend_parse_method_parameters( ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &object, IntlDateFormatter_ce_ptr ) == FAILURE ) + if( zend_parse_method_parameters( ZEND_NUM_ARGS(), getThis(), "O", &object, IntlDateFormatter_ce_ptr ) == FAILURE ) { intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, - "datefmt_get_pattern: unable to parse input params", 0 TSRMLS_CC ); + "datefmt_get_pattern: unable to parse input params", 0 ); RETURN_FALSE; } @@ -137,11 +137,11 @@ PHP_FUNCTION( datefmt_set_pattern ) DATE_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, IntlDateFormatter_ce_ptr, &value, &value_len ) == FAILURE ) { intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, - "datefmt_set_pattern: unable to parse input params", 0 TSRMLS_CC); + "datefmt_set_pattern: unable to parse input params", 0); RETURN_FALSE; } @@ -175,11 +175,11 @@ PHP_FUNCTION( datefmt_get_locale ) DATE_FORMAT_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(), getThis(), "O|l", &object, IntlDateFormatter_ce_ptr,&loc_type) == FAILURE ) { intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, - "datefmt_get_locale: unable to parse input params", 0 TSRMLS_CC ); + "datefmt_get_locale: unable to parse input params", 0 ); RETURN_FALSE; } @@ -204,11 +204,11 @@ PHP_FUNCTION( datefmt_is_lenient ) DATE_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, IntlDateFormatter_ce_ptr ) == FAILURE ) { intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, - "datefmt_is_lenient: unable to parse input params", 0 TSRMLS_CC ); + "datefmt_is_lenient: unable to parse input params", 0 ); RETURN_FALSE; } @@ -232,11 +232,11 @@ PHP_FUNCTION( datefmt_set_lenient ) DATE_FORMAT_METHOD_INIT_VARS; /* Parse parameters. */ - if( zend_parse_method_parameters( ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Ob", + if( zend_parse_method_parameters( ZEND_NUM_ARGS(), getThis(), "Ob", &object, IntlDateFormatter_ce_ptr,&isLenient ) == FAILURE ) { intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, - "datefmt_set_lenient: unable to parse input params", 0 TSRMLS_CC ); + "datefmt_set_lenient: unable to parse input params", 0 ); RETURN_FALSE; } diff --git a/ext/intl/dateformat/dateformat_attrcpp.cpp b/ext/intl/dateformat/dateformat_attrcpp.cpp index 71b136c6c1..52df471a10 100644 --- a/ext/intl/dateformat/dateformat_attrcpp.cpp +++ b/ext/intl/dateformat/dateformat_attrcpp.cpp @@ -48,10 +48,10 @@ U_CFUNC PHP_FUNCTION(datefmt_get_timezone_id) int str_len; DATE_FORMAT_METHOD_INIT_VARS; - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", + if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O", &object, IntlDateFormatter_ce_ptr ) == FAILURE) { intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, "datefmt_get_timezone_" - "id: unable to parse input params", 0 TSRMLS_CC); + "id: unable to parse input params", 0); RETURN_FALSE; } @@ -76,10 +76,10 @@ U_CFUNC PHP_FUNCTION(datefmt_get_timezone) { DATE_FORMAT_METHOD_INIT_VARS; - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", + if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O", &object, IntlDateFormatter_ce_ptr ) == FAILURE) { intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, - "datefmt_get_timezone: unable to parse input params", 0 TSRMLS_CC ); + "datefmt_get_timezone: unable to parse input params", 0 ); RETURN_FALSE; } @@ -90,17 +90,17 @@ U_CFUNC PHP_FUNCTION(datefmt_get_timezone) if (tz_clone == NULL) { intl_errors_set(INTL_DATA_ERROR_P(dfo), U_MEMORY_ALLOCATION_ERROR, "datefmt_get_timezone: Out of memory when cloning time zone", - 0 TSRMLS_CC); + 0); RETURN_FALSE; } object_init_ex(return_value, TimeZone_ce_ptr); - timezone_object_construct(tz_clone, return_value, 1 TSRMLS_CC); + timezone_object_construct(tz_clone, return_value, 1); } U_CFUNC PHP_FUNCTION(datefmt_set_timezone_id) { - php_error_docref0(NULL TSRMLS_CC, E_DEPRECATED, + php_error_docref0(NULL, E_DEPRECATED, "Use datefmt_set_timezone() instead, which also accepts a plain " "time zone identifier and for which this function is now an " "alias"); @@ -119,17 +119,17 @@ U_CFUNC PHP_FUNCTION(datefmt_set_timezone) DATE_FORMAT_METHOD_INIT_VARS; - if ( zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), + if ( zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Oz", &object, IntlDateFormatter_ce_ptr, &timezone_zv) == FAILURE) { intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, "datefmt_set_timezone: " - "unable to parse input params", 0 TSRMLS_CC); + "unable to parse input params", 0); RETURN_FALSE; } DATE_FORMAT_METHOD_FETCH_OBJECT; timezone = timezone_process_timezone_argument(timezone_zv, - INTL_DATA_ERROR_P(dfo), "datefmt_set_timezone" TSRMLS_CC); + INTL_DATA_ERROR_P(dfo), "datefmt_set_timezone"); if (timezone == NULL) { RETURN_FALSE; } @@ -146,10 +146,10 @@ U_CFUNC PHP_FUNCTION(datefmt_get_calendar) { DATE_FORMAT_METHOD_INIT_VARS; - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", + if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O", &object, IntlDateFormatter_ce_ptr ) == FAILURE) { intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, - "datefmt_get_calendar: unable to parse input params", 0 TSRMLS_CC); + "datefmt_get_calendar: unable to parse input params", 0); RETURN_FALSE; } @@ -173,11 +173,11 @@ U_CFUNC PHP_FUNCTION(datefmt_get_calendar_object) { DATE_FORMAT_METHOD_INIT_VARS; - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", + if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O", &object, IntlDateFormatter_ce_ptr ) == FAILURE) { intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, "datefmt_get_calendar_object: unable to parse input params", - 0 TSRMLS_CC); + 0); RETURN_FALSE; } @@ -192,11 +192,11 @@ U_CFUNC PHP_FUNCTION(datefmt_get_calendar_object) if (cal_clone == NULL) { intl_errors_set(INTL_DATA_ERROR_P(dfo), U_MEMORY_ALLOCATION_ERROR, "datefmt_get_calendar_object: Out of memory when cloning " - "calendar", 0 TSRMLS_CC); + "calendar", 0); RETURN_FALSE; } - calendar_object_create(return_value, cal_clone TSRMLS_CC); + calendar_object_create(return_value, cal_clone); } /* }}} */ @@ -210,10 +210,10 @@ U_CFUNC PHP_FUNCTION(datefmt_set_calendar) zval *calendar_zv; DATE_FORMAT_METHOD_INIT_VARS; - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Oz", + if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Oz", &object, IntlDateFormatter_ce_ptr, &calendar_zv) == FAILURE) { intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, - "datefmt_set_calendar: unable to parse input params", 0 TSRMLS_CC); + "datefmt_set_calendar: unable to parse input params", 0); RETURN_FALSE; } @@ -229,7 +229,7 @@ U_CFUNC PHP_FUNCTION(datefmt_set_calendar) if (datefmt_process_calendar_arg(calendar_zv, locale, "datefmt_set_calendar", INTL_DATA_ERROR_P(dfo), cal, cal_type, - cal_owned TSRMLS_CC) == FAILURE) { + cal_owned) == FAILURE) { RETURN_FALSE; } @@ -239,7 +239,7 @@ U_CFUNC PHP_FUNCTION(datefmt_set_calendar) if (old_timezone == NULL) { intl_errors_set(INTL_DATA_ERROR_P(dfo), U_MEMORY_ALLOCATION_ERROR, "datefmt_set_calendar: Out of memory when cloning calendar", - 0 TSRMLS_CC); + 0); delete cal; RETURN_FALSE; } @@ -249,7 +249,7 @@ U_CFUNC PHP_FUNCTION(datefmt_set_calendar) if (cal == NULL) { intl_errors_set(INTL_DATA_ERROR_P(dfo), U_MEMORY_ALLOCATION_ERROR, "datefmt_set_calendar: Out of memory when cloning calendar", - 0 TSRMLS_CC); + 0); RETURN_FALSE; } } diff --git a/ext/intl/dateformat/dateformat_class.c b/ext/intl/dateformat/dateformat_class.c index 0d93338ecd..ef63929a43 100644 --- a/ext/intl/dateformat/dateformat_class.c +++ b/ext/intl/dateformat/dateformat_class.c @@ -35,35 +35,35 @@ static zend_object_handlers IntlDateFormatter_handlers; */ /* {{{ IntlDateFormatter_objects_dtor */ -static void IntlDateFormatter_object_dtor(zend_object *object TSRMLS_DC ) +static void IntlDateFormatter_object_dtor(zend_object *object ) { - zend_objects_destroy_object( object TSRMLS_CC ); + zend_objects_destroy_object( object ); } /* }}} */ /* {{{ IntlDateFormatter_objects_free */ -void IntlDateFormatter_object_free( zend_object *object TSRMLS_DC ) +void IntlDateFormatter_object_free( zend_object *object ) { IntlDateFormatter_object* dfo = php_intl_dateformatter_fetch_object(object); - zend_object_std_dtor( &dfo->zo TSRMLS_CC ); + zend_object_std_dtor( &dfo->zo ); if (dfo->requested_locale) { efree( dfo->requested_locale ); } - dateformat_data_free( &dfo->datef_data TSRMLS_CC ); + dateformat_data_free( &dfo->datef_data ); } /* }}} */ /* {{{ IntlDateFormatter_object_create */ -zend_object *IntlDateFormatter_object_create(zend_class_entry *ce TSRMLS_DC) +zend_object *IntlDateFormatter_object_create(zend_class_entry *ce) { IntlDateFormatter_object* intern; intern = ecalloc( 1, sizeof(IntlDateFormatter_object) + sizeof(zval) * (ce->default_properties_count - 1) ); - dateformat_data_init( &intern->datef_data TSRMLS_CC ); - zend_object_std_init( &intern->zo, ce TSRMLS_CC ); + dateformat_data_init( &intern->datef_data ); + zend_object_std_init( &intern->zo, ce ); object_properties_init(&intern->zo, ce); intern->date_type = 0; intern->time_type = 0; @@ -78,28 +78,28 @@ zend_object *IntlDateFormatter_object_create(zend_class_entry *ce TSRMLS_DC) /* }}} */ /* {{{ IntlDateFormatter_object_clone */ -zend_object *IntlDateFormatter_object_clone(zval *object TSRMLS_DC) +zend_object *IntlDateFormatter_object_clone(zval *object) { IntlDateFormatter_object *dfo, *new_dfo; zend_object *new_obj; DATE_FORMAT_METHOD_FETCH_OBJECT_NO_CHECK; - new_obj = IntlDateFormatter_ce_ptr->create_object(Z_OBJCE_P(object) TSRMLS_CC); + new_obj = IntlDateFormatter_ce_ptr->create_object(Z_OBJCE_P(object)); new_dfo = php_intl_dateformatter_fetch_object(new_obj); /* clone standard parts */ - zend_objects_clone_members(&new_dfo->zo, &dfo->zo TSRMLS_CC); + zend_objects_clone_members(&new_dfo->zo, &dfo->zo); /* clone formatter object */ if (dfo->datef_data.udatf != NULL) { DATE_FORMAT_OBJECT(new_dfo) = udat_clone(DATE_FORMAT_OBJECT(dfo), &INTL_DATA_ERROR_CODE(dfo)); if (U_FAILURE(INTL_DATA_ERROR_CODE(dfo))) { /* set up error in case error handler is interested */ intl_errors_set(INTL_DATA_ERROR_P(dfo), INTL_DATA_ERROR_CODE(dfo), - "Failed to clone IntlDateFormatter object", 0 TSRMLS_CC ); - zend_throw_exception(NULL, "Failed to clone IntlDateFormatter object", 0 TSRMLS_CC); + "Failed to clone IntlDateFormatter object", 0 ); + zend_throw_exception(NULL, "Failed to clone IntlDateFormatter object", 0); } } else { - zend_throw_exception(NULL, "Cannot clone unconstructed IntlDateFormatter", 0 TSRMLS_CC); + zend_throw_exception(NULL, "Cannot clone unconstructed IntlDateFormatter", 0); } return new_obj; } @@ -188,14 +188,14 @@ static zend_function_entry IntlDateFormatter_class_functions[] = { /* {{{ dateformat_register_class * Initialize 'IntlDateFormatter' class */ -void dateformat_register_IntlDateFormatter_class( TSRMLS_D ) +void dateformat_register_IntlDateFormatter_class( void ) { zend_class_entry ce; /* Create and register 'IntlDateFormatter' class. */ INIT_CLASS_ENTRY( ce, "IntlDateFormatter", IntlDateFormatter_class_functions ); ce.create_object = IntlDateFormatter_object_create; - IntlDateFormatter_ce_ptr = zend_register_internal_class( &ce TSRMLS_CC ); + IntlDateFormatter_ce_ptr = zend_register_internal_class( &ce ); memcpy(&IntlDateFormatter_handlers, zend_get_std_object_handlers(), sizeof IntlDateFormatter_handlers); diff --git a/ext/intl/dateformat/dateformat_class.h b/ext/intl/dateformat/dateformat_class.h index ebd057022e..e96a20b5ee 100644 --- a/ext/intl/dateformat/dateformat_class.h +++ b/ext/intl/dateformat/dateformat_class.h @@ -37,7 +37,7 @@ static inline IntlDateFormatter_object *php_intl_dateformatter_fetch_object(zend } #define Z_INTL_DATEFORMATTER_P(zv) php_intl_dateformatter_fetch_object(Z_OBJ_P(zv)) -void dateformat_register_IntlDateFormatter_class( TSRMLS_D ); +void dateformat_register_IntlDateFormatter_class( void ); extern zend_class_entry *IntlDateFormatter_ce_ptr; /* Auxiliary macros */ @@ -48,7 +48,7 @@ extern zend_class_entry *IntlDateFormatter_ce_ptr; DATE_FORMAT_METHOD_FETCH_OBJECT_NO_CHECK; \ if (dfo->datef_data.udatf == NULL) \ { \ - intl_errors_set(&dfo->datef_data.error, U_ILLEGAL_ARGUMENT_ERROR, "Found unconstructed IntlDateFormatter", 0 TSRMLS_CC); \ + intl_errors_set(&dfo->datef_data.error, U_ILLEGAL_ARGUMENT_ERROR, "Found unconstructed IntlDateFormatter", 0); \ RETURN_FALSE; \ } diff --git a/ext/intl/dateformat/dateformat_create.cpp b/ext/intl/dateformat/dateformat_create.cpp index 4a272aa45f..9a90029ca1 100644 --- a/ext/intl/dateformat/dateformat_create.cpp +++ b/ext/intl/dateformat/dateformat_create.cpp @@ -58,21 +58,21 @@ static void datefmt_ctor(INTERNAL_FUNCTION_PARAMETERS) int slength = 0; IntlDateFormatter_object* dfo; - intl_error_reset(NULL TSRMLS_CC); + intl_error_reset(NULL); object = return_value; /* Parse parameters. */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sll|zzs", + if (zend_parse_parameters(ZEND_NUM_ARGS(), "sll|zzs", &locale_str, &locale_len, &date_type, &time_type, &timezone_zv, &calendar_zv, &pattern_str, &pattern_str_len) == FAILURE) { intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, "datefmt_create: " - "unable to parse input parameters", 0 TSRMLS_CC); + "unable to parse input parameters", 0); Z_OBJ_P(return_value) = NULL; return; } INTL_CHECK_LOCALE_LEN_OBJ(locale_len, return_value); if (locale_len == 0) { - locale_str = intl_locale_get_default(TSRMLS_C); + locale_str = intl_locale_get_default(); } locale = Locale::createFromName(locale_str); @@ -80,14 +80,14 @@ static void datefmt_ctor(INTERNAL_FUNCTION_PARAMETERS) if (DATE_FORMAT_OBJECT(dfo) != NULL) { intl_errors_set(INTL_DATA_ERROR_P(dfo), U_ILLEGAL_ARGUMENT_ERROR, - "datefmt_create: cannot call constructor twice", 0 TSRMLS_CC); + "datefmt_create: cannot call constructor twice", 0); return; } /* process calendar */ if (datefmt_process_calendar_arg(calendar_zv, locale, "datefmt_create", INTL_DATA_ERROR_P(dfo), calendar, calendar_type, - calendar_owned TSRMLS_CC) + calendar_owned) == FAILURE) { goto error; } @@ -98,7 +98,7 @@ static void datefmt_ctor(INTERNAL_FUNCTION_PARAMETERS) if (explicit_tz || calendar_owned ) { //we have an explicit time zone or a non-object calendar timezone = timezone_process_timezone_argument(timezone_zv, - INTL_DATA_ERROR_P(dfo), "datefmt_create" TSRMLS_CC); + INTL_DATA_ERROR_P(dfo), "datefmt_create"); if (timezone == NULL) { goto error; } @@ -111,7 +111,7 @@ static void datefmt_ctor(INTERNAL_FUNCTION_PARAMETERS) if (U_FAILURE(INTL_DATA_ERROR_CODE(dfo))) { /* object construction -> only set global error */ intl_error_set(NULL, INTL_DATA_ERROR_CODE(dfo), "datefmt_create: " - "error converting pattern to UTF-16", 0 TSRMLS_CC); + "error converting pattern to UTF-16", 0); goto error; } } @@ -140,7 +140,7 @@ static void datefmt_ctor(INTERNAL_FUNCTION_PARAMETERS) } } else { intl_error_set(NULL, INTL_DATA_ERROR_CODE(dfo), "datefmt_create: date " - "formatter creation failed", 0 TSRMLS_CC); + "formatter creation failed", 0); goto error; } @@ -160,7 +160,7 @@ error: if (calendar != NULL && calendar_owned) { delete calendar; } - if (U_FAILURE(intl_error_get_code(NULL TSRMLS_CC))) { + if (U_FAILURE(intl_error_get_code(NULL))) { /* free_object handles partially constructed instances fine */ Z_OBJ_P(return_value) = NULL; } @@ -195,7 +195,7 @@ U_CFUNC PHP_METHOD( IntlDateFormatter, __construct ) datefmt_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/dateformat/dateformat_data.c b/ext/intl/dateformat/dateformat_data.c index 509e91b617..04d37aa7ac 100644 --- a/ext/intl/dateformat/dateformat_data.c +++ b/ext/intl/dateformat/dateformat_data.c @@ -22,20 +22,20 @@ /* {{{ void dateformat_data_init( dateformat_data* datef_data ) * Initialize internals of dateformat_data. */ -void dateformat_data_init( dateformat_data* datef_data TSRMLS_DC ) +void dateformat_data_init( dateformat_data* datef_data ) { if( !datef_data ) return; datef_data->udatf = NULL; - intl_error_reset( &datef_data->error TSRMLS_CC ); + intl_error_reset( &datef_data->error ); } /* }}} */ /* {{{ void dateformat_data_free( dateformat_data* datef_data ) * Clean up memory allocated for dateformat_data */ -void dateformat_data_free( dateformat_data* datef_data TSRMLS_DC ) +void dateformat_data_free( dateformat_data* datef_data ) { if( !datef_data ) return; @@ -44,18 +44,18 @@ void dateformat_data_free( dateformat_data* datef_data TSRMLS_DC ) udat_close( datef_data->udatf ); datef_data->udatf = NULL; - intl_error_reset( &datef_data->error TSRMLS_CC ); + intl_error_reset( &datef_data->error ); } /* }}} */ /* {{{ dateformat_data* dateformat_data_create() * Allocate memory for dateformat_data and initialize it with default values. */ -dateformat_data* dateformat_data_create( TSRMLS_D ) +dateformat_data* dateformat_data_create( void ) { dateformat_data* datef_data = ecalloc( 1, sizeof(dateformat_data) ); - dateformat_data_init( datef_data TSRMLS_CC ); + dateformat_data_init( datef_data ); return datef_data; } diff --git a/ext/intl/dateformat/dateformat_data.h b/ext/intl/dateformat/dateformat_data.h index a49da7dc89..aaf61e6266 100644 --- a/ext/intl/dateformat/dateformat_data.h +++ b/ext/intl/dateformat/dateformat_data.h @@ -30,8 +30,8 @@ typedef struct { UDateFormat * udatf; } dateformat_data; -dateformat_data* dateformat_data_create( TSRMLS_D ); -void dateformat_data_init( dateformat_data* datef_data TSRMLS_DC ); -void dateformat_data_free( dateformat_data* datef_data TSRMLS_DC ); +dateformat_data* dateformat_data_create( void ); +void dateformat_data_init( dateformat_data* datef_data ); +void dateformat_data_free( dateformat_data* datef_data ); #endif // DATE_FORMAT_DATA_H diff --git a/ext/intl/dateformat/dateformat_format.c b/ext/intl/dateformat/dateformat_format.c index d11eb2df24..61c3627cb8 100644 --- a/ext/intl/dateformat/dateformat_format.c +++ b/ext/intl/dateformat/dateformat_format.c @@ -32,7 +32,7 @@ /* {{{ * Internal function which calls the udat_format */ -static void internal_format(IntlDateFormatter_object *dfo, UDate timestamp, zval *return_value TSRMLS_DC) +static void internal_format(IntlDateFormatter_object *dfo, UDate timestamp, zval *return_value) { UChar* formatted = NULL; int32_t resultlengthneeded =0 ; @@ -60,7 +60,7 @@ static void internal_format(IntlDateFormatter_object *dfo, UDate timestamp, zval * Internal function which fetches an element from the passed array for the key_name passed */ static int32_t internal_get_arr_ele(IntlDateFormatter_object *dfo, - HashTable* hash_arr, char* key_name, intl_error *err TSRMLS_DC) + HashTable* hash_arr, char* key_name, intl_error *err) { zval *ele_value = NULL; int32_t result = 0; @@ -74,7 +74,7 @@ static int32_t internal_get_arr_ele(IntlDateFormatter_object *dfo, if(Z_TYPE_P(ele_value) != IS_LONG) { spprintf(&message, 0, "datefmt_format: parameter array contains " "a non-integer element for key '%s'", key_name); - intl_errors_set(err, U_ILLEGAL_ARGUMENT_ERROR, message, 1 TSRMLS_CC); + intl_errors_set(err, U_ILLEGAL_ARGUMENT_ERROR, message, 1); efree(message); } else { if (Z_LVAL_P(ele_value) > INT32_MAX || @@ -82,7 +82,7 @@ static int32_t internal_get_arr_ele(IntlDateFormatter_object *dfo, spprintf(&message, 0, "datefmt_format: value %pd is out of " "bounds for a 32-bit integer in key '%s'", Z_LVAL_P(ele_value), key_name); - intl_errors_set(err, U_ILLEGAL_ARGUMENT_ERROR, message, 1 TSRMLS_CC); + intl_errors_set(err, U_ILLEGAL_ARGUMENT_ERROR, message, 1); efree(message); } else { result = Z_LVAL_P(ele_value); @@ -98,7 +98,7 @@ static int32_t internal_get_arr_ele(IntlDateFormatter_object *dfo, * Internal function which sets UCalendar from the passed array and retrieves timestamp */ static UDate internal_get_timestamp(IntlDateFormatter_object *dfo, - HashTable *hash_arr TSRMLS_DC) + HashTable *hash_arr) { int32_t year, month, @@ -111,7 +111,7 @@ static UDate internal_get_timestamp(IntlDateFormatter_object *dfo, intl_error *err = &dfo->datef_data.error; #define INTL_GET_ELEM(elem) \ - internal_get_arr_ele(dfo, hash_arr, (elem), err TSRMLS_CC) + internal_get_arr_ele(dfo, hash_arr, (elem), err) /* Fetch values from the incoming array */ year = INTL_GET_ELEM(CALENDAR_YEAR) + 1900; /* tm_year is years since 1900 */ @@ -130,7 +130,7 @@ static UDate internal_get_timestamp(IntlDateFormatter_object *dfo, if (INTL_DATA_ERROR_CODE(dfo) != U_ZERO_ERROR) { intl_errors_set(err, INTL_DATA_ERROR_CODE(dfo), "datefmt_format: " - "error cloning calendar", 0 TSRMLS_CC); + "error cloning calendar", 0); return 0; } @@ -158,10 +158,10 @@ PHP_FUNCTION(datefmt_format) DATE_FORMAT_METHOD_INIT_VARS; /* Parse parameters. */ - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Oz", + if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Oz", &object, IntlDateFormatter_ce_ptr, &zarg) == FAILURE) { intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, "datefmt_format: unable " - "to parse input params", 0 TSRMLS_CC ); + "to parse input params", 0 ); RETURN_FALSE; } @@ -173,17 +173,17 @@ PHP_FUNCTION(datefmt_format) RETURN_FALSE; } - timestamp = internal_get_timestamp(dfo, hash_arr TSRMLS_CC); + timestamp = internal_get_timestamp(dfo, hash_arr); INTL_METHOD_CHECK_STATUS(dfo, "datefmt_format: date formatting failed") } else { timestamp = intl_zval_to_millis(zarg, INTL_DATA_ERROR_P(dfo), - "datefmt_format" TSRMLS_CC); + "datefmt_format"); if (U_FAILURE(INTL_DATA_ERROR_CODE(dfo))) { RETURN_FALSE; } } - internal_format( dfo, timestamp, return_value TSRMLS_CC); + internal_format( dfo, timestamp, return_value); } /* }}} */ diff --git a/ext/intl/dateformat/dateformat_format_object.cpp b/ext/intl/dateformat/dateformat_format_object.cpp index b552ed7529..fe38a71287 100644 --- a/ext/intl/dateformat/dateformat_format_object.cpp +++ b/ext/intl/dateformat/dateformat_format_object.cpp @@ -73,13 +73,13 @@ U_CFUNC PHP_FUNCTION(datefmt_format_object) DateFormat::EStyle dateStyle = DateFormat::kDefault, timeStyle = DateFormat::kDefault; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "o|zs!", + if (zend_parse_parameters(ZEND_NUM_ARGS(), "o|zs!", &object, &format, &locale_str, &locale_len) == FAILURE) { RETURN_FALSE; } if (!locale_str) { - locale_str = intl_locale_get_default(TSRMLS_C); + locale_str = intl_locale_get_default(); } if (format == NULL || Z_TYPE_P(format) == IS_NULL) { @@ -91,7 +91,7 @@ U_CFUNC PHP_FUNCTION(datefmt_format_object) if (zend_hash_num_elements(ht) != 2) { intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, "datefmt_format_object: bad format; if array, it must have " - "two elements", 0 TSRMLS_CC); + "two elements", 0); RETURN_FALSE; } @@ -100,7 +100,7 @@ U_CFUNC PHP_FUNCTION(datefmt_format_object) if (!valid_format(z)) { intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, "datefmt_format_object: bad format; the date format (first " - "element of the array) is not valid", 0 TSRMLS_CC); + "element of the array) is not valid", 0); RETURN_FALSE; } dateStyle = (DateFormat::EStyle)Z_LVAL_P(z); @@ -110,7 +110,7 @@ U_CFUNC PHP_FUNCTION(datefmt_format_object) if (!valid_format(z)) { intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, "datefmt_format_object: bad format; the time format (" - "second element of the array) is not valid", 0 TSRMLS_CC); + "second element of the array) is not valid", 0); RETURN_FALSE; } timeStyle = (DateFormat::EStyle)Z_LVAL_P(z); @@ -118,7 +118,7 @@ U_CFUNC PHP_FUNCTION(datefmt_format_object) if (!valid_format(format)) { intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, "datefmt_format_object: the date/time format type is invalid", - 0 TSRMLS_CC); + 0); RETURN_FALSE; } dateStyle = timeStyle = (DateFormat::EStyle)Z_LVAL_P(format); @@ -126,7 +126,7 @@ U_CFUNC PHP_FUNCTION(datefmt_format_object) convert_to_string_ex(format); if (Z_STRLEN_P(format) == 0) { intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, - "datefmt_format_object: the format is empty", 0 TSRMLS_CC); + "datefmt_format_object: the format is empty", 0); RETURN_FALSE; } pattern = true; @@ -136,12 +136,12 @@ U_CFUNC PHP_FUNCTION(datefmt_format_object) timeStyle = (DateFormat::EStyle)(timeStyle & ~DateFormat::kRelative); zend_class_entry *instance_ce = Z_OBJCE_P(object); - if (instanceof_function(instance_ce, Calendar_ce_ptr TSRMLS_CC)) { - Calendar *obj_cal = calendar_fetch_native_calendar(object TSRMLS_CC); + if (instanceof_function(instance_ce, Calendar_ce_ptr)) { + Calendar *obj_cal = calendar_fetch_native_calendar(object); if (obj_cal == NULL) { intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, "datefmt_format_object: bad IntlCalendar instance: " - "not initialized properly", 0 TSRMLS_CC); + "not initialized properly", 0); RETURN_FALSE; } timeZone = obj_cal->getTimeZone().clone(); @@ -149,28 +149,28 @@ U_CFUNC PHP_FUNCTION(datefmt_format_object) if (U_FAILURE(status)) { intl_error_set(NULL, status, "datefmt_format_object: error obtaining instant from " - "IntlCalendar", 0 TSRMLS_CC); + "IntlCalendar", 0); RETVAL_FALSE; goto cleanup; } cal = obj_cal->clone(); - } else if (instanceof_function(instance_ce, php_date_get_date_ce() TSRMLS_CC)) { + } else if (instanceof_function(instance_ce, php_date_get_date_ce())) { if (intl_datetime_decompose(object, &date, &timeZone, NULL, - "datefmt_format_object" TSRMLS_CC) == FAILURE) { + "datefmt_format_object") == FAILURE) { RETURN_FALSE; } cal = new GregorianCalendar(Locale::createFromName(locale_str), status); if (U_FAILURE(status)) { intl_error_set(NULL, status, "datefmt_format_object: could not create GregorianCalendar", - 0 TSRMLS_CC); + 0); RETVAL_FALSE; goto cleanup; } } else { intl_error_set(NULL, status, "datefmt_format_object: the passed object " "must be an instance of either IntlCalendar or DateTime", - 0 TSRMLS_CC); + 0); RETURN_FALSE; } @@ -184,7 +184,7 @@ U_CFUNC PHP_FUNCTION(datefmt_format_object) if (U_FAILURE(status)) { intl_error_set(NULL, status, "datefmt_format_object: could not create SimpleDateFormat", - 0 TSRMLS_CC); + 0); RETVAL_FALSE; goto cleanup; } @@ -195,7 +195,7 @@ U_CFUNC PHP_FUNCTION(datefmt_format_object) if (df == NULL) { /* according to ICU sources, this should never happen */ intl_error_set(NULL, status, "datefmt_format_object: could not create DateFormat", - 0 TSRMLS_CC); + 0); RETVAL_FALSE; goto cleanup; } @@ -216,7 +216,7 @@ U_CFUNC PHP_FUNCTION(datefmt_format_object) if (intl_charFromString(result, &ret_str, &ret_str_len, &status) == FAILURE) { intl_error_set(NULL, status, "datefmt_format_object: error converting result to UTF-8", - 0 TSRMLS_CC); + 0); RETVAL_FALSE; goto cleanup; } diff --git a/ext/intl/dateformat/dateformat_helpers.cpp b/ext/intl/dateformat/dateformat_helpers.cpp index b3f134a4f1..959afa8d82 100644 --- a/ext/intl/dateformat/dateformat_helpers.cpp +++ b/ext/intl/dateformat/dateformat_helpers.cpp @@ -34,7 +34,7 @@ int datefmt_process_calendar_arg(zval* calendar_zv, intl_error *err, Calendar*& cal, zend_long& cal_int_type, - bool& calendar_owned TSRMLS_DC) + bool& calendar_owned) { char *msg; UErrorCode status = UErrorCode(); @@ -56,7 +56,7 @@ int datefmt_process_calendar_arg(zval* calendar_zv, "calendar) or IntlDateFormatter::GREGORIAN. " "Alternatively, it can be an IntlCalendar object", func_name); - intl_errors_set(err, U_ILLEGAL_ARGUMENT_ERROR, msg, 1 TSRMLS_CC); + intl_errors_set(err, U_ILLEGAL_ARGUMENT_ERROR, msg, 1); efree(msg); return FAILURE; } else if (v == (zend_long)UCAL_TRADITIONAL) { @@ -70,13 +70,13 @@ int datefmt_process_calendar_arg(zval* calendar_zv, } else if (Z_TYPE_P(calendar_zv) == IS_OBJECT && instanceof_function_ex(Z_OBJCE_P(calendar_zv), - Calendar_ce_ptr, 0 TSRMLS_CC)) { + Calendar_ce_ptr, 0)) { - cal = calendar_fetch_native_calendar(calendar_zv TSRMLS_CC); + cal = calendar_fetch_native_calendar(calendar_zv); if (cal == NULL) { spprintf(&msg, 0, "%s: Found unconstructed IntlCalendar object", func_name); - intl_errors_set(err, U_ILLEGAL_ARGUMENT_ERROR, msg, 1 TSRMLS_CC); + intl_errors_set(err, U_ILLEGAL_ARGUMENT_ERROR, msg, 1); efree(msg); return FAILURE; } @@ -87,7 +87,7 @@ int datefmt_process_calendar_arg(zval* calendar_zv, } else { spprintf(&msg, 0, "%s: Invalid calendar argument; should be an integer " "or an IntlCalendar instance", func_name); - intl_errors_set(err, U_ILLEGAL_ARGUMENT_ERROR, msg, 1 TSRMLS_CC); + intl_errors_set(err, U_ILLEGAL_ARGUMENT_ERROR, msg, 1); efree(msg); return FAILURE; } @@ -97,7 +97,7 @@ int datefmt_process_calendar_arg(zval* calendar_zv, } if (U_FAILURE(status)) { spprintf(&msg, 0, "%s: Failure instantiating calendar", func_name); - intl_errors_set(err, U_ILLEGAL_ARGUMENT_ERROR, msg, 1 TSRMLS_CC); + intl_errors_set(err, U_ILLEGAL_ARGUMENT_ERROR, msg, 1); efree(msg); return FAILURE; } diff --git a/ext/intl/dateformat/dateformat_helpers.h b/ext/intl/dateformat/dateformat_helpers.h index c6121d75bb..eb90c99169 100644 --- a/ext/intl/dateformat/dateformat_helpers.h +++ b/ext/intl/dateformat/dateformat_helpers.h @@ -33,7 +33,7 @@ int datefmt_process_calendar_arg(zval* calendar_zv, intl_error *err, Calendar*& cal, zend_long& cal_int_type, - bool& calendar_owned TSRMLS_DC); + bool& calendar_owned); #endif /* DATEFORMAT_HELPERS_H */ diff --git a/ext/intl/dateformat/dateformat_parse.c b/ext/intl/dateformat/dateformat_parse.c index 15279da3a1..7d12f877e7 100644 --- a/ext/intl/dateformat/dateformat_parse.c +++ b/ext/intl/dateformat/dateformat_parse.c @@ -34,7 +34,7 @@ * if set to 1 - store any error encountered in the parameter parse_error * if set to 0 - no need to store any error encountered in the parameter parse_error */ -static void internal_parse_to_timestamp(IntlDateFormatter_object *dfo, char* text_to_parse, int32_t text_len, int32_t *parse_pos, zval *return_value TSRMLS_DC) +static void internal_parse_to_timestamp(IntlDateFormatter_object *dfo, char* text_to_parse, int32_t text_len, int32_t *parse_pos, zval *return_value) { double result = 0; UDate timestamp =0; @@ -62,7 +62,7 @@ static void internal_parse_to_timestamp(IntlDateFormatter_object *dfo, char* tex } /* }}} */ -static void add_to_localtime_arr( IntlDateFormatter_object *dfo, zval* return_value, const UCalendar *parsed_calendar, zend_long calendar_field, char* key_name TSRMLS_DC) +static void add_to_localtime_arr( IntlDateFormatter_object *dfo, zval* return_value, const UCalendar *parsed_calendar, zend_long calendar_field, char* key_name) { zend_long calendar_field_val = ucal_get( parsed_calendar, calendar_field, &INTL_DATA_ERROR_CODE(dfo)); INTL_METHOD_CHECK_STATUS( dfo, "Date parsing - localtime failed : could not get a field from calendar" ); @@ -81,7 +81,7 @@ static void add_to_localtime_arr( IntlDateFormatter_object *dfo, zval* return_va /* {{{ * Internal function which calls the udat_parseCalendar */ -static void internal_parse_to_localtime(IntlDateFormatter_object *dfo, char* text_to_parse, int32_t text_len, int32_t *parse_pos, zval *return_value TSRMLS_DC) +static void internal_parse_to_localtime(IntlDateFormatter_object *dfo, char* text_to_parse, int32_t text_len, int32_t *parse_pos, zval *return_value) { UCalendar *parsed_calendar = NULL; UChar* text_utf16 = NULL; @@ -104,14 +104,14 @@ static void internal_parse_to_localtime(IntlDateFormatter_object *dfo, char* tex array_init( return_value ); /* Add entries from various fields of the obtained parsed_calendar */ - add_to_localtime_arr( dfo, return_value, parsed_calendar, UCAL_SECOND, CALENDAR_SEC TSRMLS_CC); - add_to_localtime_arr( dfo, return_value, parsed_calendar, UCAL_MINUTE, CALENDAR_MIN TSRMLS_CC); - add_to_localtime_arr( dfo, return_value, parsed_calendar, UCAL_HOUR_OF_DAY, CALENDAR_HOUR TSRMLS_CC); - add_to_localtime_arr( dfo, return_value, parsed_calendar, UCAL_YEAR, CALENDAR_YEAR TSRMLS_CC); - add_to_localtime_arr( dfo, return_value, parsed_calendar, UCAL_DAY_OF_MONTH, CALENDAR_MDAY TSRMLS_CC); - add_to_localtime_arr( dfo, return_value, parsed_calendar, UCAL_DAY_OF_WEEK, CALENDAR_WDAY TSRMLS_CC); - add_to_localtime_arr( dfo, return_value, parsed_calendar, UCAL_DAY_OF_YEAR, CALENDAR_YDAY TSRMLS_CC); - add_to_localtime_arr( dfo, return_value, parsed_calendar, UCAL_MONTH, CALENDAR_MON TSRMLS_CC); + add_to_localtime_arr( dfo, return_value, parsed_calendar, UCAL_SECOND, CALENDAR_SEC); + add_to_localtime_arr( dfo, return_value, parsed_calendar, UCAL_MINUTE, CALENDAR_MIN); + add_to_localtime_arr( dfo, return_value, parsed_calendar, UCAL_HOUR_OF_DAY, CALENDAR_HOUR); + add_to_localtime_arr( dfo, return_value, parsed_calendar, UCAL_YEAR, CALENDAR_YEAR); + add_to_localtime_arr( dfo, return_value, parsed_calendar, UCAL_DAY_OF_MONTH, CALENDAR_MDAY); + add_to_localtime_arr( dfo, return_value, parsed_calendar, UCAL_DAY_OF_WEEK, CALENDAR_WDAY); + add_to_localtime_arr( dfo, return_value, parsed_calendar, UCAL_DAY_OF_YEAR, CALENDAR_YDAY); + add_to_localtime_arr( dfo, return_value, parsed_calendar, UCAL_MONTH, CALENDAR_MON); /* Is in DST? */ isInDST = ucal_inDaylightTime(parsed_calendar , &INTL_DATA_ERROR_CODE(dfo)); @@ -135,9 +135,9 @@ PHP_FUNCTION(datefmt_parse) DATE_FORMAT_METHOD_INIT_VARS; /* Parse parameters. */ - if( zend_parse_method_parameters( ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os|z/!", + if( zend_parse_method_parameters( ZEND_NUM_ARGS(), getThis(), "Os|z/!", &object, IntlDateFormatter_ce_ptr, &text_to_parse, &text_len, &z_parse_pos ) == FAILURE ){ - intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, "datefmt_parse: unable to parse input params", 0 TSRMLS_CC ); + intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, "datefmt_parse: unable to parse input params", 0 ); RETURN_FALSE; } @@ -152,7 +152,7 @@ PHP_FUNCTION(datefmt_parse) RETURN_FALSE; } } - internal_parse_to_timestamp( dfo, text_to_parse, text_len, z_parse_pos?&parse_pos:NULL, return_value TSRMLS_CC); + internal_parse_to_timestamp( dfo, text_to_parse, text_len, z_parse_pos?&parse_pos:NULL, return_value); if(z_parse_pos) { zval_dtor(z_parse_pos); ZVAL_LONG(z_parse_pos, parse_pos); @@ -174,9 +174,9 @@ PHP_FUNCTION(datefmt_localtime) DATE_FORMAT_METHOD_INIT_VARS; /* Parse parameters. */ - if( zend_parse_method_parameters( ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os|z!", + if( zend_parse_method_parameters( ZEND_NUM_ARGS(), getThis(), "Os|z!", &object, IntlDateFormatter_ce_ptr, &text_to_parse, &text_len, &z_parse_pos ) == FAILURE ){ - intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, "datefmt_parse_to_localtime: unable to parse input params", 0 TSRMLS_CC ); + intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, "datefmt_parse_to_localtime: unable to parse input params", 0 ); RETURN_FALSE; } @@ -191,7 +191,7 @@ PHP_FUNCTION(datefmt_localtime) RETURN_FALSE; } } - internal_parse_to_localtime( dfo, text_to_parse, text_len, z_parse_pos?&parse_pos:NULL, return_value TSRMLS_CC); + internal_parse_to_localtime( dfo, text_to_parse, text_len, z_parse_pos?&parse_pos:NULL, return_value); if (z_parse_pos) { zval_dtor(z_parse_pos); ZVAL_LONG(z_parse_pos, parse_pos); diff --git a/ext/intl/formatter/formatter.c b/ext/intl/formatter/formatter.c index bb4d3d2ac5..63664ecc03 100644 --- a/ext/intl/formatter/formatter.c +++ b/ext/intl/formatter/formatter.c @@ -41,8 +41,8 @@ void formatter_register_constants( INIT_FUNC_ARGS ) } #define FORMATTER_EXPOSE_CONST(x) REGISTER_LONG_CONSTANT(#x, x, CONST_PERSISTENT | CONST_CS) - #define FORMATTER_EXPOSE_CLASS_CONST(x) zend_declare_class_constant_long( NumberFormatter_ce_ptr, ZEND_STRS( #x ) - 1, UNUM_##x TSRMLS_CC ); - #define FORMATTER_EXPOSE_CUSTOM_CLASS_CONST(name, value) zend_declare_class_constant_long( NumberFormatter_ce_ptr, ZEND_STRS( name ) - 1, value TSRMLS_CC ); + #define FORMATTER_EXPOSE_CLASS_CONST(x) zend_declare_class_constant_long( NumberFormatter_ce_ptr, ZEND_STRS( #x ) - 1, UNUM_##x ); + #define FORMATTER_EXPOSE_CUSTOM_CLASS_CONST(name, value) zend_declare_class_constant_long( NumberFormatter_ce_ptr, ZEND_STRS( name ) - 1, value ); /* UNumberFormatStyle constants */ FORMATTER_EXPOSE_CLASS_CONST( PATTERN_DECIMAL ); diff --git a/ext/intl/formatter/formatter_attr.c b/ext/intl/formatter/formatter_attr.c index 639342f4af..d3189df6d6 100644 --- a/ext/intl/formatter/formatter_attr.c +++ b/ext/intl/formatter/formatter_attr.c @@ -36,11 +36,11 @@ PHP_FUNCTION( numfmt_get_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(), getThis(), "Ol", &object, NumberFormatter_ce_ptr, &attribute ) == FAILURE ) { intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, - "numfmt_get_attribute: unable to parse input params", 0 TSRMLS_CC ); + "numfmt_get_attribute: unable to parse input params", 0 ); RETURN_FALSE; } @@ -109,11 +109,11 @@ 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(), getThis(), "Ol", &object, NumberFormatter_ce_ptr, &attribute ) == FAILURE ) { intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, - "numfmt_get_text_attribute: unable to parse input params", 0 TSRMLS_CC ); + "numfmt_get_text_attribute: unable to parse input params", 0 ); RETURN_FALSE; } @@ -150,11 +150,11 @@ PHP_FUNCTION( numfmt_set_attribute ) 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(), getThis(), "Olz", &object, NumberFormatter_ce_ptr, &attribute, &value ) == FAILURE) { intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, - "numfmt_set_attribute: unable to parse input params", 0 TSRMLS_CC ); + "numfmt_set_attribute: unable to parse input params", 0 ); RETURN_FALSE; } @@ -215,11 +215,11 @@ PHP_FUNCTION( numfmt_set_text_attribute ) 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(), getThis(), "Ols", &object, NumberFormatter_ce_ptr, &attribute, &value, &len ) == FAILURE) { intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, - "numfmt_set_text_attribute: unable to parse input params", 0 TSRMLS_CC ); + "numfmt_set_text_attribute: unable to parse input params", 0 ); RETURN_FALSE; } @@ -256,17 +256,17 @@ PHP_FUNCTION( numfmt_get_symbol ) 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(), getThis(), "Ol", &object, NumberFormatter_ce_ptr, &symbol ) == FAILURE ) { intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, - "numfmt_get_symbol: unable to parse input params", 0 TSRMLS_CC ); + "numfmt_get_symbol: unable to parse input params", 0 ); RETURN_FALSE; } if(symbol >= UNUM_FORMAT_SYMBOL_COUNT || symbol < 0) { - intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, "numfmt_get_symbol: invalid symbol value", 0 TSRMLS_CC ); + intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, "numfmt_get_symbol: invalid symbol value", 0 ); RETURN_FALSE; } @@ -305,17 +305,17 @@ 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(), getThis(), "Ols", &object, NumberFormatter_ce_ptr, &symbol, &value, &value_len ) == FAILURE ) { intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, - "numfmt_set_symbol: unable to parse input params", 0 TSRMLS_CC ); + "numfmt_set_symbol: unable to parse input params", 0 ); RETURN_FALSE; } if (symbol >= UNUM_FORMAT_SYMBOL_COUNT || symbol < 0) { - intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, "numfmt_set_symbol: invalid symbol value", 0 TSRMLS_CC ); + intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, "numfmt_set_symbol: invalid symbol value", 0 ); RETURN_FALSE; } @@ -350,11 +350,11 @@ PHP_FUNCTION( numfmt_get_pattern ) FORMATTER_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, NumberFormatter_ce_ptr ) == FAILURE ) { intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, - "numfmt_get_pattern: unable to parse input params", 0 TSRMLS_CC ); + "numfmt_get_pattern: unable to parse input params", 0 ); RETURN_FALSE; } @@ -393,11 +393,11 @@ PHP_FUNCTION( numfmt_set_pattern ) FORMATTER_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, NumberFormatter_ce_ptr, &value, &value_len ) == FAILURE ) { intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, - "numfmt_set_pattern: unable to parse input params", 0 TSRMLS_CC ); + "numfmt_set_pattern: unable to parse input params", 0 ); RETURN_FALSE; } @@ -431,11 +431,11 @@ PHP_FUNCTION( numfmt_get_locale ) 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(), getThis(), "O|l", &object, NumberFormatter_ce_ptr, &type ) == FAILURE ) { intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, - "numfmt_get_locale: unable to parse input params", 0 TSRMLS_CC ); + "numfmt_get_locale: unable to parse input params", 0 ); RETURN_FALSE; } diff --git a/ext/intl/formatter/formatter_class.c b/ext/intl/formatter/formatter_class.c index 8fcc155e85..aa8844cca0 100644 --- a/ext/intl/formatter/formatter_class.c +++ b/ext/intl/formatter/formatter_class.c @@ -38,29 +38,29 @@ static void NumberFormatter_object_dtor( zend_object *object TSRMLS_DC ) { - zend_objects_destroy_object( object TSRMLS_CC ); + zend_objects_destroy_object( object ); } /* }}} */ /* {{{ NumberFormatter_objects_free */ -void NumberFormatter_object_free( zend_object *object TSRMLS_DC ) +void NumberFormatter_object_free( zend_object *object ) { NumberFormatter_object* nfo = php_intl_number_format_fetch_object(object); - zend_object_std_dtor( &nfo->zo TSRMLS_CC ); + zend_object_std_dtor( &nfo->zo ); - formatter_data_free( &nfo->nf_data TSRMLS_CC ); + formatter_data_free( &nfo->nf_data ); } /* }}} */ /* {{{ NumberFormatter_object_create */ -zend_object *NumberFormatter_object_create(zend_class_entry *ce TSRMLS_DC) +zend_object *NumberFormatter_object_create(zend_class_entry *ce) { NumberFormatter_object* intern; intern = ecalloc( 1, sizeof(NumberFormatter_object) + sizeof(zval) * (ce->default_properties_count - 1) ); - formatter_data_init( &intern->nf_data TSRMLS_CC ); - zend_object_std_init( &intern->zo, ce TSRMLS_CC ); + formatter_data_init( &intern->nf_data ); + zend_object_std_init( &intern->zo, ce ); object_properties_init(&intern->zo, ce); intern->zo.handlers = &NumberFormatter_handlers; @@ -70,16 +70,16 @@ zend_object *NumberFormatter_object_create(zend_class_entry *ce TSRMLS_DC) /* }}} */ /* {{{ NumberFormatter_object_clone */ -zend_object *NumberFormatter_object_clone(zval *object TSRMLS_DC) +zend_object *NumberFormatter_object_clone(zval *object) { NumberFormatter_object *nfo, *new_nfo; zend_object *new_obj; FORMATTER_METHOD_FETCH_OBJECT_NO_CHECK; - new_obj = NumberFormatter_ce_ptr->create_object(Z_OBJCE_P(object) TSRMLS_CC); + new_obj = NumberFormatter_ce_ptr->create_object(Z_OBJCE_P(object)); new_nfo = php_intl_number_format_fetch_object(new_obj); /* clone standard parts */ - zend_objects_clone_members(&new_nfo->zo, &nfo->zo TSRMLS_CC); + zend_objects_clone_members(&new_nfo->zo, &nfo->zo); /* clone formatter object. It may fail, the destruction code must handle this case */ if (FORMATTER_OBJECT(nfo) != NULL) { FORMATTER_OBJECT(new_nfo) = unum_clone(FORMATTER_OBJECT(nfo), @@ -87,11 +87,11 @@ zend_object *NumberFormatter_object_clone(zval *object TSRMLS_DC) if (U_FAILURE(INTL_DATA_ERROR_CODE(nfo))) { /* set up error in case error handler is interested */ intl_errors_set(INTL_DATA_ERROR_P(nfo), INTL_DATA_ERROR_CODE(nfo), - "Failed to clone NumberFormatter object", 0 TSRMLS_CC); - zend_throw_exception(NULL, "Failed to clone NumberFormatter object", 0 TSRMLS_CC); + "Failed to clone NumberFormatter object", 0); + zend_throw_exception(NULL, "Failed to clone NumberFormatter object", 0); } } else { - zend_throw_exception(NULL, "Cannot clone unconstructed NumberFormatter", 0 TSRMLS_CC); + zend_throw_exception(NULL, "Cannot clone unconstructed NumberFormatter", 0); } return new_obj; } @@ -184,14 +184,14 @@ static zend_function_entry NumberFormatter_class_functions[] = { /* {{{ formatter_register_class * Initialize 'NumberFormatter' class */ -void formatter_register_class( TSRMLS_D ) +void formatter_register_class( void ) { zend_class_entry ce; /* Create and register 'NumberFormatter' class. */ INIT_CLASS_ENTRY( ce, "NumberFormatter", NumberFormatter_class_functions ); ce.create_object = NumberFormatter_object_create; - NumberFormatter_ce_ptr = zend_register_internal_class( &ce TSRMLS_CC ); + NumberFormatter_ce_ptr = zend_register_internal_class( &ce ); memcpy(&NumberFormatter_handlers, zend_get_std_object_handlers(), sizeof(NumberFormatter_handlers)); diff --git a/ext/intl/formatter/formatter_class.h b/ext/intl/formatter/formatter_class.h index 1db688712c..1d6fa817c9 100644 --- a/ext/intl/formatter/formatter_class.h +++ b/ext/intl/formatter/formatter_class.h @@ -34,7 +34,7 @@ static inline NumberFormatter_object *php_intl_number_format_fetch_object(zend_o } #define Z_INTL_NUMBERFORMATTER_P(zv) php_intl_number_format_fetch_object(Z_OBJ_P(zv)) -void formatter_register_class( TSRMLS_D ); +void formatter_register_class( void ); extern zend_class_entry *NumberFormatter_ce_ptr; /* Auxiliary macros */ @@ -47,7 +47,7 @@ extern zend_class_entry *NumberFormatter_ce_ptr; if (FORMATTER_OBJECT(nfo) == NULL) \ { \ intl_errors_set(&nfo->nf_data.error, U_ILLEGAL_ARGUMENT_ERROR, \ - "Found unconstructed NumberFormatter", 0 TSRMLS_CC); \ + "Found unconstructed NumberFormatter", 0); \ RETURN_FALSE; \ } diff --git a/ext/intl/formatter/formatter_data.c b/ext/intl/formatter/formatter_data.c index 2f785ba68f..46b94ad4ea 100644 --- a/ext/intl/formatter/formatter_data.c +++ b/ext/intl/formatter/formatter_data.c @@ -23,20 +23,20 @@ /* {{{ void formatter_data_init( formatter_data* nf_data ) * Initialize internals of formatter_data. */ -void formatter_data_init( formatter_data* nf_data TSRMLS_DC ) +void formatter_data_init( formatter_data* nf_data ) { if( !nf_data ) return; nf_data->unum = NULL; - intl_error_reset( &nf_data->error TSRMLS_CC ); + intl_error_reset( &nf_data->error ); } /* }}} */ /* {{{ void formatter_data_free( formatter_data* nf_data ) * Clean up mem allocted by internals of formatter_data */ -void formatter_data_free( formatter_data* nf_data TSRMLS_DC ) +void formatter_data_free( formatter_data* nf_data ) { if( !nf_data ) return; @@ -45,18 +45,18 @@ void formatter_data_free( formatter_data* nf_data TSRMLS_DC ) unum_close( nf_data->unum ); nf_data->unum = NULL; - intl_error_reset( &nf_data->error TSRMLS_CC ); + intl_error_reset( &nf_data->error ); } /* }}} */ /* {{{ formatter_data* formatter_data_create() * Alloc mem for formatter_data and initialize it with default values. */ -formatter_data* formatter_data_create( TSRMLS_D ) +formatter_data* formatter_data_create( void ) { formatter_data* nf_data = ecalloc( 1, sizeof(formatter_data) ); - formatter_data_init( nf_data TSRMLS_CC ); + formatter_data_init( nf_data ); return nf_data; } diff --git a/ext/intl/formatter/formatter_data.h b/ext/intl/formatter/formatter_data.h index 0e3bc4fea4..8d1bfd12cd 100644 --- a/ext/intl/formatter/formatter_data.h +++ b/ext/intl/formatter/formatter_data.h @@ -31,8 +31,8 @@ typedef struct { UNumberFormat* unum; } formatter_data; -formatter_data* formatter_data_create( TSRMLS_D ); -void formatter_data_init( formatter_data* nf_data TSRMLS_DC ); -void formatter_data_free( formatter_data* nf_data TSRMLS_DC ); +formatter_data* formatter_data_create( void ); +void formatter_data_init( formatter_data* nf_data ); +void formatter_data_free( formatter_data* nf_data ); #endif // FORMATTER_DATA_H diff --git a/ext/intl/formatter/formatter_format.c b/ext/intl/formatter/formatter_format.c index 937cb05812..b852e54b3e 100644 --- a/ext/intl/formatter/formatter_format.c +++ b/ext/intl/formatter/formatter_format.c @@ -40,11 +40,11 @@ PHP_FUNCTION( numfmt_format ) 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(), getThis(), "Oz|l", &object, NumberFormatter_ce_ptr, &number, &type ) == FAILURE ) { intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, - "numfmt_format: unable to parse input params", 0 TSRMLS_CC ); + "numfmt_format: unable to parse input params", 0 ); RETURN_FALSE; } @@ -69,7 +69,7 @@ PHP_FUNCTION( numfmt_format ) if(Z_TYPE_P(number) != IS_DOUBLE && Z_TYPE_P(number) != IS_LONG) { SEPARATE_ZVAL_IF_NOT_REF(number); - convert_scalar_to_number(number TSRMLS_CC ); + convert_scalar_to_number(number ); } switch(type) { @@ -78,7 +78,7 @@ PHP_FUNCTION( numfmt_format ) formatted_len = unum_format(FORMATTER_OBJECT(nfo), (int32_t)Z_LVAL_P(number), formatted, formatted_len, NULL, &INTL_DATA_ERROR_CODE(nfo)); if (INTL_DATA_ERROR_CODE(nfo) == U_BUFFER_OVERFLOW_ERROR) { - intl_error_reset(INTL_DATA_ERROR_P(nfo) TSRMLS_CC); + intl_error_reset(INTL_DATA_ERROR_P(nfo)); formatted = eumalloc(formatted_len); formatted_len = unum_format(FORMATTER_OBJECT(nfo), (int32_t)Z_LVAL_P(number), formatted, formatted_len, NULL, &INTL_DATA_ERROR_CODE(nfo)); @@ -94,7 +94,7 @@ PHP_FUNCTION( numfmt_format ) int64_t value = (Z_TYPE_P(number) == IS_DOUBLE)?(int64_t)Z_DVAL_P(number):Z_LVAL_P(number); formatted_len = unum_formatInt64(FORMATTER_OBJECT(nfo), value, formatted, formatted_len, NULL, &INTL_DATA_ERROR_CODE(nfo)); if (INTL_DATA_ERROR_CODE(nfo) == U_BUFFER_OVERFLOW_ERROR) { - intl_error_reset(INTL_DATA_ERROR_P(nfo) TSRMLS_CC); + intl_error_reset(INTL_DATA_ERROR_P(nfo)); formatted = eumalloc(formatted_len); formatted_len = unum_formatInt64(FORMATTER_OBJECT(nfo), value, formatted, formatted_len, NULL, &INTL_DATA_ERROR_CODE(nfo)); if (U_FAILURE( INTL_DATA_ERROR_CODE(nfo) ) ) { @@ -109,7 +109,7 @@ PHP_FUNCTION( numfmt_format ) convert_to_double_ex(number); formatted_len = unum_formatDouble(FORMATTER_OBJECT(nfo), Z_DVAL_P(number), formatted, formatted_len, NULL, &INTL_DATA_ERROR_CODE(nfo)); if (INTL_DATA_ERROR_CODE(nfo) == U_BUFFER_OVERFLOW_ERROR) { - intl_error_reset(INTL_DATA_ERROR_P(nfo) TSRMLS_CC); + intl_error_reset(INTL_DATA_ERROR_P(nfo)); formatted = eumalloc(formatted_len); unum_formatDouble(FORMATTER_OBJECT(nfo), Z_DVAL_P(number), formatted, formatted_len, NULL, &INTL_DATA_ERROR_CODE(nfo)); if (U_FAILURE( INTL_DATA_ERROR_CODE(nfo) ) ) { @@ -120,7 +120,7 @@ PHP_FUNCTION( numfmt_format ) break; default: - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unsupported format type %pd", type); + php_error_docref(NULL, E_WARNING, "Unsupported format type %pd", type); RETURN_FALSE; break; } @@ -147,11 +147,11 @@ PHP_FUNCTION( numfmt_format_currency ) FORMATTER_METHOD_INIT_VARS; /* Parse parameters. */ - if( zend_parse_method_parameters( ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Ods", + if( zend_parse_method_parameters( ZEND_NUM_ARGS(), getThis(), "Ods", &object, NumberFormatter_ce_ptr, &number, ¤cy, ¤cy_len ) == FAILURE ) { intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, - "numfmt_format_currency: unable to parse input params", 0 TSRMLS_CC ); + "numfmt_format_currency: unable to parse input params", 0 ); RETURN_FALSE; } @@ -171,14 +171,14 @@ PHP_FUNCTION( numfmt_format_currency ) * and use it to format the number. */ if (INTL_DATA_ERROR_CODE(nfo) == U_BUFFER_OVERFLOW_ERROR) { - intl_error_reset(INTL_DATA_ERROR_P(nfo) TSRMLS_CC); + intl_error_reset(INTL_DATA_ERROR_P(nfo)); formatted = eumalloc(formatted_len); unum_formatDoubleCurrency(FORMATTER_OBJECT(nfo), number, scurrency, formatted, formatted_len, NULL, &INTL_DATA_ERROR_CODE(nfo)); } if( U_FAILURE( INTL_DATA_ERROR_CODE((nfo)) ) ) { - intl_error_set_code( NULL, INTL_DATA_ERROR_CODE((nfo)) TSRMLS_CC ); - intl_errors_set_custom_msg( INTL_DATA_ERROR_P(nfo), "Number formatting failed", 0 TSRMLS_CC ); + intl_error_set_code( NULL, INTL_DATA_ERROR_CODE((nfo)) ); + intl_errors_set_custom_msg( INTL_DATA_ERROR_P(nfo), "Number formatting failed", 0 ); RETVAL_FALSE; if (formatted != format_buf) { efree(formatted); diff --git a/ext/intl/formatter/formatter_main.c b/ext/intl/formatter/formatter_main.c index 939a8f782b..067f3bd82b 100644 --- a/ext/intl/formatter/formatter_main.c +++ b/ext/intl/formatter/formatter_main.c @@ -36,11 +36,11 @@ static void numfmt_ctor(INTERNAL_FUNCTION_PARAMETERS) FORMATTER_METHOD_INIT_VARS; /* Parse parameters. */ - if( zend_parse_parameters( ZEND_NUM_ARGS() TSRMLS_CC, "sl|s", + if( zend_parse_parameters( ZEND_NUM_ARGS(), "sl|s", &locale, &locale_len, &style, &pattern, &pattern_len ) == FAILURE ) { intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, - "numfmt_create: unable to parse input parameters", 0 TSRMLS_CC ); + "numfmt_create: unable to parse input parameters", 0 ); Z_OBJ_P(return_value) = NULL; return; } @@ -56,7 +56,7 @@ static void numfmt_ctor(INTERNAL_FUNCTION_PARAMETERS) } if(locale_len == 0) { - locale = intl_locale_get_default(TSRMLS_C); + locale = intl_locale_get_default(); } /* Create an ICU number formatter. */ @@ -96,7 +96,7 @@ PHP_METHOD( NumberFormatter, __construct ) numfmt_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(); } @@ -113,11 +113,11 @@ PHP_FUNCTION( numfmt_get_error_code ) FORMATTER_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, NumberFormatter_ce_ptr ) == FAILURE ) { intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, - "numfmt_get_error_code: unable to parse input params", 0 TSRMLS_CC ); + "numfmt_get_error_code: unable to parse input params", 0 ); RETURN_FALSE; } @@ -140,11 +140,11 @@ PHP_FUNCTION( numfmt_get_error_message ) FORMATTER_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, NumberFormatter_ce_ptr ) == FAILURE ) { intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, - "numfmt_get_error_message: unable to parse input params", 0 TSRMLS_CC ); + "numfmt_get_error_message: unable to parse input params", 0 ); RETURN_FALSE; } @@ -152,7 +152,7 @@ PHP_FUNCTION( numfmt_get_error_message ) nfo = Z_INTL_NUMBERFORMATTER_P(object); /* Return last error message. */ - message = intl_error_get_message( INTL_DATA_ERROR_P(nfo) TSRMLS_CC ); + message = intl_error_get_message( INTL_DATA_ERROR_P(nfo) ); RETURN_STR(message); } /* }}} */ diff --git a/ext/intl/formatter/formatter_parse.c b/ext/intl/formatter/formatter_parse.c index 0959d11830..b2af74a2e0 100644 --- a/ext/intl/formatter/formatter_parse.c +++ b/ext/intl/formatter/formatter_parse.c @@ -50,11 +50,11 @@ 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(), getThis(), "Os|lz/!", &object, NumberFormatter_ce_ptr, &str, &str_len, &type, &zposition ) == FAILURE ) { intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, - "number_parse: unable to parse input params", 0 TSRMLS_CC ); + "number_parse: unable to parse input params", 0 ); RETURN_FALSE; } @@ -97,7 +97,7 @@ PHP_FUNCTION( numfmt_parse ) RETVAL_DOUBLE(val_double); break; default: - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unsupported format type %pd", type); + php_error_docref(NULL, E_WARNING, "Unsupported format type %pd", type); RETVAL_FALSE; break; } @@ -139,11 +139,11 @@ PHP_FUNCTION( numfmt_parse_currency ) FORMATTER_METHOD_INIT_VARS; /* Parse parameters. */ - if( zend_parse_method_parameters( ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Osz/|z/!", + if( zend_parse_method_parameters( ZEND_NUM_ARGS(), getThis(), "Osz/|z/!", &object, NumberFormatter_ce_ptr, &str, &str_len, &zcurrency, &zposition ) == FAILURE ) { intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, - "number_parse_currency: unable to parse input params", 0 TSRMLS_CC ); + "number_parse_currency: unable to parse input params", 0 ); RETURN_FALSE; } diff --git a/ext/intl/grapheme/grapheme.h b/ext/intl/grapheme/grapheme.h index 5256a272a1..871e660639 100644 --- a/ext/intl/grapheme/grapheme.h +++ b/ext/intl/grapheme/grapheme.h @@ -31,6 +31,6 @@ PHP_FUNCTION(grapheme_stristr); PHP_FUNCTION(grapheme_extract); void grapheme_register_constants( INIT_FUNC_ARGS ); -void grapheme_close_global_iterator( TSRMLS_D ); +void grapheme_close_global_iterator( void ); #endif // GRAPHEME_GRAPHEME_H diff --git a/ext/intl/grapheme/grapheme_string.c b/ext/intl/grapheme/grapheme_string.c index 55ce63955f..d5a33fe663 100644 --- a/ext/intl/grapheme/grapheme_string.c +++ b/ext/intl/grapheme/grapheme_string.c @@ -61,10 +61,10 @@ PHP_FUNCTION(grapheme_strlen) int ret_len; UErrorCode status; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", (char **)&string, &string_len) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", (char **)&string, &string_len) == FAILURE) { intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, - "grapheme_strlen: unable to parse input param", 0 TSRMLS_CC ); + "grapheme_strlen: unable to parse input param", 0 ); RETURN_FALSE; } @@ -80,17 +80,17 @@ PHP_FUNCTION(grapheme_strlen) if ( U_FAILURE( status ) ) { /* Set global error code. */ - intl_error_set_code( NULL, status TSRMLS_CC ); + intl_error_set_code( NULL, status ); /* Set error messages. */ - intl_error_set_custom_msg( NULL, "Error converting input string to UTF-16", 0 TSRMLS_CC ); + intl_error_set_custom_msg( NULL, "Error converting input string to UTF-16", 0 ); if (ustring) { efree( ustring ); } RETURN_NULL(); } - ret_len = grapheme_split_string(ustring, ustring_len, NULL, 0 TSRMLS_CC ); + ret_len = grapheme_split_string(ustring, ustring_len, NULL, 0 ); if (ustring) { efree( ustring ); @@ -115,17 +115,17 @@ PHP_FUNCTION(grapheme_strpos) int32_t offset = 0; int ret_pos; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss|l", (char **)&haystack, &haystack_len, (char **)&needle, &needle_len, &loffset) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "ss|l", (char **)&haystack, &haystack_len, (char **)&needle, &needle_len, &loffset) == FAILURE) { intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, - "grapheme_strpos: unable to parse input param", 0 TSRMLS_CC ); + "grapheme_strpos: unable to parse input param", 0 ); RETURN_FALSE; } if ( OUTSIDE_STRING(loffset, haystack_len) ) { - intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, "grapheme_strpos: Offset not contained in string", 1 TSRMLS_CC ); + intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, "grapheme_strpos: Offset not contained in string", 1 ); RETURN_FALSE; } @@ -137,7 +137,7 @@ PHP_FUNCTION(grapheme_strpos) if (needle_len == 0) { - intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, "grapheme_strpos: Empty delimiter", 1 TSRMLS_CC ); + intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, "grapheme_strpos: Empty delimiter", 1 ); RETURN_FALSE; } @@ -160,7 +160,7 @@ PHP_FUNCTION(grapheme_strpos) } /* do utf16 part of the strpos */ - ret_pos = grapheme_strpos_utf16(haystack, haystack_len, needle, needle_len, offset, NULL, 0 /* fIgnoreCase */, 0 /* last */ TSRMLS_CC ); + ret_pos = grapheme_strpos_utf16(haystack, haystack_len, needle, needle_len, offset, NULL, 0 /* fIgnoreCase */, 0 /* last */ ); if ( ret_pos >= 0 ) { RETURN_LONG(ret_pos); @@ -183,17 +183,17 @@ PHP_FUNCTION(grapheme_stripos) int ret_pos; int is_ascii; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss|l", (char **)&haystack, &haystack_len, (char **)&needle, &needle_len, &loffset) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "ss|l", (char **)&haystack, &haystack_len, (char **)&needle, &needle_len, &loffset) == FAILURE) { intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, - "grapheme_stripos: unable to parse input param", 0 TSRMLS_CC ); + "grapheme_stripos: unable to parse input param", 0 ); RETURN_FALSE; } if ( OUTSIDE_STRING(loffset, haystack_len) ) { - intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, "grapheme_stripos: Offset not contained in string", 1 TSRMLS_CC ); + intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, "grapheme_stripos: Offset not contained in string", 1 ); RETURN_FALSE; } @@ -205,7 +205,7 @@ PHP_FUNCTION(grapheme_stripos) if (needle_len == 0) { - intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, "grapheme_stripos: Empty delimiter", 1 TSRMLS_CC ); + intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, "grapheme_stripos: Empty delimiter", 1 ); RETURN_FALSE; } @@ -235,7 +235,7 @@ PHP_FUNCTION(grapheme_stripos) } /* do utf16 part of the strpos */ - ret_pos = grapheme_strpos_utf16(haystack, haystack_len, needle, needle_len, offset, NULL, 1 /* fIgnoreCase */, 0 /*last */ TSRMLS_CC ); + ret_pos = grapheme_strpos_utf16(haystack, haystack_len, needle, needle_len, offset, NULL, 1 /* fIgnoreCase */, 0 /*last */ ); if ( ret_pos >= 0 ) { RETURN_LONG(ret_pos); @@ -257,17 +257,17 @@ PHP_FUNCTION(grapheme_strrpos) int32_t ret_pos; int is_ascii; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss|l", (char **)&haystack, &haystack_len, (char **)&needle, &needle_len, &loffset) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "ss|l", (char **)&haystack, &haystack_len, (char **)&needle, &needle_len, &loffset) == FAILURE) { intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, - "grapheme_strrpos: unable to parse input param", 0 TSRMLS_CC ); + "grapheme_strrpos: unable to parse input param", 0 ); RETURN_FALSE; } if ( OUTSIDE_STRING(loffset, haystack_len) ) { - intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, "grapheme_strpos: Offset not contained in string", 1 TSRMLS_CC ); + intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, "grapheme_strpos: Offset not contained in string", 1 ); RETURN_FALSE; } @@ -279,7 +279,7 @@ PHP_FUNCTION(grapheme_strrpos) if (needle_len == 0) { - intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, "grapheme_strpos: Empty delimiter", 1 TSRMLS_CC ); + intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, "grapheme_strpos: Empty delimiter", 1 ); RETURN_FALSE; } @@ -304,7 +304,7 @@ PHP_FUNCTION(grapheme_strrpos) /* else we need to continue via utf16 */ } - ret_pos = grapheme_strpos_utf16(haystack, haystack_len, needle, needle_len, offset, NULL, 0 /* f_ignore_case */, 1/* last */ TSRMLS_CC); + ret_pos = grapheme_strpos_utf16(haystack, haystack_len, needle, needle_len, offset, NULL, 0 /* f_ignore_case */, 1/* last */); if ( ret_pos >= 0 ) { RETURN_LONG(ret_pos); @@ -327,17 +327,17 @@ PHP_FUNCTION(grapheme_strripos) int32_t ret_pos; int is_ascii; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss|l", (char **)&haystack, &haystack_len, (char **)&needle, &needle_len, &loffset) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "ss|l", (char **)&haystack, &haystack_len, (char **)&needle, &needle_len, &loffset) == FAILURE) { intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, - "grapheme_strrpos: unable to parse input param", 0 TSRMLS_CC ); + "grapheme_strrpos: unable to parse input param", 0 ); RETURN_FALSE; } if ( OUTSIDE_STRING(loffset, haystack_len) ) { - intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, "grapheme_strpos: Offset not contained in string", 1 TSRMLS_CC ); + intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, "grapheme_strpos: Offset not contained in string", 1 ); RETURN_FALSE; } @@ -349,7 +349,7 @@ PHP_FUNCTION(grapheme_strripos) if (needle_len == 0) { - intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, "grapheme_strpos: Empty delimiter", 1 TSRMLS_CC ); + intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, "grapheme_strpos: Empty delimiter", 1 ); RETURN_FALSE; } @@ -382,7 +382,7 @@ PHP_FUNCTION(grapheme_strripos) /* else we need to continue via utf16 */ } - ret_pos = grapheme_strpos_utf16(haystack, haystack_len, needle, needle_len, offset, NULL, 1 /* f_ignore_case */, 1 /*last */ TSRMLS_CC); + ret_pos = grapheme_strpos_utf16(haystack, haystack_len, needle, needle_len, offset, NULL, 1 /* f_ignore_case */, 1 /*last */); if ( ret_pos >= 0 ) { RETURN_LONG(ret_pos); @@ -412,17 +412,17 @@ PHP_FUNCTION(grapheme_substr) int sub_str_start_pos, sub_str_end_pos; int32_t (*iter_func)(UBreakIterator *); - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sl|l", (char **)&str, &str_len, &lstart, &length) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "sl|l", (char **)&str, &str_len, &lstart, &length) == FAILURE) { intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, - "grapheme_substr: unable to parse input param", 0 TSRMLS_CC ); + "grapheme_substr: unable to parse input param", 0 ); RETURN_FALSE; } if ( OUTSIDE_STRING(lstart, str_len) ) { - intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, "grapheme_substr: start not contained in string", 1 TSRMLS_CC ); + intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, "grapheme_substr: start not contained in string", 1 ); RETURN_FALSE; } @@ -436,7 +436,7 @@ PHP_FUNCTION(grapheme_substr) grapheme_substr_ascii((char *)str, str_len, start, length, ZEND_NUM_ARGS(), (char **) &sub_str, &sub_str_len); if ( NULL == sub_str ) { - intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, "grapheme_substr: invalid parameters", 1 TSRMLS_CC ); + intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, "grapheme_substr: invalid parameters", 1 ); RETURN_FALSE; } @@ -450,17 +450,17 @@ PHP_FUNCTION(grapheme_substr) if ( U_FAILURE( status ) ) { /* Set global error code. */ - intl_error_set_code( NULL, status TSRMLS_CC ); + intl_error_set_code( NULL, status ); /* Set error messages. */ - intl_error_set_custom_msg( NULL, "Error converting input string to UTF-16", 0 TSRMLS_CC ); + intl_error_set_custom_msg( NULL, "Error converting input string to UTF-16", 0 ); if (ustr) { efree( ustr ); } RETURN_FALSE; } - bi = grapheme_get_break_iterator((void*)u_break_iterator_buffer, &status TSRMLS_CC ); + bi = grapheme_get_break_iterator((void*)u_break_iterator_buffer, &status ); if( U_FAILURE(status) ) { RETURN_FALSE; @@ -492,7 +492,7 @@ PHP_FUNCTION(grapheme_substr) if ( 0 != start || sub_str_start_pos >= ustr_len ) { - intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, "grapheme_substr: start not contained in string", 1 TSRMLS_CC ); + intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, "grapheme_substr: start not contained in string", 1 ); if (ustr) { efree(ustr); @@ -517,10 +517,10 @@ PHP_FUNCTION(grapheme_substr) if ( U_FAILURE( status ) ) { /* Set global error code. */ - intl_error_set_code( NULL, status TSRMLS_CC ); + intl_error_set_code( NULL, status ); /* Set error messages. */ - intl_error_set_custom_msg( NULL, "Error converting output string to UTF-8", 0 TSRMLS_CC ); + intl_error_set_custom_msg( NULL, "Error converting output string to UTF-8", 0 ); if (sub_str) { efree( sub_str ); @@ -573,7 +573,7 @@ PHP_FUNCTION(grapheme_substr) if ( UBRK_DONE == sub_str_end_pos) { if(length < 0) { - intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, "grapheme_substr: length not contained in string", 1 TSRMLS_CC ); + intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, "grapheme_substr: length not contained in string", 1 ); efree(ustr); RETURN_FALSE; @@ -583,7 +583,7 @@ PHP_FUNCTION(grapheme_substr) } if(sub_str_start_pos > sub_str_end_pos) { - intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, "grapheme_substr: length is beyond start", 1 TSRMLS_CC ); + intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, "grapheme_substr: length is beyond start", 1 ); efree(ustr); RETURN_FALSE; @@ -597,10 +597,10 @@ PHP_FUNCTION(grapheme_substr) if ( U_FAILURE( status ) ) { /* Set global error code. */ - intl_error_set_code( NULL, status TSRMLS_CC ); + intl_error_set_code( NULL, status ); /* Set error messages. */ - intl_error_set_custom_msg( NULL, "Error converting output string to UTF-8", 0 TSRMLS_CC ); + intl_error_set_custom_msg( NULL, "Error converting output string to UTF-8", 0 ); if ( NULL != sub_str ) efree( sub_str ); @@ -624,17 +624,17 @@ static void strstr_common_handler(INTERNAL_FUNCTION_PARAMETERS, int f_ignore_cas int ret_pos, uchar_pos; zend_bool part = 0; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss|b", (char **)&haystack, &haystack_len, (char **)&needle, &needle_len, &part) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "ss|b", (char **)&haystack, &haystack_len, (char **)&needle, &needle_len, &part) == FAILURE) { intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, - "grapheme_strstr: unable to parse input param", 0 TSRMLS_CC ); + "grapheme_strstr: unable to parse input param", 0 ); RETURN_FALSE; } if (needle_len == 0) { - intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, "grapheme_strpos: Empty delimiter", 1 TSRMLS_CC ); + intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, "grapheme_strpos: Empty delimiter", 1 ); RETURN_FALSE; } @@ -666,7 +666,7 @@ static void strstr_common_handler(INTERNAL_FUNCTION_PARAMETERS, int f_ignore_cas } /* need to work in utf16 */ - ret_pos = grapheme_strpos_utf16(haystack, haystack_len, needle, needle_len, 0, &uchar_pos, f_ignore_case, 0 /*last */ TSRMLS_CC ); + ret_pos = grapheme_strpos_utf16(haystack, haystack_len, needle, needle_len, 0, &uchar_pos, f_ignore_case, 0 /*last */ ); if ( ret_pos < 0 ) { RETURN_FALSE; @@ -829,10 +829,10 @@ PHP_FUNCTION(grapheme_extract) int ret_pos; zval *next = NULL; /* return offset of next part of the string */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sl|llz", (char **)&str, &str_len, &size, &extract_type, &lstart, &next) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "sl|llz", (char **)&str, &str_len, &size, &extract_type, &lstart, &next) == FAILURE) { intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, - "grapheme_extract: unable to parse input param", 0 TSRMLS_CC ); + "grapheme_extract: unable to parse input param", 0 ); RETURN_FALSE; } @@ -840,7 +840,7 @@ PHP_FUNCTION(grapheme_extract) if ( NULL != next ) { if ( !Z_ISREF_P(next) ) { intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, - "grapheme_extract: 'next' was not passed by reference", 0 TSRMLS_CC ); + "grapheme_extract: 'next' was not passed by reference", 0 ); RETURN_FALSE; } @@ -856,18 +856,18 @@ PHP_FUNCTION(grapheme_extract) if ( extract_type < GRAPHEME_EXTRACT_TYPE_MIN || extract_type > GRAPHEME_EXTRACT_TYPE_MAX ) { intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, - "grapheme_extract: unknown extract type param", 0 TSRMLS_CC ); + "grapheme_extract: unknown extract type param", 0 ); RETURN_FALSE; } if ( lstart > INT32_MAX || lstart < 0 || lstart >= str_len ) { - intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, "grapheme_extract: start not contained in string", 0 TSRMLS_CC ); + intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, "grapheme_extract: start not contained in string", 0 ); RETURN_FALSE; } if ( size > INT32_MAX || size < 0) { - intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, "grapheme_extract: size is invalid", 0 TSRMLS_CC ); + intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, "grapheme_extract: size is invalid", 0 ); RETURN_FALSE; } if (size == 0) { @@ -887,7 +887,7 @@ PHP_FUNCTION(grapheme_extract) pstr++; if ( pstr >= str_end ) { intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, - "grapheme_extract: invalid input string", 0 TSRMLS_CC ); + "grapheme_extract: invalid input string", 0 ); RETURN_FALSE; } @@ -916,10 +916,10 @@ PHP_FUNCTION(grapheme_extract) if ( U_FAILURE( status ) ) { /* Set global error code. */ - intl_error_set_code( NULL, status TSRMLS_CC ); + intl_error_set_code( NULL, status ); /* Set error messages. */ - intl_error_set_custom_msg( NULL, "Error converting input string to UTF-16", 0 TSRMLS_CC ); + intl_error_set_custom_msg( NULL, "Error converting input string to UTF-16", 0 ); if ( NULL != ustr ) efree( ustr ); @@ -929,7 +929,7 @@ PHP_FUNCTION(grapheme_extract) bi = NULL; status = U_ZERO_ERROR; - bi = grapheme_get_break_iterator(u_break_iterator_buffer, &status TSRMLS_CC ); + bi = grapheme_get_break_iterator(u_break_iterator_buffer, &status ); ubrk_setText(bi, ustr, ustr_len, &status); diff --git a/ext/intl/grapheme/grapheme_util.c b/ext/intl/grapheme/grapheme_util.c index 5e94eefc8a..bb4ecac084 100644 --- a/ext/intl/grapheme/grapheme_util.c +++ b/ext/intl/grapheme/grapheme_util.c @@ -38,7 +38,7 @@ ZEND_EXTERN_MODULE_GLOBALS( intl ) /* {{{ grapheme_close_global_iterator - clean up */ void -grapheme_close_global_iterator( TSRMLS_D ) +grapheme_close_global_iterator( void ) { UBreakIterator *global_break_iterator = INTL_G( grapheme_iterator ); @@ -109,8 +109,8 @@ void grapheme_substr_ascii(char *str, int str_len, int f, int l, int argc, char #define STRPOS_CHECK_STATUS(status, error) \ if ( U_FAILURE( (status) ) ) { \ - intl_error_set_code( NULL, (status) TSRMLS_CC ); \ - intl_error_set_custom_msg( NULL, (error), 0 TSRMLS_CC ); \ + intl_error_set_code( NULL, (status) ); \ + intl_error_set_custom_msg( NULL, (error), 0 ); \ if (uhaystack) { \ efree( uhaystack ); \ } \ @@ -128,7 +128,7 @@ void grapheme_substr_ascii(char *str, int str_len, int f, int l, int argc, char /* {{{ grapheme_strpos_utf16 - strrpos using utf16*/ -int grapheme_strpos_utf16(unsigned char *haystack, int32_t haystack_len, unsigned char*needle, int32_t needle_len, int32_t offset, int32_t *puchar_pos, int f_ignore_case, int last TSRMLS_DC) +int grapheme_strpos_utf16(unsigned char *haystack, int32_t haystack_len, unsigned char*needle, int32_t needle_len, int32_t offset, int32_t *puchar_pos, int f_ignore_case, int last) { UChar *uhaystack = NULL, *uneedle = NULL; int32_t uhaystack_len = 0, uneedle_len = 0, char_pos, ret_pos, offset_pos = 0; @@ -153,7 +153,7 @@ int grapheme_strpos_utf16(unsigned char *haystack, int32_t haystack_len, unsigne /* get a pointer to the haystack taking into account the offset */ status = U_ZERO_ERROR; - bi = grapheme_get_break_iterator(u_break_iterator_buffer, &status TSRMLS_CC ); + bi = grapheme_get_break_iterator(u_break_iterator_buffer, &status ); STRPOS_CHECK_STATUS(status, "Failed to get iterator"); status = U_ZERO_ERROR; ubrk_setText(bi, uhaystack, uhaystack_len, &status); @@ -231,14 +231,14 @@ int grapheme_ascii_check(const unsigned char *day, int32_t len) /* }}} */ /* {{{ grapheme_split_string: find and optionally return grapheme boundaries */ -int grapheme_split_string(const UChar *text, int32_t text_length, int boundary_array[], int boundary_array_len TSRMLS_DC ) +int grapheme_split_string(const UChar *text, int32_t text_length, int boundary_array[], int boundary_array_len ) { unsigned char u_break_iterator_buffer[U_BRK_SAFECLONE_BUFFERSIZE]; UErrorCode status = U_ZERO_ERROR; int ret_len, pos; UBreakIterator* bi; - bi = grapheme_get_break_iterator((void*)u_break_iterator_buffer, &status TSRMLS_CC ); + bi = grapheme_get_break_iterator((void*)u_break_iterator_buffer, &status ); if( U_FAILURE(status) ) { return -1; @@ -374,7 +374,7 @@ grapheme_strrpos_ascii(unsigned char *haystack, int32_t haystack_len, unsigned c /* }}} */ /* {{{ grapheme_get_break_iterator: get a clone of the global character break iterator */ -UBreakIterator* grapheme_get_break_iterator(void *stack_buffer, UErrorCode *status TSRMLS_DC ) +UBreakIterator* grapheme_get_break_iterator(void *stack_buffer, UErrorCode *status ) { int32_t buffer_size; diff --git a/ext/intl/grapheme/grapheme_util.h b/ext/intl/grapheme/grapheme_util.h index a66796d80d..99021287fa 100644 --- a/ext/intl/grapheme/grapheme_util.h +++ b/ext/intl/grapheme/grapheme_util.h @@ -21,17 +21,17 @@ #include "intl_convert.h" /* get_break_interator: get a break iterator from the global structure */ -UBreakIterator* grapheme_get_break_iterator(void *stack_buffer, UErrorCode *status TSRMLS_DC ); +UBreakIterator* grapheme_get_break_iterator(void *stack_buffer, UErrorCode *status ); void grapheme_substr_ascii(char *str, int32_t str_len, int32_t f, int32_t l, int argc, char **sub_str, int *sub_str_len); -int grapheme_strrpos_utf16(unsigned char *haystack, int32_t haystack_len, unsigned char*needle, int32_t needle_len, int32_t offset, int f_ignore_case TSRMLS_DC); +int grapheme_strrpos_utf16(unsigned char *haystack, int32_t haystack_len, unsigned char*needle, int32_t needle_len, int32_t offset, int f_ignore_case); -int grapheme_strpos_utf16(unsigned char *haystack, int32_t haystack_len, unsigned char*needle, int32_t needle_len, int32_t offset, int *puchar_pos, int f_ignore_case, int last TSRMLS_DC); +int grapheme_strpos_utf16(unsigned char *haystack, int32_t haystack_len, unsigned char*needle, int32_t needle_len, int32_t offset, int *puchar_pos, int f_ignore_case, int last); int grapheme_ascii_check(const unsigned char *day, int32_t len); -int grapheme_split_string(const UChar *text, int32_t text_length, int boundary_array[], int boundary_array_len TSRMLS_DC ); +int grapheme_split_string(const UChar *text, int32_t text_length, int boundary_array[], int boundary_array_len ); int32_t grapheme_count_graphemes(UBreakIterator *bi, UChar *string, int32_t string_len); @@ -41,7 +41,7 @@ int grapheme_get_haystack_offset(UBreakIterator* bi, int32_t offset); int32_t grapheme_strrpos_ascii(unsigned char *haystack, int32_t haystack_len, unsigned char *needle, int32_t needle_len, int32_t offset); -UBreakIterator* grapheme_get_break_iterator(void *stack_buffer, UErrorCode *status TSRMLS_DC ); +UBreakIterator* grapheme_get_break_iterator(void *stack_buffer, UErrorCode *status ); /* OUTSIDE_STRING: check if (possibly negative) long offset is outside the string with int32_t length */ #define OUTSIDE_STRING(offset, max_len) ( offset <= INT32_MIN || offset > INT32_MAX || (offset < 0 ? -offset > (zend_long) max_len : offset >= (zend_long) max_len) ) diff --git a/ext/intl/idn/idn.c b/ext/intl/idn/idn.c index 1d07dbba80..0848be94a7 100644 --- a/ext/intl/idn/idn.c +++ b/ext/intl/idn/idn.c @@ -111,15 +111,15 @@ enum { }; /* like INTL_CHECK_STATUS, but as a function and varying the name of the func */ -static int php_intl_idn_check_status(UErrorCode err, const char *msg, int mode TSRMLS_DC) +static int php_intl_idn_check_status(UErrorCode err, const char *msg, int mode) { - intl_error_set_code(NULL, err TSRMLS_CC); + intl_error_set_code(NULL, err); if (U_FAILURE(err)) { char *buff; spprintf(&buff, 0, "%s: %s", mode == INTL_IDN_TO_ASCII ? "idn_to_ascii" : "idn_to_utf8", msg); - intl_error_set_custom_msg(NULL, buff, 1 TSRMLS_CC); + intl_error_set_custom_msg(NULL, buff, 1); efree(buff); return FAILURE; } @@ -127,9 +127,9 @@ static int php_intl_idn_check_status(UErrorCode err, const char *msg, int mode T return SUCCESS; } -static inline void php_intl_bad_args(const char *msg, int mode TSRMLS_DC) +static inline void php_intl_bad_args(const char *msg, int mode) { - php_intl_idn_check_status(U_ILLEGAL_ARGUMENT_ERROR, msg, mode TSRMLS_CC); + php_intl_idn_check_status(U_ILLEGAL_ARGUMENT_ERROR, msg, mode); } #ifdef HAVE_46_API @@ -146,7 +146,7 @@ static void php_intl_idn_to_46(INTERNAL_FUNCTION_PARAMETERS, uts46 = uidna_openUTS46(option, &status); if (php_intl_idn_check_status(status, "failed to open UIDNA instance", - mode TSRMLS_CC) == FAILURE) { + mode) == FAILURE) { zend_string_free(buffer); RETURN_FALSE; } @@ -159,13 +159,13 @@ static void php_intl_idn_to_46(INTERNAL_FUNCTION_PARAMETERS, buffer->val, buffer_capac, &info, &status); } if (php_intl_idn_check_status(status, "failed to convert name", - mode TSRMLS_CC) == FAILURE) { + mode) == FAILURE) { uidna_close(uts46); zend_string_free(buffer); RETURN_FALSE; } if (len >= 255) { - php_error_docref(NULL TSRMLS_CC, E_ERROR, "ICU returned an unexpected length"); + php_error_docref(NULL, E_ERROR, "ICU returned an unexpected length"); } buffer->val[len] = '\0'; @@ -217,10 +217,10 @@ static void php_intl_idn_to(INTERNAL_FUNCTION_PARAMETERS, intl_convert_utf8_to_utf16(&ustring, &ustring_len, domain, domain_len, &status); if (U_FAILURE(status)) { - intl_error_set_code(NULL, status TSRMLS_CC); + intl_error_set_code(NULL, status); /* Set error messages. */ - intl_error_set_custom_msg( NULL, "Error converting input string to UTF-16", 0 TSRMLS_CC ); + intl_error_set_custom_msg( NULL, "Error converting input string to UTF-16", 0 ); if (ustring) { efree(ustring); } @@ -237,7 +237,7 @@ static void php_intl_idn_to(INTERNAL_FUNCTION_PARAMETERS, efree(ustring); if (U_FAILURE(status)) { - intl_error_set( NULL, status, "idn_to_ascii: cannot convert to ASCII", 0 TSRMLS_CC ); + intl_error_set( NULL, status, "idn_to_ascii: cannot convert to ASCII", 0 ); RETURN_FALSE; } @@ -246,10 +246,10 @@ static void php_intl_idn_to(INTERNAL_FUNCTION_PARAMETERS, if (U_FAILURE(status)) { /* Set global error code. */ - intl_error_set_code(NULL, status TSRMLS_CC); + intl_error_set_code(NULL, status); /* Set error messages. */ - intl_error_set_custom_msg( NULL, "Error converting output string to UTF-8", 0 TSRMLS_CC ); + intl_error_set_custom_msg( NULL, "Error converting output string to UTF-8", 0 ); efree(converted_utf8); RETURN_FALSE; } @@ -269,42 +269,42 @@ static void php_intl_idn_handoff(INTERNAL_FUNCTION_PARAMETERS, int mode) variant = INTL_IDN_VARIANT_2003; zval *idna_info = NULL; - intl_error_reset(NULL TSRMLS_CC); + intl_error_reset(NULL); - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|llz/", + if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|llz/", &domain, &domain_len, &option, &variant, &idna_info) == FAILURE) { - php_intl_bad_args("bad arguments", mode TSRMLS_CC); + php_intl_bad_args("bad arguments", mode); RETURN_NULL(); /* don't set FALSE because that's not the way it was before... */ } #ifdef HAVE_46_API if (variant != INTL_IDN_VARIANT_2003 && variant != INTL_IDN_VARIANT_UTS46) { php_intl_bad_args("invalid variant, must be one of {" - "INTL_IDNA_VARIANT_2003, INTL_IDNA_VARIANT_UTS46}", mode TSRMLS_CC); + "INTL_IDNA_VARIANT_2003, INTL_IDNA_VARIANT_UTS46}", mode); RETURN_FALSE; } #else if (variant != INTL_IDN_VARIANT_2003) { php_intl_bad_args("invalid variant, PHP was compiled against " "an old version of ICU and only supports INTL_IDN_VARIANT_2003", - mode TSRMLS_CC); + mode); RETURN_FALSE; } #endif if (domain_len < 1) { - php_intl_bad_args("empty domain name", mode TSRMLS_CC); + php_intl_bad_args("empty domain name", mode); RETURN_FALSE; } if (domain_len > INT32_MAX - 1) { - php_intl_bad_args("domain name too large", mode TSRMLS_CC); + php_intl_bad_args("domain name too large", mode); RETURN_FALSE; } /* don't check options; it wasn't checked before */ if (idna_info != NULL) { if (variant == INTL_IDN_VARIANT_2003) { - php_error_docref0(NULL TSRMLS_CC, E_NOTICE, + php_error_docref0(NULL, E_NOTICE, "4 arguments were provided, but INTL_IDNA_VARIANT_2003 only " "takes 3 - extra argument ignored"); } else { diff --git a/ext/intl/intl_data.h b/ext/intl/intl_data.h index a7afb36be9..6467d40909 100644 --- a/ext/intl/intl_data.h +++ b/ext/intl/intl_data.h @@ -35,7 +35,7 @@ typedef struct _intl_data { #define INTL_METHOD_INIT_VARS(oclass, obj) \ zval* object = NULL; \ oclass##_object* obj = NULL; \ - intl_error_reset( NULL TSRMLS_CC ); + intl_error_reset( NULL ); #define INTL_DATA_ERROR(obj) (((intl_object *)(obj))->error) #define INTL_DATA_ERROR_P(obj) (&(INTL_DATA_ERROR((obj)))) @@ -43,32 +43,32 @@ typedef struct _intl_data { #define INTL_METHOD_FETCH_OBJECT(oclass, obj) \ obj = Z_##oclass##_P( object ); \ - intl_error_reset( INTL_DATA_ERROR_P(obj) TSRMLS_CC ); \ + intl_error_reset( INTL_DATA_ERROR_P(obj) ); \ /* Check status by error code, if error - exit */ #define INTL_CHECK_STATUS(err, msg) \ - intl_error_set_code( NULL, (err) TSRMLS_CC ); \ + intl_error_set_code( NULL, (err) ); \ if( U_FAILURE((err)) ) \ { \ - intl_error_set_custom_msg( NULL, msg, 0 TSRMLS_CC ); \ + intl_error_set_custom_msg( NULL, msg, 0 ); \ RETURN_FALSE; \ } /* Check status in object, if error - exit */ #define INTL_METHOD_CHECK_STATUS(obj, msg) \ - intl_error_set_code( NULL, INTL_DATA_ERROR_CODE((obj)) TSRMLS_CC ); \ + intl_error_set_code( NULL, INTL_DATA_ERROR_CODE((obj)) ); \ if( U_FAILURE( INTL_DATA_ERROR_CODE((obj)) ) ) \ { \ - intl_errors_set_custom_msg( INTL_DATA_ERROR_P((obj)), msg, 0 TSRMLS_CC ); \ + intl_errors_set_custom_msg( INTL_DATA_ERROR_P((obj)), msg, 0 ); \ RETURN_FALSE; \ } /* Check status, if error - destroy value and exit */ #define INTL_CTOR_CHECK_STATUS(obj, msg) \ - intl_error_set_code( NULL, INTL_DATA_ERROR_CODE((obj)) TSRMLS_CC ); \ + intl_error_set_code( NULL, INTL_DATA_ERROR_CODE((obj)) ); \ if( U_FAILURE( INTL_DATA_ERROR_CODE((obj)) ) ) \ { \ - intl_errors_set_custom_msg( INTL_DATA_ERROR_P((obj)), msg, 0 TSRMLS_CC ); \ + intl_errors_set_custom_msg( INTL_DATA_ERROR_P((obj)), msg, 0 ); \ /* yes, this is ugly, but it alreay is */ \ if (return_value != getThis()) { \ zval_dtor(return_value); \ @@ -96,14 +96,14 @@ typedef struct _intl_data { #define INTL_CHECK_LOCALE_LEN(locale_len) \ if((locale_len) > INTL_MAX_LOCALE_LEN) { \ intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, \ - "Locale string too long, should be no longer than 80 characters", 0 TSRMLS_CC ); \ + "Locale string too long, should be no longer than 80 characters", 0 ); \ RETURN_NULL(); \ } #define INTL_CHECK_LOCALE_LEN_OBJ(locale_len, object) \ if((locale_len) > INTL_MAX_LOCALE_LEN) { \ intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, \ - "Locale string too long, should be no longer than 80 characters", 0 TSRMLS_CC ); \ + "Locale string too long, should be no longer than 80 characters", 0 ); \ zval_dtor(object); \ ZVAL_NULL(object); \ RETURN_NULL(); \ diff --git a/ext/intl/intl_error.c b/ext/intl/intl_error.c index 9474834417..046fd5302d 100644 --- a/ext/intl/intl_error.c +++ b/ext/intl/intl_error.c @@ -34,7 +34,7 @@ static zend_class_entry *IntlException_ce_ptr; /* {{{ intl_error* intl_g_error_get() * Return global error structure. */ -static intl_error* intl_g_error_get( TSRMLS_D ) +static intl_error* intl_g_error_get( void ) { return &INTL_G( g_error ); } @@ -43,9 +43,9 @@ static intl_error* intl_g_error_get( TSRMLS_D ) /* {{{ void intl_free_custom_error_msg( intl_error* err ) * Free mem. */ -static void intl_free_custom_error_msg( intl_error* err TSRMLS_DC ) +static void intl_free_custom_error_msg( intl_error* err ) { - if( !err && !( err = intl_g_error_get( TSRMLS_C ) ) ) + if( !err && !( err = intl_g_error_get( ) ) ) return; if(err->free_custom_error_message ) { @@ -60,11 +60,11 @@ static void intl_free_custom_error_msg( intl_error* err TSRMLS_DC ) /* {{{ intl_error* intl_error_create() * Create and initialize internals of 'intl_error'. */ -intl_error* intl_error_create( TSRMLS_D ) +intl_error* intl_error_create( void ) { intl_error* err = ecalloc( 1, sizeof( intl_error ) ); - intl_error_init( err TSRMLS_CC ); + intl_error_init( err ); return err; } @@ -73,9 +73,9 @@ intl_error* intl_error_create( TSRMLS_D ) /* {{{ void intl_error_init( intl_error* coll_error ) * Initialize internals of 'intl_error'. */ -void intl_error_init( intl_error* err TSRMLS_DC ) +void intl_error_init( intl_error* err ) { - if( !err && !( err = intl_g_error_get( TSRMLS_C ) ) ) + if( !err && !( err = intl_g_error_get( ) ) ) return; err->code = U_ZERO_ERROR; @@ -87,36 +87,36 @@ void intl_error_init( intl_error* err TSRMLS_DC ) /* {{{ void intl_error_reset( intl_error* err ) * Set last error code to 0 and unset last error message */ -void intl_error_reset( intl_error* err TSRMLS_DC ) +void intl_error_reset( intl_error* err ) { - if( !err && !( err = intl_g_error_get( TSRMLS_C ) ) ) + if( !err && !( err = intl_g_error_get( ) ) ) return; err->code = U_ZERO_ERROR; - intl_free_custom_error_msg( err TSRMLS_CC ); + intl_free_custom_error_msg( err ); } /* }}} */ /* {{{ void intl_error_set_custom_msg( intl_error* err, char* msg, int copyMsg ) * Set last error message to msg copying it if needed. */ -void intl_error_set_custom_msg( intl_error* err, char* msg, int copyMsg TSRMLS_DC ) +void intl_error_set_custom_msg( intl_error* err, char* msg, int copyMsg ) { if( !msg ) return; if( !err ) { if( INTL_G( error_level ) ) - php_error_docref( NULL TSRMLS_CC, INTL_G( error_level ), "%s", msg ); + php_error_docref( NULL, INTL_G( error_level ), "%s", msg ); if( INTL_G( use_exceptions ) ) - zend_throw_exception_ex( IntlException_ce_ptr, 0 TSRMLS_CC, "%s", msg ); + zend_throw_exception_ex( IntlException_ce_ptr, 0, "%s", msg ); } - if( !err && !( err = intl_g_error_get( TSRMLS_C ) ) ) + if( !err && !( err = intl_g_error_get( ) ) ) return; /* Free previous message if any */ - intl_free_custom_error_msg( err TSRMLS_CC ); + intl_free_custom_error_msg( err ); /* Mark message copied if any */ err->free_custom_error_message = copyMsg; @@ -129,12 +129,12 @@ void intl_error_set_custom_msg( intl_error* err, char* msg, int copyMsg TSRMLS_D /* {{{ const char* intl_error_get_message( intl_error* err ) * Create output message in format "<intl_error_text>: <extra_user_error_text>". */ -zend_string * intl_error_get_message( intl_error* err TSRMLS_DC ) +zend_string * intl_error_get_message( intl_error* err ) { const char *uErrorName = NULL; zend_string *errMessage = 0; - if( !err && !( err = intl_g_error_get( TSRMLS_C ) ) ) + if( !err && !( err = intl_g_error_get( ) ) ) return STR_EMPTY_ALLOC(); uErrorName = u_errorName( err->code ); @@ -156,9 +156,9 @@ zend_string * intl_error_get_message( intl_error* err TSRMLS_DC ) /* {{{ void intl_error_set_code( intl_error* err, UErrorCode err_code ) * Set last error code. */ -void intl_error_set_code( intl_error* err, UErrorCode err_code TSRMLS_DC ) +void intl_error_set_code( intl_error* err, UErrorCode err_code ) { - if( !err && !( err = intl_g_error_get( TSRMLS_C ) ) ) + if( !err && !( err = intl_g_error_get( ) ) ) return; err->code = err_code; @@ -168,9 +168,9 @@ void intl_error_set_code( intl_error* err, UErrorCode err_code TSRMLS_DC ) /* {{{ void intl_error_get_code( intl_error* err ) * Return last error code. */ -UErrorCode intl_error_get_code( intl_error* err TSRMLS_DC ) +UErrorCode intl_error_get_code( intl_error* err ) { - if( !err && !( err = intl_g_error_get( TSRMLS_C ) ) ) + if( !err && !( err = intl_g_error_get( ) ) ) return U_ZERO_ERROR; return err->code; @@ -180,67 +180,67 @@ UErrorCode intl_error_get_code( intl_error* err TSRMLS_DC ) /* {{{ void intl_error_set( intl_error* err, UErrorCode code, char* msg, int copyMsg ) * Set error code and message. */ -void intl_error_set( intl_error* err, UErrorCode code, char* msg, int copyMsg TSRMLS_DC ) +void intl_error_set( intl_error* err, UErrorCode code, char* msg, int copyMsg ) { - intl_error_set_code( err, code TSRMLS_CC ); - intl_error_set_custom_msg( err, msg, copyMsg TSRMLS_CC ); + intl_error_set_code( err, code ); + intl_error_set_custom_msg( err, msg, copyMsg ); } /* }}} */ /* {{{ void intl_errors_set( intl_error* err, UErrorCode code, char* msg, int copyMsg ) * Set error code and message. */ -void intl_errors_set( intl_error* err, UErrorCode code, char* msg, int copyMsg TSRMLS_DC ) +void intl_errors_set( intl_error* err, UErrorCode code, char* msg, int copyMsg ) { - intl_errors_set_code( err, code TSRMLS_CC ); - intl_errors_set_custom_msg( err, msg, copyMsg TSRMLS_CC ); + intl_errors_set_code( err, code ); + intl_errors_set_custom_msg( err, msg, copyMsg ); } /* }}} */ /* {{{ void intl_errors_reset( intl_error* err ) */ -void intl_errors_reset( intl_error* err TSRMLS_DC ) +void intl_errors_reset( intl_error* err ) { if(err) { - intl_error_reset( err TSRMLS_CC ); + intl_error_reset( err ); } - intl_error_reset( NULL TSRMLS_CC ); + intl_error_reset( NULL ); } /* }}} */ /* {{{ void intl_errors_set_custom_msg( intl_error* err, char* msg, int copyMsg ) */ -void intl_errors_set_custom_msg( intl_error* err, char* msg, int copyMsg TSRMLS_DC ) +void intl_errors_set_custom_msg( intl_error* err, char* msg, int copyMsg ) { if(err) { - intl_error_set_custom_msg( err, msg, copyMsg TSRMLS_CC ); + intl_error_set_custom_msg( err, msg, copyMsg ); } - intl_error_set_custom_msg( NULL, msg, copyMsg TSRMLS_CC ); + intl_error_set_custom_msg( NULL, msg, copyMsg ); } /* }}} */ /* {{{ intl_errors_set_code( intl_error* err, UErrorCode err_code ) */ -void intl_errors_set_code( intl_error* err, UErrorCode err_code TSRMLS_DC ) +void intl_errors_set_code( intl_error* err, UErrorCode err_code ) { if(err) { - intl_error_set_code( err, err_code TSRMLS_CC ); + intl_error_set_code( err, err_code ); } - intl_error_set_code( NULL, err_code TSRMLS_CC ); + intl_error_set_code( NULL, err_code ); } /* }}} */ -void intl_register_IntlException_class( TSRMLS_D ) +void intl_register_IntlException_class( void ) { zend_class_entry ce, *default_exception_ce; - default_exception_ce = zend_exception_get_default( TSRMLS_C ); + default_exception_ce = zend_exception_get_default( ); /* Create and register 'IntlException' class. */ INIT_CLASS_ENTRY_EX( ce, "IntlException", sizeof( "IntlException" ) - 1, NULL ); IntlException_ce_ptr = zend_register_internal_class_ex( &ce, - default_exception_ce TSRMLS_CC ); + default_exception_ce ); IntlException_ce_ptr->create_object = default_exception_ce->create_object; } diff --git a/ext/intl/intl_error.h b/ext/intl/intl_error.h index b800d10dbf..02d62f0299 100644 --- a/ext/intl/intl_error.h +++ b/ext/intl/intl_error.h @@ -31,25 +31,25 @@ typedef struct _intl_error { int free_custom_error_message; } intl_error; -intl_error* intl_error_create( TSRMLS_D ); -void intl_error_init( intl_error* err TSRMLS_DC ); -void intl_error_reset( intl_error* err TSRMLS_DC ); -void intl_error_set_code( intl_error* err, UErrorCode err_code TSRMLS_DC ); -void intl_error_set_custom_msg( intl_error* err, char* msg, int copyMsg TSRMLS_DC ); -void intl_error_set( intl_error* err, UErrorCode code, char* msg, int copyMsg TSRMLS_DC ); -UErrorCode intl_error_get_code( intl_error* err TSRMLS_DC ); -zend_string* intl_error_get_message( intl_error* err TSRMLS_DC ); +intl_error* intl_error_create( void ); +void intl_error_init( intl_error* err ); +void intl_error_reset( intl_error* err ); +void intl_error_set_code( intl_error* err, UErrorCode err_code ); +void intl_error_set_custom_msg( intl_error* err, char* msg, int copyMsg ); +void intl_error_set( intl_error* err, UErrorCode code, char* msg, int copyMsg ); +UErrorCode intl_error_get_code( intl_error* err ); +zend_string* intl_error_get_message( intl_error* err ); // Wrappers to synchonize object's and global error structures. -void intl_errors_reset( intl_error* err TSRMLS_DC ); -void intl_errors_set_custom_msg( intl_error* err, char* msg, int copyMsg TSRMLS_DC ); -void intl_errors_set_code( intl_error* err, UErrorCode err_code TSRMLS_DC ); -void intl_errors_set( intl_error* err, UErrorCode code, char* msg, int copyMsg TSRMLS_DC ); +void intl_errors_reset( intl_error* err ); +void intl_errors_set_custom_msg( intl_error* err, char* msg, int copyMsg ); +void intl_errors_set_code( intl_error* err, UErrorCode err_code ); +void intl_errors_set( intl_error* err, UErrorCode code, char* msg, int copyMsg ); // Other error helpers smart_str intl_parse_error_to_string( UParseError* pe ); // exported to be called on extension MINIT -void intl_register_IntlException_class( TSRMLS_D ); +void intl_register_IntlException_class( void ); #endif // INTL_ERROR_H diff --git a/ext/intl/locale/locale.c b/ext/intl/locale/locale.c index 21c875ca5d..05141a9558 100644 --- a/ext/intl/locale/locale.c +++ b/ext/intl/locale/locale.c @@ -40,13 +40,13 @@ void locale_register_constants( INIT_FUNC_ARGS ) } #define LOCALE_EXPOSE_CONST(x) REGISTER_LONG_CONSTANT(#x, x, CONST_PERSISTENT | CONST_CS) - #define LOCALE_EXPOSE_CLASS_CONST(x) zend_declare_class_constant_long( Locale_ce_ptr, ZEND_STRS( #x ) - 1, ULOC_##x TSRMLS_CC ); - #define LOCALE_EXPOSE_CUSTOM_CLASS_CONST_STR(name, value) zend_declare_class_constant_string( Locale_ce_ptr, ZEND_STRS( name ) - 1, value TSRMLS_CC ); + #define LOCALE_EXPOSE_CLASS_CONST(x) zend_declare_class_constant_long( Locale_ce_ptr, ZEND_STRS( #x ) - 1, ULOC_##x ); + #define LOCALE_EXPOSE_CUSTOM_CLASS_CONST_STR(name, value) zend_declare_class_constant_string( Locale_ce_ptr, ZEND_STRS( name ) - 1, value ); LOCALE_EXPOSE_CLASS_CONST( ACTUAL_LOCALE ); LOCALE_EXPOSE_CLASS_CONST( VALID_LOCALE ); - zend_declare_class_constant_null(Locale_ce_ptr, ZEND_STRS("DEFAULT_LOCALE") - 1 TSRMLS_CC); + zend_declare_class_constant_null(Locale_ce_ptr, ZEND_STRS("DEFAULT_LOCALE") - 1); LOCALE_EXPOSE_CUSTOM_CLASS_CONST_STR( "LANG_TAG", LOC_LANG_TAG); LOCALE_EXPOSE_CUSTOM_CLASS_CONST_STR( "EXTLANG_TAG", LOC_EXTLANG_TAG); diff --git a/ext/intl/locale/locale_class.c b/ext/intl/locale/locale_class.c index eec4699b6d..6300666c59 100644 --- a/ext/intl/locale/locale_class.c +++ b/ext/intl/locale/locale_class.c @@ -92,14 +92,14 @@ zend_function_entry Locale_class_functions[] = { /* {{{ locale_register_Locale_class * Initialize 'Locale' class */ -void locale_register_Locale_class( TSRMLS_D ) +void locale_register_Locale_class( void ) { zend_class_entry ce; /* Create and register 'Locale' class. */ INIT_CLASS_ENTRY( ce, "Locale", Locale_class_functions ); ce.create_object = NULL; - Locale_ce_ptr = zend_register_internal_class( &ce TSRMLS_CC ); + Locale_ce_ptr = zend_register_internal_class( &ce ); /* Declare 'Locale' class properties. */ if( !Locale_ce_ptr ) diff --git a/ext/intl/locale/locale_class.h b/ext/intl/locale/locale_class.h index afae06c77c..1ff4df3a53 100644 --- a/ext/intl/locale/locale_class.h +++ b/ext/intl/locale/locale_class.h @@ -35,7 +35,7 @@ typedef struct { } Locale_object; -void locale_register_Locale_class( TSRMLS_D ); +void locale_register_Locale_class( void ); extern zend_class_entry *Locale_ce_ptr; @@ -43,6 +43,6 @@ extern zend_class_entry *Locale_ce_ptr; #define LOCALE_METHOD_INIT_VARS \ zval* object = NULL; \ - intl_error_reset( NULL TSRMLS_CC ); \ + intl_error_reset( NULL ); \ #endif // #ifndef LOCALE_CLASS_H diff --git a/ext/intl/locale/locale_methods.c b/ext/intl/locale/locale_methods.c index 27f917ffbb..e8f51398e6 100644 --- a/ext/intl/locale/locale_methods.c +++ b/ext/intl/locale/locale_methods.c @@ -211,7 +211,7 @@ static int getSingletonPos(const char* str) Get default locale */ PHP_NAMED_FUNCTION(zif_locale_get_default) { - RETURN_STRING( intl_locale_get_default( TSRMLS_C ) ); + RETURN_STRING( intl_locale_get_default( ) ); } /* }}} */ @@ -227,10 +227,10 @@ PHP_NAMED_FUNCTION(zif_locale_set_default) zend_string *ini_name; char *default_locale = NULL; - if(zend_parse_parameters( ZEND_NUM_ARGS() TSRMLS_CC, "S", &locale_name) == FAILURE) + if(zend_parse_parameters( ZEND_NUM_ARGS(), "S", &locale_name) == FAILURE) { intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, - "locale_set_default: unable to parse input params", 0 TSRMLS_CC ); + "locale_set_default: unable to parse input params", 0 ); RETURN_FALSE; } @@ -385,19 +385,19 @@ static void get_icu_value_src_php( char* tag_name, INTERNAL_FUNCTION_PARAMETERS) UErrorCode status = U_ZERO_ERROR; - intl_error_reset( NULL TSRMLS_CC ); + intl_error_reset( NULL ); - if(zend_parse_parameters( ZEND_NUM_ARGS() TSRMLS_CC, "s", + if(zend_parse_parameters( ZEND_NUM_ARGS(), "s", &loc_name ,&loc_name_len ) == FAILURE) { spprintf(&msg , 0, "locale_get_%s : unable to parse input params", tag_name ); - intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, msg , 1 TSRMLS_CC ); + intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, msg , 1 ); efree(msg); RETURN_FALSE; } if(loc_name_len == 0) { - loc_name = intl_locale_get_default(TSRMLS_C); + loc_name = intl_locale_get_default(); } /* Call ICU get */ @@ -422,7 +422,7 @@ static void get_icu_value_src_php( char* tag_name, INTERNAL_FUNCTION_PARAMETERS) /* Error encountered while fetching the value */ if( result ==0) { spprintf(&msg , 0, "locale_get_%s : unable to get locale %s", tag_name , tag_name ); - intl_error_set( NULL, status, msg , 1 TSRMLS_CC ); + intl_error_set( NULL, status, msg , 1 ); efree(msg); RETURN_NULL(); } @@ -493,14 +493,14 @@ static void get_icu_disp_value_src_php( char* tag_name, INTERNAL_FUNCTION_PARAME char* msg = NULL; int grOffset = 0; - intl_error_reset( NULL TSRMLS_CC ); + intl_error_reset( NULL ); - if(zend_parse_parameters( ZEND_NUM_ARGS() TSRMLS_CC, "s|s", + if(zend_parse_parameters( ZEND_NUM_ARGS(), "s|s", &loc_name, &loc_name_len , &disp_loc_name ,&disp_loc_name_len ) == FAILURE) { spprintf(&msg , 0, "locale_get_display_%s : unable to parse input params", tag_name ); - intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, msg , 1 TSRMLS_CC ); + intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, msg , 1 ); efree(msg); RETURN_FALSE; } @@ -508,13 +508,13 @@ static void get_icu_disp_value_src_php( char* tag_name, INTERNAL_FUNCTION_PARAME if(loc_name_len > ULOC_FULLNAME_CAPACITY) { /* See bug 67397: overlong locale names cause trouble in uloc_getDisplayName */ spprintf(&msg , 0, "locale_get_display_%s : name too long", tag_name ); - intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, msg , 1 TSRMLS_CC ); + intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, msg , 1 ); efree(msg); RETURN_FALSE; } if(loc_name_len == 0) { - loc_name = intl_locale_get_default(TSRMLS_C); + loc_name = intl_locale_get_default(); } if( strcmp(tag_name, DISP_NAME) != 0 ){ @@ -536,7 +536,7 @@ static void get_icu_disp_value_src_php( char* tag_name, INTERNAL_FUNCTION_PARAME /* Check if disp_loc_name passed , if not use default locale */ if( !disp_loc_name){ - disp_loc_name = estrdup(intl_locale_get_default(TSRMLS_C)); + disp_loc_name = estrdup(intl_locale_get_default()); free_loc_name = 1; } @@ -567,7 +567,7 @@ static void get_icu_disp_value_src_php( char* tag_name, INTERNAL_FUNCTION_PARAME } spprintf(&msg, 0, "locale_get_display_%s : unable to get locale %s", tag_name , tag_name ); - intl_error_set( NULL, status, msg , 1 TSRMLS_CC ); + intl_error_set( NULL, status, msg , 1 ); efree(msg); if( disp_name){ efree( disp_name ); @@ -596,7 +596,7 @@ static void get_icu_disp_value_src_php( char* tag_name, INTERNAL_FUNCTION_PARAME if( U_FAILURE( status ) ) { spprintf(&msg, 0, "locale_get_display_%s :error converting display name for %s to UTF-8", tag_name , tag_name ); - intl_error_set( NULL, status, msg , 1 TSRMLS_CC ); + intl_error_set( NULL, status, msg , 1 ); efree(msg); RETURN_FALSE; } @@ -698,19 +698,19 @@ PHP_FUNCTION( locale_get_keywords ) char* kw_value = NULL; int32_t kw_value_len = 100; - intl_error_reset( NULL TSRMLS_CC ); + intl_error_reset( NULL ); - if(zend_parse_parameters( ZEND_NUM_ARGS() TSRMLS_CC, "s", + if(zend_parse_parameters( ZEND_NUM_ARGS(), "s", &loc_name, &loc_name_len ) == FAILURE) { intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, - "locale_get_keywords: unable to parse input params", 0 TSRMLS_CC ); + "locale_get_keywords: unable to parse input params", 0 ); RETURN_FALSE; } if(loc_name_len == 0) { - loc_name = intl_locale_get_default(TSRMLS_C); + loc_name = intl_locale_get_default(); } /* Get the keywords */ @@ -733,7 +733,7 @@ PHP_FUNCTION( locale_get_keywords ) kw_value = erealloc( kw_value , kw_value_len+1); } if (U_FAILURE(status)) { - intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, "locale_get_keywords: Error encountered while getting the keyword value for the keyword", 0 TSRMLS_CC ); + intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, "locale_get_keywords: Error encountered while getting the keyword value for the keyword", 0 ); if( kw_value){ efree( kw_value ); } @@ -811,7 +811,7 @@ static void add_prefix(smart_str* loc_name, char* key_name) * returns 1 if successful , -1 if not found , * 0 if array element is not a string , -2 if buffer-overflow */ -static int append_multiple_key_values(smart_str* loc_name, HashTable* hash_arr, char* key_name TSRMLS_DC) +static int append_multiple_key_values(smart_str* loc_name, HashTable* hash_arr, char* key_name) { zval *ele_value; int i = 0; @@ -885,12 +885,12 @@ static int append_multiple_key_values(smart_str* loc_name, HashTable* hash_arr, * returns 0 if locale_compose needs to be aborted * otherwise returns 1 */ -static int handleAppendResult( int result, smart_str* loc_name TSRMLS_DC) +static int handleAppendResult( int result, smart_str* loc_name) { - intl_error_reset( NULL TSRMLS_CC ); + intl_error_reset( NULL ); if( result == FAILURE) { intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, - "locale_compose: parameter array element is not a string", 0 TSRMLS_CC ); + "locale_compose: parameter array element is not a string", 0 ); smart_str_free(loc_name); return 0; } @@ -913,13 +913,13 @@ PHP_FUNCTION(locale_compose) HashTable* hash_arr = NULL; int result = 0; - intl_error_reset( NULL TSRMLS_CC ); + intl_error_reset( NULL ); - if(zend_parse_parameters( ZEND_NUM_ARGS() TSRMLS_CC, "a", + if(zend_parse_parameters( ZEND_NUM_ARGS(), "a", &arr) == FAILURE) { intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, - "locale_compose: unable to parse input params", 0 TSRMLS_CC ); + "locale_compose: unable to parse input params", 0 ); RETURN_FALSE; } @@ -933,7 +933,7 @@ PHP_FUNCTION(locale_compose) if( result == SUCCESS){ RETURN_SMART_STR(loc_name); } - if( !handleAppendResult( result, loc_name TSRMLS_CC)){ + if( !handleAppendResult( result, loc_name)){ RETURN_FALSE; } @@ -941,41 +941,41 @@ PHP_FUNCTION(locale_compose) result = append_key_value(loc_name, hash_arr , LOC_LANG_TAG); if( result == LOC_NOT_FOUND ){ intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, - "locale_compose: parameter array does not contain 'language' tag.", 0 TSRMLS_CC ); + "locale_compose: parameter array does not contain 'language' tag.", 0 ); smart_str_free(loc_name); RETURN_FALSE; } - if( !handleAppendResult( result, loc_name TSRMLS_CC)){ + if( !handleAppendResult( result, loc_name)){ RETURN_FALSE; } /* Extlang */ - result = append_multiple_key_values(loc_name, hash_arr , LOC_EXTLANG_TAG TSRMLS_CC); - if( !handleAppendResult( result, loc_name TSRMLS_CC)){ + result = append_multiple_key_values(loc_name, hash_arr , LOC_EXTLANG_TAG); + if( !handleAppendResult( result, loc_name)){ RETURN_FALSE; } /* Script */ result = append_key_value(loc_name, hash_arr , LOC_SCRIPT_TAG); - if( !handleAppendResult( result, loc_name TSRMLS_CC)){ + if( !handleAppendResult( result, loc_name)){ RETURN_FALSE; } /* Region */ result = append_key_value( loc_name, hash_arr , LOC_REGION_TAG); - if( !handleAppendResult( result, loc_name TSRMLS_CC)){ + if( !handleAppendResult( result, loc_name)){ RETURN_FALSE; } /* Variant */ - result = append_multiple_key_values( loc_name, hash_arr , LOC_VARIANT_TAG TSRMLS_CC); - if( !handleAppendResult( result, loc_name TSRMLS_CC)){ + result = append_multiple_key_values( loc_name, hash_arr , LOC_VARIANT_TAG); + if( !handleAppendResult( result, loc_name)){ RETURN_FALSE; } /* Private */ - result = append_multiple_key_values( loc_name, hash_arr , LOC_PRIVATE_TAG TSRMLS_CC); - if( !handleAppendResult( result, loc_name TSRMLS_CC)){ + result = append_multiple_key_values( loc_name, hash_arr , LOC_PRIVATE_TAG); + if( !handleAppendResult( result, loc_name)){ RETURN_FALSE; } @@ -1035,7 +1035,7 @@ static char* get_private_subtags(const char* loc_name) /* {{{ code used by locale_parse */ -static int add_array_entry(const char* loc_name, zval* hash_arr, char* key_name TSRMLS_DC) +static int add_array_entry(const char* loc_name, zval* hash_arr, char* key_name) { char* key_value = NULL; char* cur_key_name = NULL; @@ -1104,19 +1104,19 @@ PHP_FUNCTION(locale_parse) size_t loc_name_len = 0; int grOffset = 0; - intl_error_reset( NULL TSRMLS_CC ); + intl_error_reset( NULL ); - if(zend_parse_parameters( ZEND_NUM_ARGS() TSRMLS_CC, "s", + if(zend_parse_parameters( ZEND_NUM_ARGS(), "s", &loc_name, &loc_name_len ) == FAILURE) { intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, - "locale_parse: unable to parse input params", 0 TSRMLS_CC ); + "locale_parse: unable to parse input params", 0 ); RETURN_FALSE; } if(loc_name_len == 0) { - loc_name = intl_locale_get_default(TSRMLS_C); + loc_name = intl_locale_get_default(); } array_init( return_value ); @@ -1127,11 +1127,11 @@ PHP_FUNCTION(locale_parse) } else{ /* Not grandfathered */ - add_array_entry( loc_name , return_value , LOC_LANG_TAG TSRMLS_CC); - add_array_entry( loc_name , return_value , LOC_SCRIPT_TAG TSRMLS_CC); - add_array_entry( loc_name , return_value , LOC_REGION_TAG TSRMLS_CC); - add_array_entry( loc_name , return_value , LOC_VARIANT_TAG TSRMLS_CC); - add_array_entry( loc_name , return_value , LOC_PRIVATE_TAG TSRMLS_CC); + add_array_entry( loc_name , return_value , LOC_LANG_TAG); + add_array_entry( loc_name , return_value , LOC_SCRIPT_TAG); + add_array_entry( loc_name , return_value , LOC_REGION_TAG); + add_array_entry( loc_name , return_value , LOC_VARIANT_TAG); + add_array_entry( loc_name , return_value , LOC_PRIVATE_TAG); } } /* }}} */ @@ -1152,19 +1152,19 @@ PHP_FUNCTION(locale_get_all_variants) char* variant = NULL; char* saved_ptr = NULL; - intl_error_reset( NULL TSRMLS_CC ); + intl_error_reset( NULL ); - if(zend_parse_parameters( ZEND_NUM_ARGS() TSRMLS_CC, "s", + if(zend_parse_parameters( ZEND_NUM_ARGS(), "s", &loc_name, &loc_name_len ) == FAILURE) { intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, - "locale_parse: unable to parse input params", 0 TSRMLS_CC ); + "locale_parse: unable to parse input params", 0 ); RETURN_FALSE; } if(loc_name_len == 0) { - loc_name = intl_locale_get_default(TSRMLS_C); + loc_name = intl_locale_get_default(); } @@ -1257,20 +1257,20 @@ PHP_FUNCTION(locale_filter_matches) zend_bool boolCanonical = 0; UErrorCode status = U_ZERO_ERROR; - intl_error_reset( NULL TSRMLS_CC ); + intl_error_reset( NULL ); - if(zend_parse_parameters( ZEND_NUM_ARGS() TSRMLS_CC, "ss|b", + if(zend_parse_parameters( ZEND_NUM_ARGS(), "ss|b", &lang_tag, &lang_tag_len , &loc_range , &loc_range_len , &boolCanonical) == FAILURE) { intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, - "locale_filter_matches: unable to parse input params", 0 TSRMLS_CC ); + "locale_filter_matches: unable to parse input params", 0 ); RETURN_FALSE; } if(loc_range_len == 0) { - loc_range = intl_locale_get_default(TSRMLS_C); + loc_range = intl_locale_get_default(); } if( strcmp(loc_range,"*")==0){ @@ -1282,7 +1282,7 @@ PHP_FUNCTION(locale_filter_matches) can_loc_range=get_icu_value_internal( loc_range , LOC_CANONICALIZE_TAG , &result , 0); if( result ==0) { intl_error_set( NULL, status, - "locale_filter_matches : unable to canonicalize loc_range" , 0 TSRMLS_CC ); + "locale_filter_matches : unable to canonicalize loc_range" , 0 ); RETURN_FALSE; } @@ -1290,7 +1290,7 @@ PHP_FUNCTION(locale_filter_matches) can_lang_tag = get_icu_value_internal( lang_tag , LOC_CANONICALIZE_TAG , &result , 0); if( result ==0) { intl_error_set( NULL, status, - "locale_filter_matches : unable to canonicalize lang_tag" , 0 TSRMLS_CC ); + "locale_filter_matches : unable to canonicalize lang_tag" , 0 ); RETURN_FALSE; } @@ -1417,7 +1417,7 @@ static void array_cleanup( char* arr[] , int arr_size) * returns the lookup result to lookup_loc_range_src_php * internal function */ -static char* lookup_loc_range(const char* loc_range, HashTable* hash_arr, int canonicalize TSRMLS_DC) +static char* lookup_loc_range(const char* loc_range, HashTable* hash_arr, int canonicalize ) { int i = 0; int cur_arr_len = 0; @@ -1438,13 +1438,13 @@ static char* lookup_loc_range(const char* loc_range, HashTable* hash_arr, int ca /* convert the array to lowercase , also replace hyphens with the underscore and store it in cur_arr */ if(Z_TYPE_P(ele_value)!= IS_STRING) { /* element value is not a string */ - intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, "lookup_loc_range: locale array element is not a string", 0 TSRMLS_CC); + intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, "lookup_loc_range: locale array element is not a string", 0); LOOKUP_CLEAN_RETURN(NULL); } cur_arr[cur_arr_len*2] = estrndup(Z_STRVAL_P(ele_value), Z_STRLEN_P(ele_value)); result = strToMatch(Z_STRVAL_P(ele_value), cur_arr[cur_arr_len*2]); if(result == 0) { - intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, "lookup_loc_range: unable to canonicalize lang_tag", 0 TSRMLS_CC); + intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, "lookup_loc_range: unable to canonicalize lang_tag", 0); LOOKUP_CLEAN_RETURN(NULL); } cur_arr[cur_arr_len*2+1] = Z_STRVAL_P(ele_value); @@ -1459,14 +1459,14 @@ static char* lookup_loc_range(const char* loc_range, HashTable* hash_arr, int ca if(lang_tag) { efree(lang_tag); } - intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, "lookup_loc_range: unable to canonicalize lang_tag" , 0 TSRMLS_CC); + intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, "lookup_loc_range: unable to canonicalize lang_tag" , 0); LOOKUP_CLEAN_RETURN(NULL); } cur_arr[i*2] = erealloc(cur_arr[i*2], strlen(lang_tag)+1); result = strToMatch(lang_tag, cur_arr[i*2]); efree(lang_tag); if(result == 0) { - intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, "lookup_loc_range: unable to canonicalize lang_tag" , 0 TSRMLS_CC); + intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, "lookup_loc_range: unable to canonicalize lang_tag" , 0); LOOKUP_CLEAN_RETURN(NULL); } } @@ -1478,7 +1478,7 @@ static char* lookup_loc_range(const char* loc_range, HashTable* hash_arr, int ca can_loc_range = get_icu_value_internal(loc_range, LOC_CANONICALIZE_TAG, &result , 0); if( result != 1 || can_loc_range == NULL || !can_loc_range[0]) { /* Error */ - intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, "lookup_loc_range: unable to canonicalize loc_range" , 0 TSRMLS_CC ); + intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, "lookup_loc_range: unable to canonicalize loc_range" , 0 ); if(can_loc_range) { efree(can_loc_range); } @@ -1495,7 +1495,7 @@ static char* lookup_loc_range(const char* loc_range, HashTable* hash_arr, int ca efree(can_loc_range); } if(result == 0) { - intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, "lookup_loc_range: unable to canonicalize lang_tag" , 0 TSRMLS_CC); + intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, "lookup_loc_range: unable to canonicalize lang_tag" , 0); LOOKUP_CLEAN_RETURN(NULL); } @@ -1540,16 +1540,16 @@ PHP_FUNCTION(locale_lookup) zend_bool boolCanonical = 0; char* result =NULL; - intl_error_reset( NULL TSRMLS_CC ); + intl_error_reset( NULL ); - if(zend_parse_parameters( ZEND_NUM_ARGS() TSRMLS_CC, "as|bs", &arr, &loc_range, &loc_range_len, + if(zend_parse_parameters( ZEND_NUM_ARGS(), "as|bs", &arr, &loc_range, &loc_range_len, &boolCanonical, &fallback_loc, &fallback_loc_len) == FAILURE) { - intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, "locale_lookup: unable to parse input params", 0 TSRMLS_CC ); + intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, "locale_lookup: unable to parse input params", 0 ); RETURN_FALSE; } if(loc_range_len == 0) { - loc_range = intl_locale_get_default(TSRMLS_C); + loc_range = intl_locale_get_default(); } hash_arr = HASH_OF(arr); @@ -1558,7 +1558,7 @@ PHP_FUNCTION(locale_lookup) RETURN_EMPTY_STRING(); } - result = lookup_loc_range(loc_range, hash_arr, boolCanonical TSRMLS_CC); + result = lookup_loc_range(loc_range, hash_arr, boolCanonical); if(result == NULL || result[0] == '\0') { if( fallback_loc ) { result = estrndup(fallback_loc, fallback_loc_len); @@ -1590,10 +1590,10 @@ PHP_FUNCTION(locale_accept_from_http) char resultLocale[INTL_MAX_LOCALE_LEN+1]; UAcceptResult outResult; - if(zend_parse_parameters( ZEND_NUM_ARGS() TSRMLS_CC, "s", &http_accept, &http_accept_len) == FAILURE) + if(zend_parse_parameters( ZEND_NUM_ARGS(), "s", &http_accept, &http_accept_len) == FAILURE) { intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, - "locale_accept_from_http: unable to parse input parameters", 0 TSRMLS_CC ); + "locale_accept_from_http: unable to parse input parameters", 0 ); RETURN_FALSE; } 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); } /* }}} */ diff --git a/ext/intl/normalizer/normalizer.c b/ext/intl/normalizer/normalizer.c index 18c3cedcaf..3a0d526b77 100644 --- a/ext/intl/normalizer/normalizer.c +++ b/ext/intl/normalizer/normalizer.c @@ -38,8 +38,8 @@ void normalizer_register_constants( INIT_FUNC_ARGS ) } #define NORMALIZER_EXPOSE_CONST(x) REGISTER_LONG_CONSTANT(#x, x, CONST_PERSISTENT | CONST_CS) - #define NORMALIZER_EXPOSE_CLASS_CONST(x) zend_declare_class_constant_long( Normalizer_ce_ptr, ZEND_STRS( #x ) - 1, NORMALIZER_##x TSRMLS_CC ); - #define NORMALIZER_EXPOSE_CUSTOM_CLASS_CONST(name, value) zend_declare_class_constant_long( Normalizer_ce_ptr, ZEND_STRS( name ) - 1, value TSRMLS_CC ); + #define NORMALIZER_EXPOSE_CLASS_CONST(x) zend_declare_class_constant_long( Normalizer_ce_ptr, ZEND_STRS( #x ) - 1, NORMALIZER_##x ); + #define NORMALIZER_EXPOSE_CUSTOM_CLASS_CONST(name, value) zend_declare_class_constant_long( Normalizer_ce_ptr, ZEND_STRS( name ) - 1, value ); /* Normalization form constants */ NORMALIZER_EXPOSE_CLASS_CONST( NONE ); diff --git a/ext/intl/normalizer/normalizer_class.c b/ext/intl/normalizer/normalizer_class.c index ccd8be3b29..93a5624663 100644 --- a/ext/intl/normalizer/normalizer_class.c +++ b/ext/intl/normalizer/normalizer_class.c @@ -51,14 +51,14 @@ zend_function_entry Normalizer_class_functions[] = { /* {{{ normalizer_register_Normalizer_class * Initialize 'Normalizer' class */ -void normalizer_register_Normalizer_class( TSRMLS_D ) +void normalizer_register_Normalizer_class( void ) { zend_class_entry ce; /* Create and register 'Normalizer' class. */ INIT_CLASS_ENTRY( ce, "Normalizer", Normalizer_class_functions ); ce.create_object = NULL; - Normalizer_ce_ptr = zend_register_internal_class( &ce TSRMLS_CC ); + Normalizer_ce_ptr = zend_register_internal_class( &ce ); /* Declare 'Normalizer' class properties. */ if( !Normalizer_ce_ptr ) diff --git a/ext/intl/normalizer/normalizer_class.h b/ext/intl/normalizer/normalizer_class.h index 3ce37fae88..de5a168a45 100644 --- a/ext/intl/normalizer/normalizer_class.h +++ b/ext/intl/normalizer/normalizer_class.h @@ -38,6 +38,6 @@ typedef struct { #define NORMALIZER_ERROR_CODE(co) INTL_ERROR_CODE(NORMALIZER_ERROR(co)) #define NORMALIZER_ERROR_CODE_P(co) &(INTL_ERROR_CODE(NORMALIZER_ERROR(co))) -void normalizer_register_Normalizer_class( TSRMLS_D ); +void normalizer_register_Normalizer_class( void ); extern zend_class_entry *Normalizer_ce_ptr; #endif // #ifndef NORMALIZER_CLASS_H diff --git a/ext/intl/normalizer/normalizer_normalize.c b/ext/intl/normalizer/normalizer_normalize.c index d3ac07024b..97163a98c4 100644 --- a/ext/intl/normalizer/normalizer_normalize.c +++ b/ext/intl/normalizer/normalizer_normalize.c @@ -50,14 +50,14 @@ PHP_FUNCTION( normalizer_normalize ) int32_t size_needed; - intl_error_reset( NULL TSRMLS_CC ); + intl_error_reset( NULL ); /* Parse parameters. */ - if( zend_parse_method_parameters( ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "s|l", + if( zend_parse_method_parameters( ZEND_NUM_ARGS(), getThis(), "s|l", &input, &input_len, &form ) == FAILURE ) { intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, - "normalizer_normalize: unable to parse input params", 0 TSRMLS_CC ); + "normalizer_normalize: unable to parse input params", 0 ); RETURN_FALSE; } @@ -78,7 +78,7 @@ PHP_FUNCTION( normalizer_normalize ) break; default: intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, - "normalizer_normalize: illegal normalization form", 0 TSRMLS_CC ); + "normalizer_normalize: illegal normalization form", 0 ); RETURN_FALSE; } @@ -92,10 +92,10 @@ PHP_FUNCTION( normalizer_normalize ) if( U_FAILURE( status ) ) { /* Set global error code. */ - intl_error_set_code( NULL, status TSRMLS_CC ); + intl_error_set_code( NULL, status ); /* Set error messages. */ - intl_error_set_custom_msg( NULL, "Error converting input string to UTF-16", 0 TSRMLS_CC ); + intl_error_set_custom_msg( NULL, "Error converting input string to UTF-16", 0 ); if (uinput) { efree( uinput ); } @@ -136,7 +136,7 @@ PHP_FUNCTION( normalizer_normalize ) /* Bail out if an unexpected error occurred. */ if( U_FAILURE(status) ) { /* Set error messages. */ - intl_error_set_custom_msg( NULL,"Error normalizing string", 0 TSRMLS_CC ); + intl_error_set_custom_msg( NULL,"Error normalizing string", 0 ); efree( uret_buf ); efree( uinput ); RETURN_FALSE; @@ -154,7 +154,7 @@ PHP_FUNCTION( normalizer_normalize ) if( U_FAILURE( status ) ) { intl_error_set( NULL, status, - "normalizer_normalize: error converting normalized text UTF-8", 0 TSRMLS_CC ); + "normalizer_normalize: error converting normalized text UTF-8", 0 ); RETURN_FALSE; } @@ -183,14 +183,14 @@ PHP_FUNCTION( normalizer_is_normalized ) UBool uret = FALSE; - intl_error_reset( NULL TSRMLS_CC ); + intl_error_reset( NULL ); /* Parse parameters. */ - if( zend_parse_method_parameters( ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "s|l", + if( zend_parse_method_parameters( ZEND_NUM_ARGS(), getThis(), "s|l", &input, &input_len, &form) == FAILURE ) { intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, - "normalizer_is_normalized: unable to parse input params", 0 TSRMLS_CC ); + "normalizer_is_normalized: unable to parse input params", 0 ); RETURN_FALSE; } @@ -205,7 +205,7 @@ PHP_FUNCTION( normalizer_is_normalized ) break; default: intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, - "normalizer_normalize: illegal normalization form", 0 TSRMLS_CC ); + "normalizer_normalize: illegal normalization form", 0 ); RETURN_FALSE; } @@ -220,10 +220,10 @@ PHP_FUNCTION( normalizer_is_normalized ) if( U_FAILURE( status ) ) { /* Set global error code. */ - intl_error_set_code( NULL, status TSRMLS_CC ); + intl_error_set_code( NULL, status ); /* Set error messages. */ - intl_error_set_custom_msg( NULL, "Error converting string to UTF-16.", 0 TSRMLS_CC ); + intl_error_set_custom_msg( NULL, "Error converting string to UTF-16.", 0 ); if (uinput) { efree( uinput ); } @@ -239,7 +239,7 @@ PHP_FUNCTION( normalizer_is_normalized ) /* Bail out if an unexpected error occurred. */ if( U_FAILURE(status) ) { /* Set error messages. */ - intl_error_set_custom_msg( NULL,"Error testing if string is the given normalization form.", 0 TSRMLS_CC ); + intl_error_set_custom_msg( NULL,"Error testing if string is the given normalization form.", 0 ); RETURN_FALSE; } diff --git a/ext/intl/php_intl.c b/ext/intl/php_intl.c index 15f058d2b4..2ac1888061 100644 --- a/ext/intl/php_intl.c +++ b/ext/intl/php_intl.c @@ -116,7 +116,7 @@ ZEND_DECLARE_MODULE_GLOBALS( intl ) -const char *intl_locale_get_default( TSRMLS_D ) +const char *intl_locale_get_default( void ) { if( INTL_G(default_locale) == NULL ) { return uloc_getDefault(); @@ -923,53 +923,53 @@ PHP_MINIT_FUNCTION( intl ) #endif /* Register 'Collator' PHP class */ - collator_register_Collator_class( TSRMLS_C ); + collator_register_Collator_class( ); /* Expose Collator constants to PHP scripts */ collator_register_constants( INIT_FUNC_ARGS_PASSTHRU ); /* Register 'NumberFormatter' PHP class */ - formatter_register_class( TSRMLS_C ); + formatter_register_class( ); /* Expose NumberFormatter constants to PHP scripts */ formatter_register_constants( INIT_FUNC_ARGS_PASSTHRU ); /* Register 'Normalizer' PHP class */ - normalizer_register_Normalizer_class( TSRMLS_C ); + normalizer_register_Normalizer_class( ); /* Expose Normalizer constants to PHP scripts */ normalizer_register_constants( INIT_FUNC_ARGS_PASSTHRU ); /* Register 'Locale' PHP class */ - locale_register_Locale_class( TSRMLS_C ); + locale_register_Locale_class( ); /* Expose Locale constants to PHP scripts */ locale_register_constants( INIT_FUNC_ARGS_PASSTHRU ); - msgformat_register_class(TSRMLS_C); + msgformat_register_class(); grapheme_register_constants( INIT_FUNC_ARGS_PASSTHRU ); /* Register 'DateFormat' PHP class */ - dateformat_register_IntlDateFormatter_class( TSRMLS_C ); + dateformat_register_IntlDateFormatter_class( ); /* Expose DateFormat constants to PHP scripts */ dateformat_register_constants( INIT_FUNC_ARGS_PASSTHRU ); /* Register 'ResourceBundle' PHP class */ - resourcebundle_register_class( TSRMLS_C); + resourcebundle_register_class( ); /* Register 'Transliterator' PHP class */ - transliterator_register_Transliterator_class( TSRMLS_C ); + transliterator_register_Transliterator_class( ); /* Register Transliterator constants */ transliterator_register_constants( INIT_FUNC_ARGS_PASSTHRU ); /* Register 'IntlTimeZone' PHP class */ - timezone_register_IntlTimeZone_class( TSRMLS_C ); + timezone_register_IntlTimeZone_class( ); /* Register 'IntlCalendar' PHP class */ - calendar_register_IntlCalendar_class( TSRMLS_C ); + calendar_register_IntlCalendar_class( ); /* Expose ICU error codes to PHP scripts. */ intl_expose_icu_error_codes( INIT_FUNC_ARGS_PASSTHRU ); @@ -979,26 +979,26 @@ PHP_MINIT_FUNCTION( intl ) #if U_ICU_VERSION_MAJOR_NUM * 1000 + U_ICU_VERSION_MINOR_NUM >= 4002 /* Register 'Spoofchecker' PHP class */ - spoofchecker_register_Spoofchecker_class( TSRMLS_C ); + spoofchecker_register_Spoofchecker_class( ); /* Expose Spoofchecker constants to PHP scripts */ spoofchecker_register_constants( INIT_FUNC_ARGS_PASSTHRU ); #endif /* Register 'IntlException' PHP class */ - intl_register_IntlException_class( TSRMLS_C ); + intl_register_IntlException_class( ); /* Register 'IntlIterator' PHP class */ - intl_register_IntlIterator_class( TSRMLS_C ); + intl_register_IntlIterator_class( ); /* Register 'BreakIterator' class */ - breakiterator_register_BreakIterator_class( TSRMLS_C ); + breakiterator_register_BreakIterator_class( ); /* Register 'IntlPartsIterator' class */ - breakiterator_register_IntlPartsIterator_class( TSRMLS_C ); + breakiterator_register_IntlPartsIterator_class( ); /* Global error handling. */ - intl_error_init( NULL TSRMLS_CC ); + intl_error_init( NULL ); /* 'Converter' class for codepage conversions */ php_converter_minit(INIT_FUNC_ARGS_PASSTHRU); @@ -1042,11 +1042,11 @@ PHP_RSHUTDOWN_FUNCTION( intl ) ZVAL_UNDEF(&INTL_G(current_collator)); } if (INTL_G(grapheme_iterator)) { - grapheme_close_global_iterator( TSRMLS_C ); + grapheme_close_global_iterator( ); INTL_G(grapheme_iterator) = NULL; } - intl_error_reset( NULL TSRMLS_CC); + intl_error_reset( NULL); return SUCCESS; } /* }}} */ diff --git a/ext/intl/php_intl.h b/ext/intl/php_intl.h index 265cdb7b9e..822ea02183 100644 --- a/ext/intl/php_intl.h +++ b/ext/intl/php_intl.h @@ -72,7 +72,7 @@ PHP_RINIT_FUNCTION(intl); PHP_RSHUTDOWN_FUNCTION(intl); PHP_MINFO_FUNCTION(intl); -const char *intl_locale_get_default( TSRMLS_D ); +const char *intl_locale_get_default( void ); #define PHP_INTL_VERSION "1.1.0" diff --git a/ext/intl/resourcebundle/resourcebundle.c b/ext/intl/resourcebundle/resourcebundle.c index 9b6b734ed6..62a268c07f 100644 --- a/ext/intl/resourcebundle/resourcebundle.c +++ b/ext/intl/resourcebundle/resourcebundle.c @@ -24,7 +24,7 @@ #include "resourcebundle/resourcebundle_class.h" /* {{{ ResourceBundle_extract_value */ -void resourcebundle_extract_value( zval *return_value, ResourceBundle_object *source TSRMLS_DC ) +void resourcebundle_extract_value( zval *return_value, ResourceBundle_object *source ) { UResType restype; const UChar* ufield; @@ -71,11 +71,11 @@ void resourcebundle_extract_value( zval *return_value, ResourceBundle_object *so newrb = Z_INTL_RESOURCEBUNDLE_P(return_value); newrb->me = source->child; source->child = NULL; - intl_errors_reset(INTL_DATA_ERROR_P(source) TSRMLS_CC); + intl_errors_reset(INTL_DATA_ERROR_P(source)); break; default: - intl_errors_set(INTL_DATA_ERROR_P(source), U_ILLEGAL_ARGUMENT_ERROR, "Unknown resource type", 0 TSRMLS_CC); + intl_errors_set(INTL_DATA_ERROR_P(source), U_ILLEGAL_ARGUMENT_ERROR, "Unknown resource type", 0); RETURN_FALSE; break; } diff --git a/ext/intl/resourcebundle/resourcebundle.h b/ext/intl/resourcebundle/resourcebundle.h index e5aa9f092b..46a6ad5766 100644 --- a/ext/intl/resourcebundle/resourcebundle.h +++ b/ext/intl/resourcebundle/resourcebundle.h @@ -23,6 +23,6 @@ #include "resourcebundle/resourcebundle_class.h" -void resourcebundle_extract_value( zval *target, ResourceBundle_object *source TSRMLS_DC); +void resourcebundle_extract_value( zval *target, ResourceBundle_object *source); #endif // #ifndef RESOURCEBUNDLE_CLASS_H diff --git a/ext/intl/resourcebundle/resourcebundle_class.c b/ext/intl/resourcebundle/resourcebundle_class.c index 0fbf7931d4..67e2bae855 100644 --- a/ext/intl/resourcebundle/resourcebundle_class.c +++ b/ext/intl/resourcebundle/resourcebundle_class.c @@ -35,12 +35,12 @@ zend_class_entry *ResourceBundle_ce_ptr = NULL; static zend_object_handlers ResourceBundle_object_handlers; /* {{{ ResourceBundle_object_dtor */ -static void ResourceBundle_object_destroy( zend_object *object TSRMLS_DC ) +static void ResourceBundle_object_destroy( zend_object *object ) { ResourceBundle_object *rb = php_intl_resourcebundle_fetch_object(object); // only free local errors - intl_error_reset( INTL_DATA_ERROR_P(rb) TSRMLS_CC ); + intl_error_reset( INTL_DATA_ERROR_P(rb) ); if (rb->me) { ures_close( rb->me ); @@ -49,21 +49,21 @@ static void ResourceBundle_object_destroy( zend_object *object TSRMLS_DC ) ures_close( rb->child ); } - //???zend_object_std_dtor( object TSRMLS_CC ); + //???zend_object_std_dtor( object ); } /* }}} */ /* {{{ ResourceBundle_object_create */ -static zend_object *ResourceBundle_object_create( zend_class_entry *ce TSRMLS_DC ) +static zend_object *ResourceBundle_object_create( zend_class_entry *ce ) { ResourceBundle_object *rb; rb = ecalloc( 1, sizeof(ResourceBundle_object) + sizeof(zval) * (ce->default_properties_count - 1) ); - zend_object_std_init( &rb->zend, ce TSRMLS_CC ); + zend_object_std_init( &rb->zend, ce ); object_properties_init( &rb->zend, ce); - intl_error_init( INTL_DATA_ERROR_P(rb) TSRMLS_CC ); + intl_error_init( INTL_DATA_ERROR_P(rb) ); rb->me = NULL; rb->child = NULL; @@ -85,13 +85,13 @@ static void resourcebundle_ctor(INTERNAL_FUNCTION_PARAMETERS) zval *object = return_value; ResourceBundle_object *rb = Z_INTL_RESOURCEBUNDLE_P( object ); - intl_error_reset( NULL TSRMLS_CC ); + intl_error_reset( NULL ); - if( zend_parse_parameters( ZEND_NUM_ARGS() TSRMLS_CC, "s!s!|b", + if( zend_parse_parameters( ZEND_NUM_ARGS(), "s!s!|b", &locale, &locale_len, &bundlename, &bundlename_len, &fallback ) == FAILURE ) { intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, - "resourcebundle_ctor: unable to parse input parameters", 0 TSRMLS_CC ); + "resourcebundle_ctor: unable to parse input parameters", 0 ); Z_OBJ_P(return_value) = NULL; return; } @@ -99,7 +99,7 @@ static void resourcebundle_ctor(INTERNAL_FUNCTION_PARAMETERS) INTL_CHECK_LOCALE_LEN_OBJ(locale_len, return_value); if (locale == NULL) { - locale = intl_locale_get_default(TSRMLS_C); + locale = intl_locale_get_default(); } if (fallback) { @@ -113,13 +113,13 @@ static void resourcebundle_ctor(INTERNAL_FUNCTION_PARAMETERS) if (!fallback && (INTL_DATA_ERROR_CODE(rb) == U_USING_FALLBACK_WARNING || INTL_DATA_ERROR_CODE(rb) == U_USING_DEFAULT_WARNING)) { char *pbuf; - intl_errors_set_code(NULL, INTL_DATA_ERROR_CODE(rb) TSRMLS_CC); + intl_errors_set_code(NULL, INTL_DATA_ERROR_CODE(rb)); spprintf(&pbuf, 0, "resourcebundle_ctor: Cannot load libICU resource " "'%s' without fallback from %s to %s", bundlename ? bundlename : "(default data)", locale, ures_getLocaleByType( rb->me, ULOC_ACTUAL_LOCALE, &INTL_DATA_ERROR_CODE(rb))); - intl_errors_set_custom_msg(INTL_DATA_ERROR_P(rb), pbuf, 1 TSRMLS_CC); + intl_errors_set_custom_msg(INTL_DATA_ERROR_P(rb), pbuf, 1); efree(pbuf); Z_OBJ_P(return_value) = NULL; } @@ -145,7 +145,7 @@ PHP_METHOD( ResourceBundle, __construct ) resourcebundle_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(); } @@ -166,7 +166,7 @@ PHP_FUNCTION( resourcebundle_create ) /* }}} */ /* {{{ resourcebundle_array_fetch */ -static void resourcebundle_array_fetch(zval *object, zval *offset, zval *return_value, int fallback TSRMLS_DC) +static void resourcebundle_array_fetch(zval *object, zval *offset, zval *return_value, int fallback) { int32_t meindex = 0; char * mekey = NULL; @@ -174,7 +174,7 @@ static void resourcebundle_array_fetch(zval *object, zval *offset, zval *return_ char *pbuf; ResourceBundle_object *rb; - intl_error_reset( NULL TSRMLS_CC ); + intl_error_reset( NULL ); RESOURCEBUNDLE_METHOD_FETCH_OBJECT; if(Z_TYPE_P(offset) == IS_LONG) { @@ -186,18 +186,18 @@ static void resourcebundle_array_fetch(zval *object, zval *offset, zval *return_ rb->child = ures_getByKey(rb->me, mekey, rb->child, &INTL_DATA_ERROR_CODE(rb) ); } else { intl_errors_set(INTL_DATA_ERROR_P(rb), U_ILLEGAL_ARGUMENT_ERROR, - "resourcebundle_get: index should be integer or string", 0 TSRMLS_CC); + "resourcebundle_get: index should be integer or string", 0); RETURN_NULL(); } - intl_error_set_code( NULL, INTL_DATA_ERROR_CODE(rb) TSRMLS_CC ); + intl_error_set_code( NULL, INTL_DATA_ERROR_CODE(rb) ); if (U_FAILURE(INTL_DATA_ERROR_CODE(rb))) { if (is_numeric) { spprintf( &pbuf, 0, "Cannot load resource element %d", meindex ); } else { spprintf( &pbuf, 0, "Cannot load resource element '%s'", mekey ); } - intl_errors_set_custom_msg( INTL_DATA_ERROR_P(rb), pbuf, 1 TSRMLS_CC ); + intl_errors_set_custom_msg( INTL_DATA_ERROR_P(rb), pbuf, 1 ); efree(pbuf); RETURN_NULL(); } @@ -210,23 +210,23 @@ static void resourcebundle_array_fetch(zval *object, zval *offset, zval *return_ } else { spprintf( &pbuf, 0, "Cannot load element '%s' without fallback from to %s", mekey, locale ); } - intl_errors_set_custom_msg( INTL_DATA_ERROR_P(rb), pbuf, 1 TSRMLS_CC ); + intl_errors_set_custom_msg( INTL_DATA_ERROR_P(rb), pbuf, 1 ); efree(pbuf); RETURN_NULL(); } - resourcebundle_extract_value( return_value, rb TSRMLS_CC ); + resourcebundle_extract_value( return_value, rb ); } /* }}} */ /* {{{ resourcebundle_array_get */ -zval *resourcebundle_array_get(zval *object, zval *offset, int type, zval *rv TSRMLS_DC) +zval *resourcebundle_array_get(zval *object, zval *offset, int type, zval *rv) { if(offset == NULL) { php_error( E_ERROR, "Cannot apply [] to ResourceBundle object" ); } ZVAL_NULL(rv); - resourcebundle_array_fetch(object, offset, rv, 1 TSRMLS_CC); + resourcebundle_array_fetch(object, offset, rv, 1); return rv; } /* }}} */ @@ -248,25 +248,25 @@ PHP_FUNCTION( resourcebundle_get ) zval * offset; zval * object; - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Oz|b", &object, ResourceBundle_ce_ptr, &offset, &fallback ) == FAILURE) { + if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Oz|b", &object, ResourceBundle_ce_ptr, &offset, &fallback ) == FAILURE) { intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, - "resourcebundle_get: unable to parse input params", 0 TSRMLS_CC); + "resourcebundle_get: unable to parse input params", 0); RETURN_FALSE; } - resourcebundle_array_fetch(object, offset, return_value, fallback TSRMLS_CC); + resourcebundle_array_fetch(object, offset, return_value, fallback); } /* }}} */ /* {{{ resourcebundle_array_count */ -int resourcebundle_array_count(zval *object, zend_long *count TSRMLS_DC) +int resourcebundle_array_count(zval *object, zend_long *count) { ResourceBundle_object *rb; RESOURCEBUNDLE_METHOD_FETCH_OBJECT_NO_CHECK; if (rb->me == NULL) { intl_errors_set(&rb->error, U_ILLEGAL_ARGUMENT_ERROR, - "Found unconstructed ResourceBundle", 0 TSRMLS_CC); + "Found unconstructed ResourceBundle", 0); return 0; } @@ -290,9 +290,9 @@ PHP_FUNCTION( resourcebundle_count ) int32_t len; RESOURCEBUNDLE_METHOD_INIT_VARS; - if( zend_parse_method_parameters( ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &object, ResourceBundle_ce_ptr ) == FAILURE ) { + if( zend_parse_method_parameters( ZEND_NUM_ARGS(), getThis(), "O", &object, ResourceBundle_ce_ptr ) == FAILURE ) { intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, - "resourcebundle_count: unable to parse input params", 0 TSRMLS_CC); + "resourcebundle_count: unable to parse input params", 0); RETURN_FALSE; } @@ -321,12 +321,12 @@ PHP_FUNCTION( resourcebundle_locales ) UEnumeration *icuenum; UErrorCode icuerror = U_ZERO_ERROR; - intl_errors_reset( NULL TSRMLS_CC ); + intl_errors_reset( NULL ); - if( zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &bundlename, &bundlename_len ) == FAILURE ) + if( zend_parse_parameters(ZEND_NUM_ARGS(), "s", &bundlename, &bundlename_len ) == FAILURE ) { intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, - "resourcebundle_locales: unable to parse input params", 0 TSRMLS_CC); + "resourcebundle_locales: unable to parse input params", 0); RETURN_FALSE; } @@ -362,11 +362,11 @@ PHP_FUNCTION( resourcebundle_get_error_code ) { RESOURCEBUNDLE_METHOD_INIT_VARS; - if( zend_parse_method_parameters( ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", + if( zend_parse_method_parameters( ZEND_NUM_ARGS(), getThis(), "O", &object, ResourceBundle_ce_ptr ) == FAILURE ) { intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, - "resourcebundle_get_error_code: unable to parse input params", 0 TSRMLS_CC ); + "resourcebundle_get_error_code: unable to parse input params", 0 ); RETURN_FALSE; } @@ -390,16 +390,16 @@ PHP_FUNCTION( resourcebundle_get_error_message ) zend_string* message = NULL; RESOURCEBUNDLE_METHOD_INIT_VARS; - if( zend_parse_method_parameters( ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", + if( zend_parse_method_parameters( ZEND_NUM_ARGS(), getThis(), "O", &object, ResourceBundle_ce_ptr ) == FAILURE ) { intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, - "resourcebundle_get_error_message: unable to parse input params", 0 TSRMLS_CC ); + "resourcebundle_get_error_message: unable to parse input params", 0 ); RETURN_FALSE; } rb = Z_INTL_RESOURCEBUNDLE_P( object ); - message = intl_error_get_message(INTL_DATA_ERROR_P(rb) TSRMLS_CC); + message = intl_error_get_message(INTL_DATA_ERROR_P(rb)); RETURN_STR(message); } /* }}} */ @@ -422,7 +422,7 @@ static zend_function_entry ResourceBundle_class_functions[] = { /* {{{ resourcebundle_register_class * Initialize 'ResourceBundle' class */ -void resourcebundle_register_class( TSRMLS_D ) +void resourcebundle_register_class( void ) { zend_class_entry ce; @@ -431,7 +431,7 @@ void resourcebundle_register_class( TSRMLS_D ) ce.create_object = ResourceBundle_object_create; ce.get_iterator = resourcebundle_get_iterator; - ResourceBundle_ce_ptr = zend_register_internal_class( &ce TSRMLS_CC ); + ResourceBundle_ce_ptr = zend_register_internal_class( &ce ); if( !ResourceBundle_ce_ptr ) { @@ -446,7 +446,7 @@ void resourcebundle_register_class( TSRMLS_D ) ResourceBundle_object_handlers.read_dimension = resourcebundle_array_get; ResourceBundle_object_handlers.count_elements = resourcebundle_array_count; - zend_class_implements(ResourceBundle_ce_ptr TSRMLS_CC, 1, zend_ce_traversable); + zend_class_implements(ResourceBundle_ce_ptr, 1, zend_ce_traversable); } /* }}} */ diff --git a/ext/intl/resourcebundle/resourcebundle_class.h b/ext/intl/resourcebundle/resourcebundle_class.h index 403b6beb17..0ac3635ba8 100644 --- a/ext/intl/resourcebundle/resourcebundle_class.h +++ b/ext/intl/resourcebundle/resourcebundle_class.h @@ -43,14 +43,14 @@ static inline ResourceBundle_object *php_intl_resourcebundle_fetch_object(zend_o INTL_METHOD_FETCH_OBJECT(INTL_RESOURCEBUNDLE, rb); \ if (RESOURCEBUNDLE_OBJECT(rb) == NULL) { \ intl_errors_set(&rb->error, U_ILLEGAL_ARGUMENT_ERROR, \ - "Found unconstructed ResourceBundle", 0 TSRMLS_CC); \ + "Found unconstructed ResourceBundle", 0); \ RETURN_FALSE; \ } #define RESOURCEBUNDLE_OBJECT(rb) (rb)->me -void resourcebundle_register_class( TSRMLS_D ); +void resourcebundle_register_class( void ); extern zend_class_entry *ResourceBundle_ce_ptr; PHP_FUNCTION( resourcebundle_create ); diff --git a/ext/intl/resourcebundle/resourcebundle_iterator.c b/ext/intl/resourcebundle/resourcebundle_iterator.c index cf38c6b676..8243e69268 100644 --- a/ext/intl/resourcebundle/resourcebundle_iterator.c +++ b/ext/intl/resourcebundle/resourcebundle_iterator.c @@ -29,7 +29,7 @@ */ /* {{{ resourcebundle_iterator_read */ -static void resourcebundle_iterator_read( ResourceBundle_iterator *iterator TSRMLS_DC ) +static void resourcebundle_iterator_read( ResourceBundle_iterator *iterator ) { UErrorCode icuerror = U_ZERO_ERROR; ResourceBundle_object *rb = iterator->subject; @@ -41,17 +41,17 @@ static void resourcebundle_iterator_read( ResourceBundle_iterator *iterator TSRM if (iterator->is_table) { iterator->currentkey = estrdup( ures_getKey( rb->child ) ); } - resourcebundle_extract_value( &iterator->current, rb TSRMLS_CC ); + resourcebundle_extract_value( &iterator->current, rb ); } else { - // zend_throw_exception( spl_ce_OutOfRangeException, "Running past end of ResourceBundle", 0 TSRMLS_CC); + // zend_throw_exception( spl_ce_OutOfRangeException, "Running past end of ResourceBundle", 0); ZVAL_UNDEF(&iterator->current); } } /* }}} */ /* {{{ resourcebundle_iterator_invalidate */ -static void resourcebundle_iterator_invalidate( zend_object_iterator *iter TSRMLS_DC ) +static void resourcebundle_iterator_invalidate( zend_object_iterator *iter ) { ResourceBundle_iterator *iterator = (ResourceBundle_iterator *) iter; @@ -67,19 +67,19 @@ static void resourcebundle_iterator_invalidate( zend_object_iterator *iter TSRML /* }}} */ /* {{{ resourcebundle_iterator_dtor */ -static void resourcebundle_iterator_dtor( zend_object_iterator *iter TSRMLS_DC ) +static void resourcebundle_iterator_dtor( zend_object_iterator *iter ) { ResourceBundle_iterator *iterator = (ResourceBundle_iterator *) iter; zval *object = &iterator->intern.data; - resourcebundle_iterator_invalidate( iter TSRMLS_CC ); + resourcebundle_iterator_invalidate( iter ); zval_ptr_dtor(object); } /* }}} */ /* {{{ resourcebundle_iterator_has_more */ -static int resourcebundle_iterator_has_more( zend_object_iterator *iter TSRMLS_DC ) +static int resourcebundle_iterator_has_more( zend_object_iterator *iter ) { ResourceBundle_iterator *iterator = (ResourceBundle_iterator *) iter; return (iterator->i < iterator->length) ? SUCCESS : FAILURE; @@ -87,23 +87,23 @@ static int resourcebundle_iterator_has_more( zend_object_iterator *iter TSRMLS_D /* }}} */ /* {{{ resourcebundle_iterator_current */ -static zval *resourcebundle_iterator_current( zend_object_iterator *iter TSRMLS_DC ) +static zval *resourcebundle_iterator_current( zend_object_iterator *iter ) { ResourceBundle_iterator *iterator = (ResourceBundle_iterator *) iter; if (Z_ISUNDEF(iterator->current)) { - resourcebundle_iterator_read( iterator TSRMLS_CC); + resourcebundle_iterator_read( iterator); } return &iterator->current; } /* }}} */ /* {{{ resourcebundle_iterator_key */ -static void resourcebundle_iterator_key( zend_object_iterator *iter, zval *key TSRMLS_DC ) +static void resourcebundle_iterator_key( zend_object_iterator *iter, zval *key ) { ResourceBundle_iterator *iterator = (ResourceBundle_iterator *) iter; if (Z_ISUNDEF(iterator->current)) { - resourcebundle_iterator_read( iterator TSRMLS_CC); + resourcebundle_iterator_read( iterator); } if (iterator->is_table) { @@ -115,22 +115,22 @@ static void resourcebundle_iterator_key( zend_object_iterator *iter, zval *key T /* }}} */ /* {{{ resourcebundle_iterator_step */ -static void resourcebundle_iterator_step( zend_object_iterator *iter TSRMLS_DC ) +static void resourcebundle_iterator_step( zend_object_iterator *iter ) { ResourceBundle_iterator *iterator = (ResourceBundle_iterator *) iter; iterator->i++; - resourcebundle_iterator_invalidate( iter TSRMLS_CC ); + resourcebundle_iterator_invalidate( iter ); } /* }}} */ /* {{{ resourcebundle_iterator_has_reset */ -static void resourcebundle_iterator_reset( zend_object_iterator *iter TSRMLS_DC ) +static void resourcebundle_iterator_reset( zend_object_iterator *iter ) { ResourceBundle_iterator *iterator = (ResourceBundle_iterator *) iter; iterator->i = 0; - resourcebundle_iterator_invalidate( iter TSRMLS_CC ); + resourcebundle_iterator_invalidate( iter ); } /* }}} */ @@ -147,7 +147,7 @@ static zend_object_iterator_funcs resourcebundle_iterator_funcs = { /* }}} */ /* {{{ resourcebundle_get_iterator */ -zend_object_iterator *resourcebundle_get_iterator( zend_class_entry *ce, zval *object, int byref TSRMLS_DC ) +zend_object_iterator *resourcebundle_get_iterator( zend_class_entry *ce, zval *object, int byref ) { ResourceBundle_object *rb = Z_INTL_RESOURCEBUNDLE_P(object ); ResourceBundle_iterator *iterator = emalloc( sizeof( ResourceBundle_iterator ) ); @@ -156,7 +156,7 @@ zend_object_iterator *resourcebundle_get_iterator( zend_class_entry *ce, zval *o php_error( E_ERROR, "ResourceBundle does not support writable iterators" ); } - zend_iterator_init(&iterator->intern TSRMLS_CC); + zend_iterator_init(&iterator->intern); ZVAL_COPY(&iterator->intern.data, object); iterator->intern.funcs = &resourcebundle_iterator_funcs; diff --git a/ext/intl/resourcebundle/resourcebundle_iterator.h b/ext/intl/resourcebundle/resourcebundle_iterator.h index b28fa91638..f27b76ad8b 100644 --- a/ext/intl/resourcebundle/resourcebundle_iterator.h +++ b/ext/intl/resourcebundle/resourcebundle_iterator.h @@ -31,6 +31,6 @@ typedef struct { zend_long i; } ResourceBundle_iterator; -zend_object_iterator *resourcebundle_get_iterator( zend_class_entry *ce, zval *object, int byref TSRMLS_DC ); +zend_object_iterator *resourcebundle_get_iterator( zend_class_entry *ce, zval *object, int byref ); #endif // #ifndef RESOURCEBUNDLE_ITERATOR_H diff --git a/ext/intl/spoofchecker/spoofchecker.c b/ext/intl/spoofchecker/spoofchecker.c index 0a22875dcf..d61aea2e13 100644 --- a/ext/intl/spoofchecker/spoofchecker.c +++ b/ext/intl/spoofchecker/spoofchecker.c @@ -35,7 +35,7 @@ void spoofchecker_register_constants(INIT_FUNC_ARGS) return; } - #define SPOOFCHECKER_EXPOSE_CLASS_CONST(x) zend_declare_class_constant_long(Spoofchecker_ce_ptr, ZEND_STRS( #x ) - 1, USPOOF_##x TSRMLS_CC); + #define SPOOFCHECKER_EXPOSE_CLASS_CONST(x) zend_declare_class_constant_long(Spoofchecker_ce_ptr, ZEND_STRS( #x ) - 1, USPOOF_##x); SPOOFCHECKER_EXPOSE_CLASS_CONST(SINGLE_SCRIPT_CONFUSABLE) SPOOFCHECKER_EXPOSE_CLASS_CONST(MIXED_SCRIPT_CONFUSABLE) diff --git a/ext/intl/spoofchecker/spoofchecker_class.c b/ext/intl/spoofchecker/spoofchecker_class.c index 5fb6ffb90c..84549ced83 100644 --- a/ext/intl/spoofchecker/spoofchecker_class.c +++ b/ext/intl/spoofchecker/spoofchecker_class.c @@ -30,32 +30,32 @@ static zend_object_handlers Spoofchecker_handlers; */ /* {{{ Spoofchecker_objects_dtor */ -static void Spoofchecker_objects_dtor(zend_object *object TSRMLS_DC) +static void Spoofchecker_objects_dtor(zend_object *object) { - zend_objects_destroy_object(object TSRMLS_CC); + zend_objects_destroy_object(object); } /* }}} */ /* {{{ Spoofchecker_objects_free */ -void Spoofchecker_objects_free(zend_object *object TSRMLS_DC) +void Spoofchecker_objects_free(zend_object *object) { Spoofchecker_object* co = php_intl_spoofchecker_fetch_object(object); - zend_object_std_dtor(&co->zo TSRMLS_CC); + zend_object_std_dtor(&co->zo); - spoofchecker_object_destroy(co TSRMLS_CC); + spoofchecker_object_destroy(co); } /* }}} */ /* {{{ Spoofchecker_object_create */ zend_object *Spoofchecker_object_create( - zend_class_entry *ce TSRMLS_DC) + zend_class_entry *ce) { Spoofchecker_object* intern; intern = ecalloc(1, sizeof(Spoofchecker_object) + sizeof(zval) * (ce->default_properties_count - 1)); - intl_error_init(SPOOFCHECKER_ERROR_P(intern) TSRMLS_CC); - zend_object_std_init(&intern->zo, ce TSRMLS_CC); + intl_error_init(SPOOFCHECKER_ERROR_P(intern)); + zend_object_std_init(&intern->zo, ce); object_properties_init(&intern->zo, ce); intern->zo.handlers = &Spoofchecker_handlers; @@ -107,24 +107,24 @@ zend_function_entry Spoofchecker_class_functions[] = { }; /* }}} */ -static zend_object *spoofchecker_clone_obj(zval *object TSRMLS_DC) /* {{{ */ +static zend_object *spoofchecker_clone_obj(zval *object) /* {{{ */ { zend_object *new_obj_val; Spoofchecker_object *sfo, *new_sfo; sfo = Z_INTL_SPOOFCHECKER_P(object); - intl_error_reset(SPOOFCHECKER_ERROR_P(sfo) TSRMLS_CC); + intl_error_reset(SPOOFCHECKER_ERROR_P(sfo)); - new_obj_val = Spoofchecker_ce_ptr->create_object(Z_OBJCE_P(object) TSRMLS_CC); + new_obj_val = Spoofchecker_ce_ptr->create_object(Z_OBJCE_P(object)); new_sfo = php_intl_spoofchecker_fetch_object(new_obj_val); /* clone standard parts */ - zend_objects_clone_members(&new_sfo->zo, &sfo->zo TSRMLS_CC); + zend_objects_clone_members(&new_sfo->zo, &sfo->zo); /* clone internal object */ new_sfo->uspoof = uspoof_clone(sfo->uspoof, SPOOFCHECKER_ERROR_CODE_P(new_sfo)); if(U_FAILURE(SPOOFCHECKER_ERROR_CODE(new_sfo))) { /* set up error in case error handler is interested */ - intl_error_set( NULL, SPOOFCHECKER_ERROR_CODE(new_sfo), "Failed to clone SpoofChecker object", 0 TSRMLS_CC ); - Spoofchecker_objects_dtor(&new_sfo->zo TSRMLS_CC); /* free new object */ + intl_error_set( NULL, SPOOFCHECKER_ERROR_CODE(new_sfo), "Failed to clone SpoofChecker object", 0 ); + Spoofchecker_objects_dtor(&new_sfo->zo); /* free new object */ zend_error(E_ERROR, "Failed to clone SpoofChecker object"); } return new_obj_val; @@ -134,14 +134,14 @@ static zend_object *spoofchecker_clone_obj(zval *object TSRMLS_DC) /* {{{ */ /* {{{ spoofchecker_register_Spoofchecker_class * Initialize 'Spoofchecker' class */ -void spoofchecker_register_Spoofchecker_class(TSRMLS_D) +void spoofchecker_register_Spoofchecker_class(void) { zend_class_entry ce; /* Create and register 'Spoofchecker' class. */ INIT_CLASS_ENTRY(ce, "Spoofchecker", Spoofchecker_class_functions); ce.create_object = Spoofchecker_object_create; - Spoofchecker_ce_ptr = zend_register_internal_class(&ce TSRMLS_CC); + Spoofchecker_ce_ptr = zend_register_internal_class(&ce); memcpy(&Spoofchecker_handlers, zend_get_std_object_handlers(), sizeof Spoofchecker_handlers); @@ -163,20 +163,20 @@ void spoofchecker_register_Spoofchecker_class(TSRMLS_D) * Initialize internals of Spoofchecker_object. * Must be called before any other call to 'spoofchecker_object_...' functions. */ -void spoofchecker_object_init(Spoofchecker_object* co TSRMLS_DC) +void spoofchecker_object_init(Spoofchecker_object* co) { if (!co) { return; } - intl_error_init(SPOOFCHECKER_ERROR_P(co) TSRMLS_CC); + intl_error_init(SPOOFCHECKER_ERROR_P(co)); } /* }}} */ /* {{{ void spoofchecker_object_destroy( Spoofchecker_object* co ) * Clean up mem allocted by internals of Spoofchecker_object */ -void spoofchecker_object_destroy(Spoofchecker_object* co TSRMLS_DC) +void spoofchecker_object_destroy(Spoofchecker_object* co) { if (!co) { return; @@ -187,7 +187,7 @@ void spoofchecker_object_destroy(Spoofchecker_object* co TSRMLS_DC) co->uspoof = NULL; } - intl_error_reset(SPOOFCHECKER_ERROR_P(co) TSRMLS_CC); + intl_error_reset(SPOOFCHECKER_ERROR_P(co)); } /* }}} */ diff --git a/ext/intl/spoofchecker/spoofchecker_class.h b/ext/intl/spoofchecker/spoofchecker_class.h index 847b0a97b5..7c5864b82f 100644 --- a/ext/intl/spoofchecker/spoofchecker_class.h +++ b/ext/intl/spoofchecker/spoofchecker_class.h @@ -47,10 +47,10 @@ static inline Spoofchecker_object *php_intl_spoofchecker_fetch_object(zend_objec #define SPOOFCHECKER_ERROR_CODE(co) INTL_ERROR_CODE(SPOOFCHECKER_ERROR(co)) #define SPOOFCHECKER_ERROR_CODE_P(co) &(INTL_ERROR_CODE(SPOOFCHECKER_ERROR(co))) -void spoofchecker_register_Spoofchecker_class(TSRMLS_D); +void spoofchecker_register_Spoofchecker_class(void); -void spoofchecker_object_init(Spoofchecker_object* co TSRMLS_DC); -void spoofchecker_object_destroy(Spoofchecker_object* co TSRMLS_DC); +void spoofchecker_object_init(Spoofchecker_object* co); +void spoofchecker_object_destroy(Spoofchecker_object* co); extern zend_class_entry *Spoofchecker_ce_ptr; @@ -59,22 +59,22 @@ extern zend_class_entry *Spoofchecker_ce_ptr; #define SPOOFCHECKER_METHOD_INIT_VARS \ zval* object = getThis(); \ Spoofchecker_object* co = NULL; \ - intl_error_reset(NULL TSRMLS_CC); \ + intl_error_reset(NULL); \ #define SPOOFCHECKER_METHOD_FETCH_OBJECT_NO_CHECK INTL_METHOD_FETCH_OBJECT(INTL_SPOOFCHECKER, co) #define SPOOFCHECKER_METHOD_FETCH_OBJECT \ SPOOFCHECKER_METHOD_FETCH_OBJECT_NO_CHECK; \ if (co->uspoof == NULL) { \ intl_errors_set(&co->err, U_ILLEGAL_ARGUMENT_ERROR, \ - "Found unconstructed Spoofchecker", 0 TSRMLS_CC); \ + "Found unconstructed Spoofchecker", 0); \ RETURN_FALSE; \ } // Macro to check return value of a ucol_* function call. #define SPOOFCHECKER_CHECK_STATUS(co, msg) \ - intl_error_set_code(NULL, SPOOFCHECKER_ERROR_CODE(co) TSRMLS_CC); \ + intl_error_set_code(NULL, SPOOFCHECKER_ERROR_CODE(co)); \ if (U_FAILURE(SPOOFCHECKER_ERROR_CODE(co))) { \ - intl_errors_set_custom_msg(SPOOFCHECKER_ERROR_P(co), msg, 0 TSRMLS_CC); \ + intl_errors_set_custom_msg(SPOOFCHECKER_ERROR_P(co), msg, 0); \ RETURN_FALSE; \ } \ diff --git a/ext/intl/spoofchecker/spoofchecker_main.c b/ext/intl/spoofchecker/spoofchecker_main.c index 959a0c568f..fb0f1549a2 100644 --- a/ext/intl/spoofchecker/spoofchecker_main.c +++ b/ext/intl/spoofchecker/spoofchecker_main.c @@ -32,7 +32,7 @@ PHP_METHOD(Spoofchecker, isSuspicious) zval *error_code = NULL; SPOOFCHECKER_METHOD_INIT_VARS; - if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|z", &text, &text_len, &error_code)) { + if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS(), "s|z", &text, &text_len, &error_code)) { return; } @@ -41,7 +41,7 @@ PHP_METHOD(Spoofchecker, isSuspicious) ret = uspoof_checkUTF8(co->uspoof, text, text_len, NULL, SPOOFCHECKER_ERROR_CODE_P(co)); if (U_FAILURE(SPOOFCHECKER_ERROR_CODE(co))) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "(%d) %s", SPOOFCHECKER_ERROR_CODE(co), u_errorName(SPOOFCHECKER_ERROR_CODE(co))); + php_error_docref(NULL, E_WARNING, "(%d) %s", SPOOFCHECKER_ERROR_CODE(co), u_errorName(SPOOFCHECKER_ERROR_CODE(co))); RETURN_TRUE; } @@ -64,7 +64,7 @@ PHP_METHOD(Spoofchecker, areConfusable) zval *error_code = NULL; SPOOFCHECKER_METHOD_INIT_VARS; - if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss|z", &s1, &s1_len, + if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS(), "ss|z", &s1, &s1_len, &s2, &s2_len, &error_code)) { return; } @@ -74,7 +74,7 @@ PHP_METHOD(Spoofchecker, areConfusable) ret = uspoof_areConfusableUTF8(co->uspoof, s1, s1_len, s2, s2_len, SPOOFCHECKER_ERROR_CODE_P(co)); if (U_FAILURE(SPOOFCHECKER_ERROR_CODE(co))) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "(%d) %s", SPOOFCHECKER_ERROR_CODE(co), u_errorName(SPOOFCHECKER_ERROR_CODE(co))); + php_error_docref(NULL, E_WARNING, "(%d) %s", SPOOFCHECKER_ERROR_CODE(co), u_errorName(SPOOFCHECKER_ERROR_CODE(co))); RETURN_TRUE; } @@ -95,7 +95,7 @@ PHP_METHOD(Spoofchecker, setAllowedLocales) size_t locales_len; SPOOFCHECKER_METHOD_INIT_VARS; - if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &locales, &locales_len)) { + if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS(), "s", &locales, &locales_len)) { return; } @@ -104,7 +104,7 @@ PHP_METHOD(Spoofchecker, setAllowedLocales) uspoof_setAllowedLocales(co->uspoof, locales, SPOOFCHECKER_ERROR_CODE_P(co)); if (U_FAILURE(SPOOFCHECKER_ERROR_CODE(co))) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "(%d) %s", SPOOFCHECKER_ERROR_CODE(co), u_errorName(SPOOFCHECKER_ERROR_CODE(co))); + php_error_docref(NULL, E_WARNING, "(%d) %s", SPOOFCHECKER_ERROR_CODE(co), u_errorName(SPOOFCHECKER_ERROR_CODE(co))); return; } } @@ -118,7 +118,7 @@ PHP_METHOD(Spoofchecker, setChecks) zend_long checks; SPOOFCHECKER_METHOD_INIT_VARS; - if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &checks)) { + if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS(), "l", &checks)) { return; } @@ -127,7 +127,7 @@ PHP_METHOD(Spoofchecker, setChecks) uspoof_setChecks(co->uspoof, checks, SPOOFCHECKER_ERROR_CODE_P(co)); if (U_FAILURE(SPOOFCHECKER_ERROR_CODE(co))) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "(%d) %s", SPOOFCHECKER_ERROR_CODE(co), u_errorName(SPOOFCHECKER_ERROR_CODE(co))); + php_error_docref(NULL, E_WARNING, "(%d) %s", SPOOFCHECKER_ERROR_CODE(co), u_errorName(SPOOFCHECKER_ERROR_CODE(co))); } } /* }}} */ diff --git a/ext/intl/timezone/timezone_class.cpp b/ext/intl/timezone/timezone_class.cpp index d2aaa12344..6818d0d9d8 100644 --- a/ext/intl/timezone/timezone_class.cpp +++ b/ext/intl/timezone/timezone_class.cpp @@ -45,7 +45,7 @@ U_CDECL_END /* }}} */ /* {{{ timezone_object_construct */ -U_CFUNC void timezone_object_construct(const TimeZone *zone, zval *object, int owned TSRMLS_DC) +U_CFUNC void timezone_object_construct(const TimeZone *zone, zval *object, int owned) { TimeZone_object *to; @@ -60,7 +60,7 @@ U_CFUNC void timezone_object_construct(const TimeZone *zone, zval *object, int o * Convert from TimeZone to DateTimeZone object */ U_CFUNC zval *timezone_convert_to_datetimezone(const TimeZone *timeZone, intl_error *outside_error, - const char *func, zval *ret TSRMLS_DC) + const char *func, zval *ret) { UnicodeString id; char *message = NULL; @@ -71,7 +71,7 @@ U_CFUNC zval *timezone_convert_to_datetimezone(const TimeZone *timeZone, if (id.isBogus()) { spprintf(&message, 0, "%s: could not obtain TimeZone id", func); intl_errors_set(outside_error, U_ILLEGAL_ARGUMENT_ERROR, - message, 1 TSRMLS_CC); + message, 1); goto error; } @@ -92,7 +92,7 @@ U_CFUNC zval *timezone_convert_to_datetimezone(const TimeZone *timeZone, if (intl_charFromString(id, &str, &str_len, &INTL_ERROR_CODE(*outside_error)) == FAILURE) { spprintf(&message, 0, "%s: could not convert id to UTF-8", func); intl_errors_set(outside_error, INTL_ERROR_CODE(*outside_error), - message, 1 TSRMLS_CC); + message, 1); goto error; } ZVAL_STRINGL(&arg, str, str_len); @@ -103,8 +103,8 @@ U_CFUNC zval *timezone_convert_to_datetimezone(const TimeZone *timeZone, spprintf(&message, 0, "%s: DateTimeZone constructor threw exception", func); intl_errors_set(outside_error, U_ILLEGAL_ARGUMENT_ERROR, - message, 1 TSRMLS_CC); - zend_object_store_ctor_failed(Z_OBJ_P(ret) TSRMLS_CC); + message, 1); + zend_object_store_ctor_failed(Z_OBJ_P(ret)); zval_ptr_dtor(&arg); goto error; } @@ -130,14 +130,14 @@ error: * TimeZone argument processor. outside_error may be NULL (for static functions/constructors) */ U_CFUNC TimeZone *timezone_process_timezone_argument(zval *zv_timezone, intl_error *outside_error, - const char *func TSRMLS_DC) + const char *func) { zval local_zv_tz; char *message = NULL; TimeZone *timeZone; if (zv_timezone == NULL || Z_TYPE_P(zv_timezone) == IS_NULL) { - timelib_tzinfo *tzinfo = get_timezone_info(TSRMLS_C); + timelib_tzinfo *tzinfo = get_timezone_info(); ZVAL_STRING(&local_zv_tz, tzinfo->name); zv_timezone = &local_zv_tz; } else { @@ -145,13 +145,13 @@ U_CFUNC TimeZone *timezone_process_timezone_argument(zval *zv_timezone, } if (Z_TYPE_P(zv_timezone) == IS_OBJECT && - instanceof_function(Z_OBJCE_P(zv_timezone), TimeZone_ce_ptr TSRMLS_CC)) { + instanceof_function(Z_OBJCE_P(zv_timezone), TimeZone_ce_ptr)) { TimeZone_object *to = Z_INTL_TIMEZONE_P(zv_timezone); if (to->utimezone == NULL) { spprintf(&message, 0, "%s: passed IntlTimeZone is not " "properly constructed", func); if (message) { - intl_errors_set(outside_error, U_ILLEGAL_ARGUMENT_ERROR, message, 1 TSRMLS_CC); + intl_errors_set(outside_error, U_ILLEGAL_ARGUMENT_ERROR, message, 1); efree(message); } zval_dtor(&local_zv_tz); @@ -161,20 +161,20 @@ U_CFUNC TimeZone *timezone_process_timezone_argument(zval *zv_timezone, if (timeZone == NULL) { spprintf(&message, 0, "%s: could not clone TimeZone", func); if (message) { - intl_errors_set(outside_error, U_MEMORY_ALLOCATION_ERROR, message, 1 TSRMLS_CC); + intl_errors_set(outside_error, U_MEMORY_ALLOCATION_ERROR, message, 1); efree(message); } zval_dtor(&local_zv_tz); return NULL; } } else if (Z_TYPE_P(zv_timezone) == IS_OBJECT && - instanceof_function(Z_OBJCE_P(zv_timezone), php_date_get_timezone_ce() TSRMLS_CC)) { + instanceof_function(Z_OBJCE_P(zv_timezone), php_date_get_timezone_ce())) { php_timezone_obj *tzobj = Z_PHPTIMEZONE_P(zv_timezone); zval_dtor(&local_zv_tz); return timezone_convert_datetimezone(tzobj->type, tzobj, 0, - outside_error, func TSRMLS_CC); + outside_error, func); } else { UnicodeString id, gottenId; @@ -185,7 +185,7 @@ U_CFUNC TimeZone *timezone_process_timezone_argument(zval *zv_timezone, spprintf(&message, 0, "%s: Time zone identifier given is not a " "valid UTF-8 string", func); if (message) { - intl_errors_set(outside_error, status, message, 1 TSRMLS_CC); + intl_errors_set(outside_error, status, message, 1); efree(message); } zval_dtor(&local_zv_tz); @@ -195,7 +195,7 @@ U_CFUNC TimeZone *timezone_process_timezone_argument(zval *zv_timezone, if (timeZone == NULL) { spprintf(&message, 0, "%s: could not create time zone", func); if (message) { - intl_errors_set(outside_error, U_MEMORY_ALLOCATION_ERROR, message, 1 TSRMLS_CC); + intl_errors_set(outside_error, U_MEMORY_ALLOCATION_ERROR, message, 1); efree(message); } zval_dtor(&local_zv_tz); @@ -205,7 +205,7 @@ U_CFUNC TimeZone *timezone_process_timezone_argument(zval *zv_timezone, spprintf(&message, 0, "%s: no such time zone: '%s'", func, Z_STRVAL_P(zv_timezone)); if (message) { - intl_errors_set(outside_error, U_ILLEGAL_ARGUMENT_ERROR, message, 1 TSRMLS_CC); + intl_errors_set(outside_error, U_ILLEGAL_ARGUMENT_ERROR, message, 1); efree(message); } zval_dtor(&local_zv_tz); @@ -221,20 +221,20 @@ U_CFUNC TimeZone *timezone_process_timezone_argument(zval *zv_timezone, /* }}} */ /* {{{ clone handler for TimeZone */ -static zend_object *TimeZone_clone_obj(zval *object TSRMLS_DC) +static zend_object *TimeZone_clone_obj(zval *object) { TimeZone_object *to_orig, *to_new; zend_object *ret_val; - intl_error_reset(NULL TSRMLS_CC); + intl_error_reset(NULL); to_orig = Z_INTL_TIMEZONE_P(object); - intl_error_reset(TIMEZONE_ERROR_P(to_orig) TSRMLS_CC); + intl_error_reset(TIMEZONE_ERROR_P(to_orig)); - ret_val = TimeZone_ce_ptr->create_object(Z_OBJCE_P(object) TSRMLS_CC); + ret_val = TimeZone_ce_ptr->create_object(Z_OBJCE_P(object)); to_new = php_intl_timezone_fetch_object(ret_val); - zend_objects_clone_members(&to_new->zo, &to_orig->zo TSRMLS_CC); + zend_objects_clone_members(&to_new->zo, &to_orig->zo); if (to_orig->utimezone != NULL) { TimeZone *newTimeZone; @@ -244,17 +244,17 @@ static zend_object *TimeZone_clone_obj(zval *object TSRMLS_DC) if (!newTimeZone) { zend_string *err_msg; intl_errors_set_code(TIMEZONE_ERROR_P(to_orig), - U_MEMORY_ALLOCATION_ERROR TSRMLS_CC); + U_MEMORY_ALLOCATION_ERROR); intl_errors_set_custom_msg(TIMEZONE_ERROR_P(to_orig), - "Could not clone IntlTimeZone", 0 TSRMLS_CC); - err_msg = intl_error_get_message(TIMEZONE_ERROR_P(to_orig) TSRMLS_CC); - zend_throw_exception(NULL, err_msg->val, 0 TSRMLS_CC); + "Could not clone IntlTimeZone", 0); + err_msg = intl_error_get_message(TIMEZONE_ERROR_P(to_orig)); + zend_throw_exception(NULL, err_msg->val, 0); zend_string_free(err_msg); } else { to_new->utimezone = newTimeZone; } } else { - zend_throw_exception(NULL, "Cannot clone unconstructed IntlTimeZone", 0 TSRMLS_CC); + zend_throw_exception(NULL, "Cannot clone unconstructed IntlTimeZone", 0); } return ret_val; @@ -263,7 +263,7 @@ static zend_object *TimeZone_clone_obj(zval *object TSRMLS_DC) /* {{{ compare_objects handler for TimeZone * Can't be used for >, >=, <, <= comparisons */ -static int TimeZone_compare_objects(zval *object1, zval *object2 TSRMLS_DC) +static int TimeZone_compare_objects(zval *object1, zval *object2) { TimeZone_object *to1, *to2; @@ -272,7 +272,7 @@ static int TimeZone_compare_objects(zval *object1, zval *object2 TSRMLS_DC) if (to1->utimezone == NULL || to2->utimezone == NULL) { zend_throw_exception(NULL, "Comparison with at least one unconstructed " - "IntlTimeZone operand", 0 TSRMLS_CC); + "IntlTimeZone operand", 0); /* intentionally not returning */ } else { if (*to1->utimezone == *to2->utimezone) { @@ -285,7 +285,7 @@ static int TimeZone_compare_objects(zval *object1, zval *object2 TSRMLS_DC) /* }}} */ /* {{{ get_debug_info handler for TimeZone */ -static HashTable *TimeZone_get_debug_info(zval *object, int *is_temp TSRMLS_DC) +static HashTable *TimeZone_get_debug_info(zval *object, int *is_temp) { zval zv; TimeZone_object *to; @@ -343,23 +343,23 @@ static HashTable *TimeZone_get_debug_info(zval *object, int *is_temp TSRMLS_DC) /* {{{ void TimeZone_object_init(TimeZone_object* to) * Initialize internals of TImeZone_object not specific to zend standard objects. */ -static void TimeZone_object_init(TimeZone_object *to TSRMLS_DC) +static void TimeZone_object_init(TimeZone_object *to) { - intl_error_init(TIMEZONE_ERROR_P(to) TSRMLS_CC); + intl_error_init(TIMEZONE_ERROR_P(to)); to->utimezone = NULL; to->should_delete = 0; } /* }}} */ /* {{{ TimeZone_objects_dtor */ -static void TimeZone_objects_dtor(zend_object *object TSRMLS_DC) +static void TimeZone_objects_dtor(zend_object *object) { - zend_objects_destroy_object(object TSRMLS_CC); + zend_objects_destroy_object(object); } /* }}} */ /* {{{ TimeZone_objects_free */ -static void TimeZone_objects_free(zend_object *object TSRMLS_DC) +static void TimeZone_objects_free(zend_object *object) { TimeZone_object* to = php_intl_timezone_fetch_object(object); @@ -367,22 +367,22 @@ static void TimeZone_objects_free(zend_object *object TSRMLS_DC) delete to->utimezone; to->utimezone = NULL; } - intl_error_reset(TIMEZONE_ERROR_P(to) TSRMLS_CC); + intl_error_reset(TIMEZONE_ERROR_P(to)); - zend_object_std_dtor(&to->zo TSRMLS_CC); + zend_object_std_dtor(&to->zo); } /* }}} */ /* {{{ TimeZone_object_create */ -static zend_object *TimeZone_object_create(zend_class_entry *ce TSRMLS_DC) +static zend_object *TimeZone_object_create(zend_class_entry *ce) { TimeZone_object* intern; intern = (TimeZone_object*)ecalloc(1, sizeof(TimeZone_object) + sizeof(zval) * (ce->default_properties_count - 1)); - zend_object_std_init(&intern->zo, ce TSRMLS_CC); + zend_object_std_init(&intern->zo, ce); object_properties_init(&intern->zo, ce); - TimeZone_object_init(intern TSRMLS_CC); + TimeZone_object_init(intern); intern->zo.handlers = &TimeZone_handlers; @@ -487,17 +487,17 @@ static zend_function_entry TimeZone_class_functions[] = { /* {{{ timezone_register_IntlTimeZone_class * Initialize 'IntlTimeZone' class */ -U_CFUNC void timezone_register_IntlTimeZone_class(TSRMLS_D) +U_CFUNC void timezone_register_IntlTimeZone_class(void) { zend_class_entry ce; /* Create and register 'IntlTimeZone' class. */ INIT_CLASS_ENTRY(ce, "IntlTimeZone", TimeZone_class_functions); ce.create_object = TimeZone_object_create; - TimeZone_ce_ptr = zend_register_internal_class(&ce TSRMLS_CC); + TimeZone_ce_ptr = zend_register_internal_class(&ce); if (!TimeZone_ce_ptr) { //can't happen now without bigger problems before - php_error_docref0(NULL TSRMLS_CC, E_ERROR, + php_error_docref0(NULL, E_ERROR, "IntlTimeZone: class registration has failed."); return; } @@ -515,7 +515,7 @@ U_CFUNC void timezone_register_IntlTimeZone_class(TSRMLS_D) /* Declare 'IntlTimeZone' class constants */ #define TIMEZONE_DECL_LONG_CONST(name, val) \ zend_declare_class_constant_long(TimeZone_ce_ptr, name, sizeof(name) - 1, \ - val TSRMLS_CC) + val) TIMEZONE_DECL_LONG_CONST("DISPLAY_SHORT", TimeZone::SHORT); TIMEZONE_DECL_LONG_CONST("DISPLAY_LONG", TimeZone::LONG); diff --git a/ext/intl/timezone/timezone_class.h b/ext/intl/timezone/timezone_class.h index 94b781b332..0667c78994 100644 --- a/ext/intl/timezone/timezone_class.h +++ b/ext/intl/timezone/timezone_class.h @@ -60,16 +60,16 @@ static inline TimeZone_object *php_intl_timezone_fetch_object(zend_object *obj) #define TIMEZONE_METHOD_FETCH_OBJECT\ TIMEZONE_METHOD_FETCH_OBJECT_NO_CHECK; \ if (to->utimezone == NULL) { \ - intl_errors_set(&to->err, U_ILLEGAL_ARGUMENT_ERROR, "Found unconstructed IntlTimeZone", 0 TSRMLS_CC); \ + intl_errors_set(&to->err, U_ILLEGAL_ARGUMENT_ERROR, "Found unconstructed IntlTimeZone", 0); \ RETURN_FALSE; \ } -zval *timezone_convert_to_datetimezone(const TimeZone *timeZone, intl_error *outside_error, const char *func, zval *ret TSRMLS_DC); -TimeZone *timezone_process_timezone_argument(zval *zv_timezone, intl_error *error, const char *func TSRMLS_DC); +zval *timezone_convert_to_datetimezone(const TimeZone *timeZone, intl_error *outside_error, const char *func, zval *ret); +TimeZone *timezone_process_timezone_argument(zval *zv_timezone, intl_error *error, const char *func); -void timezone_object_construct(const TimeZone *zone, zval *object, int owned TSRMLS_DC); +void timezone_object_construct(const TimeZone *zone, zval *object, int owned); -void timezone_register_IntlTimeZone_class(TSRMLS_D); +void timezone_register_IntlTimeZone_class(void); extern zend_class_entry *TimeZone_ce_ptr; extern zend_object_handlers TimeZone_handlers; diff --git a/ext/intl/timezone/timezone_methods.cpp b/ext/intl/timezone/timezone_methods.cpp index 033b216cdf..98ae6f97aa 100644 --- a/ext/intl/timezone/timezone_methods.cpp +++ b/ext/intl/timezone/timezone_methods.cpp @@ -41,19 +41,19 @@ U_CFUNC PHP_METHOD(IntlTimeZone, __construct) { zend_throw_exception( NULL, "An object of this type cannot be created with the new operator", - 0 TSRMLS_CC ); + 0 ); } U_CFUNC PHP_FUNCTION(intltz_create_time_zone) { char *str_id; size_t str_id_len; - intl_error_reset(NULL TSRMLS_CC); + intl_error_reset(NULL); - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", + if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &str_id, &str_id_len) == FAILURE) { intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, - "intltz_create_time_zone: bad arguments", 0 TSRMLS_CC); + "intltz_create_time_zone: bad arguments", 0); RETURN_NULL(); } @@ -61,13 +61,13 @@ U_CFUNC PHP_FUNCTION(intltz_create_time_zone) UnicodeString id = UnicodeString(); if (intl_stringFromChar(id, str_id, str_id_len, &status) == FAILURE) { intl_error_set(NULL, status, - "intltz_create_time_zone: could not convert time zone id to UTF-16", 0 TSRMLS_CC); + "intltz_create_time_zone: could not convert time zone id to UTF-16", 0); RETURN_NULL(); } //guaranteed non-null; GMT if timezone cannot be understood TimeZone *tz = TimeZone::createTimeZone(id); - timezone_object_construct(tz, return_value, 1 TSRMLS_CC); + timezone_object_construct(tz, return_value, 1); } U_CFUNC PHP_FUNCTION(intltz_from_date_time_zone) @@ -75,12 +75,12 @@ U_CFUNC PHP_FUNCTION(intltz_from_date_time_zone) zval *zv_timezone; TimeZone *tz; php_timezone_obj *tzobj; - intl_error_reset(NULL TSRMLS_CC); + intl_error_reset(NULL); - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "O", + if (zend_parse_parameters(ZEND_NUM_ARGS(), "O", &zv_timezone, php_date_get_timezone_ce()) == FAILURE) { intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, - "intltz_from_date_time_zone: bad arguments", 0 TSRMLS_CC); + "intltz_from_date_time_zone: bad arguments", 0); RETURN_NULL(); } @@ -88,58 +88,58 @@ U_CFUNC PHP_FUNCTION(intltz_from_date_time_zone) if (!tzobj->initialized) { intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, "intltz_from_date_time_zone: DateTimeZone object is unconstructed", - 0 TSRMLS_CC); + 0); RETURN_NULL(); } tz = timezone_convert_datetimezone(tzobj->type, tzobj, FALSE, NULL, - "intltz_from_date_time_zone" TSRMLS_CC); + "intltz_from_date_time_zone"); if (tz == NULL) { RETURN_NULL(); } - timezone_object_construct(tz, return_value, 1 TSRMLS_CC); + timezone_object_construct(tz, return_value, 1); } U_CFUNC PHP_FUNCTION(intltz_create_default) { - intl_error_reset(NULL TSRMLS_CC); + intl_error_reset(NULL); if (zend_parse_parameters_none() == FAILURE) { intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, - "intltz_create_default: bad arguments", 0 TSRMLS_CC); + "intltz_create_default: bad arguments", 0); RETURN_NULL(); } TimeZone *tz = TimeZone::createDefault(); - timezone_object_construct(tz, return_value, 1 TSRMLS_CC); + timezone_object_construct(tz, return_value, 1); } U_CFUNC PHP_FUNCTION(intltz_get_gmt) { - intl_error_reset(NULL TSRMLS_CC); + intl_error_reset(NULL); if (zend_parse_parameters_none() == FAILURE) { intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, - "intltz_get_gmt: bad arguments", 0 TSRMLS_CC); + "intltz_get_gmt: bad arguments", 0); RETURN_NULL(); } - timezone_object_construct(TimeZone::getGMT(), return_value, 0 TSRMLS_CC); + timezone_object_construct(TimeZone::getGMT(), return_value, 0); } #if U_ICU_VERSION_MAJOR_NUM >= 49 U_CFUNC PHP_FUNCTION(intltz_get_unknown) { - intl_error_reset(NULL TSRMLS_CC); + intl_error_reset(NULL); if (zend_parse_parameters_none() == FAILURE) { intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, - "intltz_get_unknown: bad arguments", 0 TSRMLS_CC); + "intltz_get_unknown: bad arguments", 0); RETURN_NULL(); } - timezone_object_construct(&TimeZone::getUnknown(), return_value, 0 TSRMLS_CC); + timezone_object_construct(&TimeZone::getUnknown(), return_value, 0); } #endif @@ -147,13 +147,13 @@ U_CFUNC PHP_FUNCTION(intltz_create_enumeration) { zval *arg = NULL; StringEnumeration *se = NULL; - intl_error_reset(NULL TSRMLS_CC); + intl_error_reset(NULL); /* double indirection to have the zend engine destroy the new zval that * results from separation */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|z", &arg) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "|z", &arg) == FAILURE) { intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, - "intltz_create_enumeration: bad arguments", 0 TSRMLS_CC); + "intltz_create_enumeration: bad arguments", 0); RETURN_FALSE; } @@ -164,7 +164,7 @@ int_offset: if (Z_LVAL_P(arg) < (zend_long)INT32_MIN || Z_LVAL_P(arg) > (zend_long)INT32_MAX) { intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, - "intltz_create_enumeration: value is out of range", 0 TSRMLS_CC); + "intltz_create_enumeration: value is out of range", 0); RETURN_FALSE; } else { se = TimeZone::createEnumeration((int32_t) Z_LVAL_P(arg)); @@ -193,15 +193,15 @@ double_offset: se = TimeZone::createEnumeration(Z_STRVAL_P(arg)); } else { intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, - "intltz_create_enumeration: invalid argument type", 0 TSRMLS_CC); + "intltz_create_enumeration: invalid argument type", 0); RETURN_FALSE; } if (se) { - IntlIterator_from_StringEnumeration(se, return_value TSRMLS_CC); + IntlIterator_from_StringEnumeration(se, return_value); } else { intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, - "intltz_create_enumeration: error obtaining enumeration", 0 TSRMLS_CC); + "intltz_create_enumeration: error obtaining enumeration", 0); RETVAL_FALSE; } } @@ -210,12 +210,12 @@ U_CFUNC PHP_FUNCTION(intltz_count_equivalent_ids) { char *str_id; size_t str_id_len; - intl_error_reset(NULL TSRMLS_CC); + intl_error_reset(NULL); - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", + if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &str_id, &str_id_len) == FAILURE) { intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, - "intltz_count_equivalent_ids: bad arguments", 0 TSRMLS_CC); + "intltz_count_equivalent_ids: bad arguments", 0); RETURN_FALSE; } @@ -223,7 +223,7 @@ U_CFUNC PHP_FUNCTION(intltz_count_equivalent_ids) UnicodeString id = UnicodeString(); if (intl_stringFromChar(id, str_id, str_id_len, &status) == FAILURE) { intl_error_set(NULL, status, - "intltz_count_equivalent_ids: could not convert time zone id to UTF-16", 0 TSRMLS_CC); + "intltz_count_equivalent_ids: could not convert time zone id to UTF-16", 0); RETURN_FALSE; } @@ -241,7 +241,7 @@ U_CFUNC PHP_FUNCTION(intltz_create_time_zone_id_enumeration) int32_t offset, *offsetp = NULL; int arg3isnull = 0; - intl_error_reset(NULL TSRMLS_CC); + intl_error_reset(NULL); /* must come before zpp because zpp would convert the arg in the stack to 0 */ if (ZEND_NUM_ARGS() == 3) { @@ -250,24 +250,24 @@ U_CFUNC PHP_FUNCTION(intltz_create_time_zone_id_enumeration) != FAILURE && Z_TYPE_P(zvoffset) == IS_NULL; } - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l|s!l", + if (zend_parse_parameters(ZEND_NUM_ARGS(), "l|s!l", &zoneType, ®ion, ®ion_len, &offset_arg) == FAILURE) { intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, - "intltz_create_time_zone_id_enumeration: bad arguments", 0 TSRMLS_CC); + "intltz_create_time_zone_id_enumeration: bad arguments", 0); RETURN_FALSE; } if (zoneType != UCAL_ZONE_TYPE_ANY && zoneType != UCAL_ZONE_TYPE_CANONICAL && zoneType != UCAL_ZONE_TYPE_CANONICAL_LOCATION) { intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, - "intltz_create_time_zone_id_enumeration: bad zone type", 0 TSRMLS_CC); + "intltz_create_time_zone_id_enumeration: bad zone type", 0); RETURN_FALSE; } if (ZEND_NUM_ARGS() == 3) { if (offset_arg < (zend_long)INT32_MIN || offset_arg > (zend_long)INT32_MAX) { intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, - "intltz_create_time_zone_id_enumeration: offset out of bounds", 0 TSRMLS_CC); + "intltz_create_time_zone_id_enumeration: offset out of bounds", 0); RETURN_FALSE; } @@ -284,7 +284,7 @@ U_CFUNC PHP_FUNCTION(intltz_create_time_zone_id_enumeration) INTL_CHECK_STATUS(uec, "intltz_create_time_zone_id_enumeration: " "Error obtaining time zone id enumeration") - IntlIterator_from_StringEnumeration(se, return_value TSRMLS_CC); + IntlIterator_from_StringEnumeration(se, return_value); } #endif @@ -293,12 +293,12 @@ U_CFUNC PHP_FUNCTION(intltz_get_canonical_id) char *str_id; size_t str_id_len; zval *is_systemid = NULL; - intl_error_reset(NULL TSRMLS_CC); + intl_error_reset(NULL); - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|z", + if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|z", &str_id, &str_id_len, &is_systemid) == FAILURE) { intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, - "intltz_get_canonical_id: bad arguments", 0 TSRMLS_CC); + "intltz_get_canonical_id: bad arguments", 0); RETURN_FALSE; } @@ -306,7 +306,7 @@ U_CFUNC PHP_FUNCTION(intltz_get_canonical_id) UnicodeString id; if (intl_stringFromChar(id, str_id, str_id_len, &status) == FAILURE) { intl_error_set(NULL, status, - "intltz_get_canonical_id: could not convert time zone id to UTF-16", 0 TSRMLS_CC); + "intltz_get_canonical_id: could not convert time zone id to UTF-16", 0); RETURN_FALSE; } @@ -337,12 +337,12 @@ U_CFUNC PHP_FUNCTION(intltz_get_region) char *str_id; size_t str_id_len; char outbuf[3]; - intl_error_reset(NULL TSRMLS_CC); + intl_error_reset(NULL); - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", + if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &str_id, &str_id_len) == FAILURE) { intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, - "intltz_get_region: bad arguments", 0 TSRMLS_CC); + "intltz_get_region: bad arguments", 0); RETURN_FALSE; } @@ -350,7 +350,7 @@ U_CFUNC PHP_FUNCTION(intltz_get_region) UnicodeString id; if (intl_stringFromChar(id, str_id, str_id_len, &status) == FAILURE) { intl_error_set(NULL, status, - "intltz_get_region: could not convert time zone id to UTF-16", 0 TSRMLS_CC); + "intltz_get_region: could not convert time zone id to UTF-16", 0); RETURN_FALSE; } @@ -363,11 +363,11 @@ U_CFUNC PHP_FUNCTION(intltz_get_region) U_CFUNC PHP_FUNCTION(intltz_get_tz_data_version) { - intl_error_reset(NULL TSRMLS_CC); + intl_error_reset(NULL); if (zend_parse_parameters_none() == FAILURE) { intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, - "intltz_get_tz_data_version: bad arguments", 0 TSRMLS_CC); + "intltz_get_tz_data_version: bad arguments", 0); RETURN_FALSE; } @@ -384,13 +384,13 @@ U_CFUNC PHP_FUNCTION(intltz_get_equivalent_id) char *str_id; size_t str_id_len; zend_long index; - intl_error_reset(NULL TSRMLS_CC); + intl_error_reset(NULL); - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sl", + if (zend_parse_parameters(ZEND_NUM_ARGS(), "sl", &str_id, &str_id_len, &index) == FAILURE || index < (zend_long)INT32_MIN || index > (zend_long)INT32_MAX) { intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, - "intltz_get_equivalent_id: bad arguments", 0 TSRMLS_CC); + "intltz_get_equivalent_id: bad arguments", 0); RETURN_FALSE; } @@ -398,7 +398,7 @@ U_CFUNC PHP_FUNCTION(intltz_get_equivalent_id) UnicodeString id; if (intl_stringFromChar(id, str_id, str_id_len, &status) == FAILURE) { intl_error_set(NULL, status, - "intltz_get_equivalent_id: could not convert time zone id to UTF-16", 0 TSRMLS_CC); + "intltz_get_equivalent_id: could not convert time zone id to UTF-16", 0); RETURN_FALSE; } @@ -418,10 +418,10 @@ U_CFUNC PHP_FUNCTION(intltz_get_id) { TIMEZONE_METHOD_INIT_VARS; - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", + if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O", &object, TimeZone_ce_ptr) == FAILURE) { intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, - "intltz_get_id: bad arguments", 0 TSRMLS_CC); + "intltz_get_id: bad arguments", 0); RETURN_FALSE; } @@ -446,10 +446,10 @@ U_CFUNC PHP_FUNCTION(intltz_use_daylight_time) { TIMEZONE_METHOD_INIT_VARS; - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", + if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O", &object, TimeZone_ce_ptr) == FAILURE) { intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, - "intltz_use_daylight_time: bad arguments", 0 TSRMLS_CC); + "intltz_use_daylight_time: bad arguments", 0); RETURN_FALSE; } @@ -468,11 +468,11 @@ U_CFUNC PHP_FUNCTION(intltz_get_offset) dstOffset; TIMEZONE_METHOD_INIT_VARS; - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), + if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Odbz/z/", &object, TimeZone_ce_ptr, &date, &local, &rawOffsetArg, &dstOffsetArg) == FAILURE) { intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, - "intltz_get_offset: bad arguments", 0 TSRMLS_CC); + "intltz_get_offset: bad arguments", 0); RETURN_FALSE; } @@ -497,10 +497,10 @@ U_CFUNC PHP_FUNCTION(intltz_get_raw_offset) { TIMEZONE_METHOD_INIT_VARS; - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), + if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O", &object, TimeZone_ce_ptr) == FAILURE) { intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, - "intltz_get_raw_offset: bad arguments", 0 TSRMLS_CC); + "intltz_get_raw_offset: bad arguments", 0); RETURN_FALSE; } @@ -515,18 +515,18 @@ U_CFUNC PHP_FUNCTION(intltz_has_same_rules) TimeZone_object *other_to; TIMEZONE_METHOD_INIT_VARS; - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), + if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "OO", &object, TimeZone_ce_ptr, &other_object, TimeZone_ce_ptr) == FAILURE) { intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, - "intltz_has_same_rules: bad arguments", 0 TSRMLS_CC); + "intltz_has_same_rules: bad arguments", 0); RETURN_FALSE; } TIMEZONE_METHOD_FETCH_OBJECT; other_to = Z_INTL_TIMEZONE_P(other_object); if (other_to->utimezone == NULL) { intl_errors_set(&to->err, U_ILLEGAL_ARGUMENT_ERROR, - "intltz_has_same_rules: The second IntlTimeZone is unconstructed", 0 TSRMLS_CC); + "intltz_has_same_rules: The second IntlTimeZone is unconstructed", 0); RETURN_FALSE; } @@ -550,11 +550,11 @@ U_CFUNC PHP_FUNCTION(intltz_get_display_name) size_t dummy = 0; TIMEZONE_METHOD_INIT_VARS; - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), + if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O|bls!", &object, TimeZone_ce_ptr, &daylight, &display_type, &locale_str, &dummy) == FAILURE) { intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, - "intltz_get_display_name: bad arguments", 0 TSRMLS_CC); + "intltz_get_display_name: bad arguments", 0); RETURN_FALSE; } @@ -565,12 +565,12 @@ U_CFUNC PHP_FUNCTION(intltz_get_display_name) } if (!found) { intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, - "intltz_get_display_name: wrong display type", 0 TSRMLS_CC); + "intltz_get_display_name: wrong display type", 0); RETURN_FALSE; } if (!locale_str) { - locale_str = intl_locale_get_default(TSRMLS_C); + locale_str = intl_locale_get_default(); } TIMEZONE_METHOD_FETCH_OBJECT; @@ -594,10 +594,10 @@ U_CFUNC PHP_FUNCTION(intltz_get_dst_savings) { TIMEZONE_METHOD_INIT_VARS; - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), + if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O", &object, TimeZone_ce_ptr) == FAILURE) { intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, - "intltz_get_dst_savings: bad arguments", 0 TSRMLS_CC); + "intltz_get_dst_savings: bad arguments", 0); RETURN_FALSE; } @@ -611,17 +611,17 @@ U_CFUNC PHP_FUNCTION(intltz_to_date_time_zone) zval tmp; TIMEZONE_METHOD_INIT_VARS; - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), + if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O", &object, TimeZone_ce_ptr) == FAILURE) { intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, - "intltz_to_date_time_zone: bad arguments", 0 TSRMLS_CC); + "intltz_to_date_time_zone: bad arguments", 0); RETURN_FALSE; } TIMEZONE_METHOD_FETCH_OBJECT; zval *ret = timezone_convert_to_datetimezone(to->utimezone, - &TIMEZONE_ERROR(to), "intltz_to_date_time_zone", &tmp TSRMLS_CC); + &TIMEZONE_ERROR(to), "intltz_to_date_time_zone", &tmp); if (ret) { RETURN_ZVAL(ret, 1, 1); @@ -634,10 +634,10 @@ U_CFUNC PHP_FUNCTION(intltz_get_error_code) { TIMEZONE_METHOD_INIT_VARS - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", + if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O", &object, TimeZone_ce_ptr) == FAILURE) { intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, - "intltz_get_error_code: bad arguments", 0 TSRMLS_CC); + "intltz_get_error_code: bad arguments", 0); RETURN_FALSE; } @@ -654,10 +654,10 @@ U_CFUNC PHP_FUNCTION(intltz_get_error_message) zend_string* message = NULL; TIMEZONE_METHOD_INIT_VARS - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", + if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O", &object, TimeZone_ce_ptr) == FAILURE) { intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, - "intltz_get_error_message: bad arguments", 0 TSRMLS_CC ); + "intltz_get_error_message: bad arguments", 0 ); RETURN_FALSE; } @@ -668,6 +668,6 @@ U_CFUNC PHP_FUNCTION(intltz_get_error_message) RETURN_FALSE; /* Return last error message. */ - message = intl_error_get_message(TIMEZONE_ERROR_P(to) TSRMLS_CC); + message = intl_error_get_message(TIMEZONE_ERROR_P(to)); RETURN_STR(message); } diff --git a/ext/intl/transliterator/transliterator.c b/ext/intl/transliterator/transliterator.c index fda183b85a..e7f2ffd72c 100644 --- a/ext/intl/transliterator/transliterator.c +++ b/ext/intl/transliterator/transliterator.c @@ -36,8 +36,8 @@ void transliterator_register_constants( INIT_FUNC_ARGS ) } #define TRANSLITERATOR_EXPOSE_CONST( x ) REGISTER_LONG_CONSTANT( #x, x, CONST_PERSISTENT | CONST_CS ) - #define TRANSLITERATOR_EXPOSE_CLASS_CONST( x ) zend_declare_class_constant_long( Transliterator_ce_ptr, ZEND_STRS( #x ) - 1, TRANSLITERATOR_##x TSRMLS_CC ); - #define TRANSLITERATOR_EXPOSE_CUSTOM_CLASS_CONST( name, value ) zend_declare_class_constant_long( Transliterator_ce_ptr, ZEND_STRS( name ) - 1, value TSRMLS_CC );*/ + #define TRANSLITERATOR_EXPOSE_CLASS_CONST( x ) zend_declare_class_constant_long( Transliterator_ce_ptr, ZEND_STRS( #x ) - 1, TRANSLITERATOR_##x ); + #define TRANSLITERATOR_EXPOSE_CUSTOM_CLASS_CONST( name, value ) zend_declare_class_constant_long( Transliterator_ce_ptr, ZEND_STRS( name ) - 1, value );*/ /* Normalization form constants */ TRANSLITERATOR_EXPOSE_CLASS_CONST( FORWARD ); diff --git a/ext/intl/transliterator/transliterator_class.c b/ext/intl/transliterator/transliterator_class.c index 647ece8ba0..4b799d1802 100644 --- a/ext/intl/transliterator/transliterator_class.c +++ b/ext/intl/transliterator/transliterator_class.c @@ -27,12 +27,12 @@ zend_class_entry *Transliterator_ce_ptr = NULL; zend_object_handlers Transliterator_handlers; -/* {{{ int transliterator_object_construct( zval *object, UTransliterator *utrans, UErrorCode *status TSRMLS_DC ) +/* {{{ int transliterator_object_construct( zval *object, UTransliterator *utrans, UErrorCode *status ) * Initialize internals of Transliterator_object. */ int transliterator_object_construct( zval *object, UTransliterator *utrans, - UErrorCode *status TSRMLS_DC ) + UErrorCode *status ) { const UChar *ustr_id; int32_t ustr_id_len; @@ -56,7 +56,7 @@ int transliterator_object_construct( zval *object, } zend_update_property_stringl(Transliterator_ce_ptr, object, - "id", sizeof( "id" ) - 1, str_id, str_id_len TSRMLS_CC ); + "id", sizeof( "id" ) - 1, str_id, str_id_len ); efree( str_id ); return SUCCESS; } @@ -69,19 +69,19 @@ int transliterator_object_construct( zval *object, /* {{{ void transliterator_object_init( Transliterator_object* to ) * Initialize internals of Transliterator_object. */ -static void transliterator_object_init( Transliterator_object* to TSRMLS_DC ) +static void transliterator_object_init( Transliterator_object* to ) { if( !to ) return; - intl_error_init( TRANSLITERATOR_ERROR_P( to ) TSRMLS_CC ); + intl_error_init( TRANSLITERATOR_ERROR_P( to ) ); } /* }}} */ /* {{{ void transliterator_object_destroy( Transliterator_object* to ) * Clean up mem allocted by internals of Transliterator_object */ -static void transliterator_object_destroy( Transliterator_object* to TSRMLS_DC ) +static void transliterator_object_destroy( Transliterator_object* to ) { if( !to ) return; @@ -92,40 +92,40 @@ static void transliterator_object_destroy( Transliterator_object* to TSRMLS_DC ) to->utrans = NULL; } - intl_error_reset( TRANSLITERATOR_ERROR_P( to ) TSRMLS_CC ); + intl_error_reset( TRANSLITERATOR_ERROR_P( to ) ); } /* }}} */ /* {{{ Transliterator_objects_dtor */ static void Transliterator_objects_dtor( - zend_object *object TSRMLS_DC ) + zend_object *object ) { - zend_objects_destroy_object( object TSRMLS_CC ); + zend_objects_destroy_object( object ); } /* }}} */ /* {{{ Transliterator_objects_free */ -static void Transliterator_objects_free( zend_object *object TSRMLS_DC ) +static void Transliterator_objects_free( zend_object *object ) { Transliterator_object* to = php_intl_transliterator_fetch_object(object); - zend_object_std_dtor( &to->zo TSRMLS_CC ); + zend_object_std_dtor( &to->zo ); - transliterator_object_destroy( to TSRMLS_CC ); + transliterator_object_destroy( to ); } /* }}} */ /* {{{ Transliterator_object_create */ static zend_object *Transliterator_object_create( - zend_class_entry *ce TSRMLS_DC ) + zend_class_entry *ce ) { Transliterator_object* intern; intern = ecalloc( 1, sizeof( Transliterator_object ) + sizeof(zval) * (ce->default_properties_count - 1)); - zend_object_std_init( &intern->zo, ce TSRMLS_CC ); + zend_object_std_init( &intern->zo, ce ); object_properties_init( &intern->zo, ce ); - transliterator_object_init( intern TSRMLS_CC ); + transliterator_object_init( intern ); intern->zo.handlers = &Transliterator_handlers; @@ -138,19 +138,19 @@ static zend_object *Transliterator_object_create( */ /* {{{ clone handler for Transliterator */ -static zend_object *Transliterator_clone_obj( zval *object TSRMLS_DC ) +static zend_object *Transliterator_clone_obj( zval *object ) { Transliterator_object *to_orig, *to_new; zend_object *ret_val; - intl_error_reset( NULL TSRMLS_CC ); + intl_error_reset( NULL ); to_orig = Z_INTL_TRANSLITERATOR_P( object ); - intl_error_reset( INTL_DATA_ERROR_P( to_orig ) TSRMLS_CC ); - ret_val = Transliterator_ce_ptr->create_object( Z_OBJCE_P( object ) TSRMLS_CC ); + intl_error_reset( INTL_DATA_ERROR_P( to_orig ) ); + ret_val = Transliterator_ce_ptr->create_object( Z_OBJCE_P( object ) ); to_new = php_intl_transliterator_fetch_object( ret_val ); - zend_objects_clone_members( &to_new->zo, &to_orig->zo TSRMLS_CC ); + zend_objects_clone_members( &to_new->zo, &to_orig->zo ); if( to_orig->utrans != NULL ) { @@ -165,7 +165,7 @@ static zend_object *Transliterator_clone_obj( zval *object TSRMLS_DC ) ZVAL_OBJ(&tempz, ret_val); transliterator_object_construct( &tempz, utrans, - TRANSLITERATOR_ERROR_CODE_P( to_orig ) TSRMLS_CC ); + TRANSLITERATOR_ERROR_CODE_P( to_orig ) ); if( U_FAILURE( TRANSLITERATOR_ERROR_CODE( to_orig ) ) ) { @@ -173,16 +173,16 @@ static zend_object *Transliterator_clone_obj( zval *object TSRMLS_DC ) err: if( utrans != NULL ) - transliterator_object_destroy( to_new TSRMLS_CC ); + transliterator_object_destroy( to_new ); /* set the error anyway, in case in the future we decide not to * throw an error. It also helps build the error message */ - intl_error_set_code( NULL, INTL_DATA_ERROR_CODE( to_orig ) TSRMLS_CC ); + intl_error_set_code( NULL, INTL_DATA_ERROR_CODE( to_orig ) ); intl_errors_set_custom_msg( TRANSLITERATOR_ERROR_P( to_orig ), - "Could not clone transliterator", 0 TSRMLS_CC ); + "Could not clone transliterator", 0 ); - err_msg = intl_error_get_message( TRANSLITERATOR_ERROR_P( to_orig ) TSRMLS_CC ); - php_error_docref( NULL TSRMLS_CC, E_ERROR, "%s", err_msg->val ); + err_msg = intl_error_get_message( TRANSLITERATOR_ERROR_P( to_orig ) ); + php_error_docref( NULL, E_ERROR, "%s", err_msg->val ); zend_string_free( err_msg ); /* if it's changed into a warning */ /* do not destroy tempz; we need to return something */ } @@ -190,7 +190,7 @@ err: else { /* We shouldn't have unconstructed objects in the first place */ - php_error_docref( NULL TSRMLS_CC, E_WARNING, + php_error_docref( NULL, E_WARNING, "Cloning unconstructed transliterator." ); } @@ -216,7 +216,7 @@ err: } /* {{{ get_property_ptr_ptr handler */ -static zval *Transliterator_get_property_ptr_ptr( zval *object, zval *member, int type, void **cache_slot TSRMLS_DC ) +static zval *Transliterator_get_property_ptr_ptr( zval *object, zval *member, int type, void **cache_slot ) { zval *retval; @@ -229,7 +229,7 @@ static zval *Transliterator_get_property_ptr_ptr( zval *object, zval *member, in } else { - retval = std_object_handlers.get_property_ptr_ptr( object, member, type, cache_slot TSRMLS_CC ); + retval = std_object_handlers.get_property_ptr_ptr( object, member, type, cache_slot ); } TRANSLITERATOR_PROPERTY_HANDLER_EPILOG; @@ -239,7 +239,7 @@ static zval *Transliterator_get_property_ptr_ptr( zval *object, zval *member, in /* }}} */ /* {{{ read_property handler */ -static zval *Transliterator_read_property( zval *object, zval *member, int type, void **cache_slot, zval *rv TSRMLS_DC ) +static zval *Transliterator_read_property( zval *object, zval *member, int type, void **cache_slot, zval *rv ) { zval *retval; @@ -249,12 +249,12 @@ static zval *Transliterator_read_property( zval *object, zval *member, int type, ( zend_binary_strcmp( "id", sizeof( "id" ) - 1, Z_STRVAL_P( member ), Z_STRLEN_P( member ) ) == 0 ) ) { - php_error_docref0( NULL TSRMLS_CC, E_WARNING, "The property \"id\" is read-only" ); + php_error_docref0( NULL, E_WARNING, "The property \"id\" is read-only" ); retval = &EG( uninitialized_zval ); } else { - retval = std_object_handlers.read_property( object, member, type, cache_slot, rv TSRMLS_CC ); + retval = std_object_handlers.read_property( object, member, type, cache_slot, rv ); } TRANSLITERATOR_PROPERTY_HANDLER_EPILOG; @@ -266,7 +266,7 @@ static zval *Transliterator_read_property( zval *object, zval *member, int type, /* {{{ write_property handler */ static void Transliterator_write_property( zval *object, zval *member, zval *value, - void **cache_slot TSRMLS_DC ) + void **cache_slot ) { TRANSLITERATOR_PROPERTY_HANDLER_PROLOG; @@ -274,11 +274,11 @@ static void Transliterator_write_property( zval *object, zval *member, zval *val ( zend_binary_strcmp( "id", sizeof( "id" ) - 1, Z_STRVAL_P( member ), Z_STRLEN_P( member ) ) == 0 ) ) { - php_error_docref0( NULL TSRMLS_CC, E_WARNING, "The property \"id\" is read-only" ); + php_error_docref0( NULL, E_WARNING, "The property \"id\" is read-only" ); } else { - std_object_handlers.write_property( object, member, value, cache_slot TSRMLS_CC ); + std_object_handlers.write_property( object, member, value, cache_slot ); } TRANSLITERATOR_PROPERTY_HANDLER_EPILOG; @@ -339,14 +339,14 @@ zend_function_entry Transliterator_class_functions[] = { /* {{{ transliterator_register_Transliterator_class * Initialize 'Transliterator' class */ -void transliterator_register_Transliterator_class( TSRMLS_D ) +void transliterator_register_Transliterator_class( void ) { zend_class_entry ce; /* Create and register 'Transliterator' class. */ INIT_CLASS_ENTRY( ce, "Transliterator", Transliterator_class_functions ); ce.create_object = Transliterator_object_create; - Transliterator_ce_ptr = zend_register_internal_class( &ce TSRMLS_CC ); + Transliterator_ce_ptr = zend_register_internal_class( &ce ); memcpy( &Transliterator_handlers, zend_get_std_object_handlers(), sizeof Transliterator_handlers ); Transliterator_handlers.offset = XtOffsetOf(Transliterator_object, zo); @@ -366,7 +366,7 @@ void transliterator_register_Transliterator_class( TSRMLS_D ) return; } zend_declare_property_null( Transliterator_ce_ptr, - "id", sizeof( "id" ) - 1, ZEND_ACC_PUBLIC TSRMLS_CC ); + "id", sizeof( "id" ) - 1, ZEND_ACC_PUBLIC ); /* constants are declared in transliterator_register_constants, called from MINIT */ diff --git a/ext/intl/transliterator/transliterator_class.h b/ext/intl/transliterator/transliterator_class.h index f70e86995f..83e99b6f73 100644 --- a/ext/intl/transliterator/transliterator_class.h +++ b/ext/intl/transliterator/transliterator_class.h @@ -54,15 +54,15 @@ static inline Transliterator_object *php_intl_transliterator_fetch_object(zend_o TRANSLITERATOR_METHOD_FETCH_OBJECT_NO_CHECK; \ if( to->utrans == NULL ) \ { \ - intl_errors_set( &to->err, U_ILLEGAL_ARGUMENT_ERROR, "Found unconstructed transliterator", 0 TSRMLS_CC ); \ + intl_errors_set( &to->err, U_ILLEGAL_ARGUMENT_ERROR, "Found unconstructed transliterator", 0 ); \ RETURN_FALSE; \ } int transliterator_object_construct( zval *object, UTransliterator *utrans, - UErrorCode *status TSRMLS_DC ); + UErrorCode *status ); -void transliterator_register_Transliterator_class( TSRMLS_D ); +void transliterator_register_Transliterator_class( void ); extern zend_class_entry *Transliterator_ce_ptr; extern zend_object_handlers Transliterator_handlers; diff --git a/ext/intl/transliterator/transliterator_methods.c b/ext/intl/transliterator/transliterator_methods.c index e79aeb1621..66db8bf522 100644 --- a/ext/intl/transliterator/transliterator_methods.c +++ b/ext/intl/transliterator/transliterator_methods.c @@ -27,7 +27,7 @@ #include <zend_exceptions.h> -static int create_transliterator( char *str_id, int str_id_len, zend_long direction, zval *object TSRMLS_DC ) +static int create_transliterator( char *str_id, int str_id_len, zend_long direction, zval *object ) { Transliterator_object *to; UChar *ustr_id = NULL; @@ -35,12 +35,12 @@ static int create_transliterator( char *str_id, int str_id_len, zend_long direct UTransliterator *utrans; UParseError parse_error = {0, -1}; - intl_error_reset( NULL TSRMLS_CC ); + intl_error_reset( NULL ); if( ( direction != TRANSLITERATOR_FORWARD ) && (direction != TRANSLITERATOR_REVERSE ) ) { intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, - "transliterator_create: invalid direction", 0 TSRMLS_CC ); + "transliterator_create: invalid direction", 0 ); return FAILURE; } @@ -51,8 +51,8 @@ static int create_transliterator( char *str_id, int str_id_len, zend_long direct intl_convert_utf8_to_utf16( &ustr_id, &ustr_id_len, str_id, str_id_len, TRANSLITERATOR_ERROR_CODE_P( to ) ); if( U_FAILURE( TRANSLITERATOR_ERROR_CODE( to ) ) ) { - intl_error_set_code( NULL, TRANSLITERATOR_ERROR_CODE( to ) TSRMLS_CC ); - intl_error_set_custom_msg( NULL, "String conversion of id to UTF-16 failed", 0 TSRMLS_CC ); + intl_error_set_code( NULL, TRANSLITERATOR_ERROR_CODE( to ) ); + intl_error_set_custom_msg( NULL, "String conversion of id to UTF-16 failed", 0 ); zval_dtor( object ); return FAILURE; } @@ -67,29 +67,29 @@ static int create_transliterator( char *str_id, int str_id_len, zend_long direct if( U_FAILURE( TRANSLITERATOR_ERROR_CODE( to ) ) ) { char *buf = NULL; - intl_error_set_code( NULL, TRANSLITERATOR_ERROR_CODE( to ) TSRMLS_CC ); + intl_error_set_code( NULL, TRANSLITERATOR_ERROR_CODE( to ) ); spprintf( &buf, 0, "transliterator_create: unable to open ICU transliterator" " with id \"%s\"", str_id ); if( buf == NULL ) { intl_error_set_custom_msg( NULL, - "transliterator_create: unable to open ICU transliterator", 0 TSRMLS_CC ); + "transliterator_create: unable to open ICU transliterator", 0 ); } else { - intl_error_set_custom_msg( NULL, buf, /* copy message */ 1 TSRMLS_CC ); + intl_error_set_custom_msg( NULL, buf, /* copy message */ 1 ); efree( buf ); } zval_dtor( object ); return FAILURE; } - transliterator_object_construct( object, utrans, TRANSLITERATOR_ERROR_CODE_P( to ) TSRMLS_CC ); + transliterator_object_construct( object, utrans, TRANSLITERATOR_ERROR_CODE_P( to ) ); /* no need to close the transliterator manually on construction error */ if( U_FAILURE( TRANSLITERATOR_ERROR_CODE( to ) ) ) { - intl_error_set_code( NULL, TRANSLITERATOR_ERROR_CODE( to ) TSRMLS_CC ); + intl_error_set_code( NULL, TRANSLITERATOR_ERROR_CODE( to ) ); intl_error_set_custom_msg( NULL, - "transliterator_create: internal constructor call failed", 0 TSRMLS_CC ); + "transliterator_create: internal constructor call failed", 0 ); zval_dtor( object ); return FAILURE; } @@ -112,16 +112,16 @@ PHP_FUNCTION( transliterator_create ) (void) to; /* unused */ - if( zend_parse_parameters( ZEND_NUM_ARGS() TSRMLS_CC, "s|l", + if( zend_parse_parameters( ZEND_NUM_ARGS(), "s|l", &str_id, &str_id_len, &direction ) == FAILURE ) { intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, - "transliterator_create: bad arguments", 0 TSRMLS_CC ); + "transliterator_create: bad arguments", 0 ); RETURN_NULL(); } object = return_value; - res = create_transliterator( str_id, str_id_len, direction, object TSRMLS_CC ); + res = create_transliterator( str_id, str_id_len, direction, object ); if( res == FAILURE ) RETURN_NULL(); @@ -146,18 +146,18 @@ PHP_FUNCTION( transliterator_create_from_rules ) 0x61, 0x6E, 0x73, 0x50, 0x48, 0x50, 0}; /* RulesTransPHP */ TRANSLITERATOR_METHOD_INIT_VARS; - if( zend_parse_parameters( ZEND_NUM_ARGS() TSRMLS_CC, "s|l", + if( zend_parse_parameters( ZEND_NUM_ARGS(), "s|l", &str_rules, &str_rules_len, &direction ) == FAILURE ) { intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, - "transliterator_create_from_rules: bad arguments", 0 TSRMLS_CC ); + "transliterator_create_from_rules: bad arguments", 0 ); RETURN_NULL(); } if( ( direction != TRANSLITERATOR_FORWARD ) && (direction != TRANSLITERATOR_REVERSE ) ) { intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, - "transliterator_create_from_rules: invalid direction", 0 TSRMLS_CC ); + "transliterator_create_from_rules: invalid direction", 0 ); RETURN_NULL(); } @@ -178,7 +178,7 @@ PHP_FUNCTION( transliterator_create_from_rules ) efree( ustr_rules ); } - intl_error_set_code( NULL, INTL_DATA_ERROR_CODE( to ) TSRMLS_CC ); + intl_error_set_code( NULL, INTL_DATA_ERROR_CODE( to ) ); if( U_FAILURE( INTL_DATA_ERROR_CODE( to ) ) ) { char *msg = NULL; @@ -189,13 +189,13 @@ PHP_FUNCTION( transliterator_create_from_rules ) smart_str_free( &parse_error_str ); if( msg != NULL ) { - intl_errors_set_custom_msg( INTL_DATA_ERROR_P( to ), msg, 1 TSRMLS_CC ); + intl_errors_set_custom_msg( INTL_DATA_ERROR_P( to ), msg, 1 ); efree( msg ); } zval_dtor( return_value ); RETURN_NULL(); } - transliterator_object_construct( object, utrans, TRANSLITERATOR_ERROR_CODE_P( to ) TSRMLS_CC ); + transliterator_object_construct( object, utrans, TRANSLITERATOR_ERROR_CODE_P( to ) ); /* no need to close the transliterator manually on construction error */ INTL_CTOR_CHECK_STATUS( to, "transliterator_create_from_rules: internal constructor call failed" ); } @@ -211,11 +211,11 @@ PHP_FUNCTION( transliterator_create_inverse ) UTransliterator *utrans; TRANSLITERATOR_METHOD_INIT_VARS; - if( zend_parse_method_parameters( ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", + if( zend_parse_method_parameters( ZEND_NUM_ARGS(), getThis(), "O", &object, Transliterator_ce_ptr ) == FAILURE ) { intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, - "transliterator_create_inverse: bad arguments", 0 TSRMLS_CC ); + "transliterator_create_inverse: bad arguments", 0 ); RETURN_NULL(); } @@ -229,7 +229,7 @@ PHP_FUNCTION( transliterator_create_inverse ) utrans = utrans_openInverse( to_orig->utrans, TRANSLITERATOR_ERROR_CODE_P( to ) ); INTL_CTOR_CHECK_STATUS( to, "transliterator_create_inverse: could not create " "inverse ICU transliterator" ); - transliterator_object_construct( object, utrans, TRANSLITERATOR_ERROR_CODE_P( to ) TSRMLS_CC ); + transliterator_object_construct( object, utrans, TRANSLITERATOR_ERROR_CODE_P( to ) ); /* no need to close the transliterator manually on construction error */ INTL_CTOR_CHECK_STATUS( to, "transliterator_create: internal constructor call failed" ); } @@ -246,7 +246,7 @@ PHP_FUNCTION( transliterator_list_ids ) int32_t elem_len; UErrorCode status = U_ZERO_ERROR; - intl_error_reset( NULL TSRMLS_CC ); + intl_error_reset( NULL ); if( zend_parse_parameters_none() == FAILURE ) { @@ -254,7 +254,7 @@ PHP_FUNCTION( transliterator_list_ids ) * null on bad parameter types, except on constructors and factory * methods */ intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, - "transliterator_list_ids: bad arguments", 0 TSRMLS_CC ); + "transliterator_list_ids: bad arguments", 0 ); RETURN_FALSE; } @@ -284,13 +284,13 @@ PHP_FUNCTION( transliterator_list_ids ) } uenum_close( en ); - intl_error_set_code( NULL, status TSRMLS_CC ); + intl_error_set_code( NULL, status ); if( U_FAILURE( status ) ) { zval_dtor( return_value ); RETVAL_FALSE; intl_error_set_custom_msg( NULL, "transliterator_list_ids: " - "Failed to build array of registered transliterators", 0 TSRMLS_CC ); + "Failed to build array of registered transliterators", 0 ); } } /* }}} */ @@ -320,16 +320,16 @@ PHP_FUNCTION( transliterator_transliterate ) { /* in non-OOP version, accept both a transliterator and a string */ zval *arg1; - if( zend_parse_parameters( ZEND_NUM_ARGS() TSRMLS_CC, "zs|ll", + if( zend_parse_parameters( ZEND_NUM_ARGS(), "zs|ll", &arg1, &str, &str_len, &start, &limit ) == FAILURE ) { intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, - "transliterator_transliterate: bad arguments", 0 TSRMLS_CC ); + "transliterator_transliterate: bad arguments", 0 ); RETURN_FALSE; } if( Z_TYPE_P( arg1 ) == IS_OBJECT && - instanceof_function( Z_OBJCE_P( arg1 ), Transliterator_ce_ptr TSRMLS_CC ) ) + instanceof_function( Z_OBJCE_P( arg1 ), Transliterator_ce_ptr ) ) { object = arg1; } @@ -343,11 +343,11 @@ PHP_FUNCTION( transliterator_transliterate ) } object = &tmp_object; res = create_transliterator( Z_STRVAL_P( arg1 ), Z_STRLEN_P( arg1 ), - TRANSLITERATOR_FORWARD, object TSRMLS_CC ); + TRANSLITERATOR_FORWARD, object ); if( res == FAILURE ) { - zend_string *message = intl_error_get_message( NULL TSRMLS_CC ); - php_error_docref0( NULL TSRMLS_CC, E_WARNING, "Could not create " + zend_string *message = intl_error_get_message( NULL ); + php_error_docref0( NULL, E_WARNING, "Could not create " "transliterator with ID \"%s\" (%s)", Z_STRVAL_P( arg1 ), message->val ); zend_string_free( message ); /* don't set U_ILLEGAL_ARGUMENT_ERROR to allow fetching of inner error */ @@ -355,11 +355,11 @@ PHP_FUNCTION( transliterator_transliterate ) } } } - else if( zend_parse_parameters( ZEND_NUM_ARGS() TSRMLS_CC, "s|ll", + else if( zend_parse_parameters( ZEND_NUM_ARGS(), "s|ll", &str, &str_len, &start, &limit ) == FAILURE ) { intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, - "transliterator_transliterate: bad arguments", 0 TSRMLS_CC ); + "transliterator_transliterate: bad arguments", 0 ); RETURN_FALSE; } @@ -367,7 +367,7 @@ PHP_FUNCTION( transliterator_transliterate ) { intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, "transliterator_transliterate: \"end\" argument should be " - "either non-negative or -1", 0 TSRMLS_CC ); + "either non-negative or -1", 0 ); RETURN_FALSE; } @@ -375,7 +375,7 @@ PHP_FUNCTION( transliterator_transliterate ) { intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, "transliterator_transliterate: \"start\" argument should be " - "non-negative and not bigger than \"end\" (if defined)", 0 TSRMLS_CC ); + "non-negative and not bigger than \"end\" (if defined)", 0 ); RETURN_FALSE; } @@ -399,7 +399,7 @@ PHP_FUNCTION( transliterator_transliterate ) if(msg != NULL ) { intl_errors_set( TRANSLITERATOR_ERROR_P( to ), U_ILLEGAL_ARGUMENT_ERROR, - msg, 1 TSRMLS_CC ); + msg, 1 ); efree( msg ); } RETVAL_FALSE; @@ -424,20 +424,20 @@ PHP_FUNCTION( transliterator_transliterate ) uresult = safe_emalloc( uresult_len, sizeof( UChar ), 1 * sizeof( UChar ) ); capacity = uresult_len + 1; - intl_error_reset( TRANSLITERATOR_ERROR_P( to ) TSRMLS_CC ); + intl_error_reset( TRANSLITERATOR_ERROR_P( to ) ); } else if(TRANSLITERATOR_ERROR_CODE( to ) == U_STRING_NOT_TERMINATED_WARNING ) { uresult = safe_erealloc( uresult, uresult_len, sizeof( UChar ), 1 * sizeof( UChar ) ); - intl_error_reset( TRANSLITERATOR_ERROR_P( to ) TSRMLS_CC ); + intl_error_reset( TRANSLITERATOR_ERROR_P( to ) ); break; } else if( U_FAILURE( TRANSLITERATOR_ERROR_CODE( to ) ) ) { - intl_error_set_code( NULL, TRANSLITERATOR_ERROR_CODE( to ) TSRMLS_CC ); + intl_error_set_code( NULL, TRANSLITERATOR_ERROR_CODE( to ) ); intl_errors_set_custom_msg( TRANSLITERATOR_ERROR_P( to ), - "transliterator_transliterate: transliteration failed", 0 TSRMLS_CC ); + "transliterator_transliterate: transliteration failed", 0 ); goto cleanup; } else @@ -472,7 +472,7 @@ PHP_METHOD( Transliterator, __construct ) /* this constructor shouldn't be called as it's private */ zend_throw_exception( NULL, "An object of this type cannot be created with the new operator.", - 0 TSRMLS_CC ); + 0 ); } /* {{{ proto int transliterator_get_error_code( Transliterator trans ) @@ -483,11 +483,11 @@ PHP_FUNCTION( transliterator_get_error_code ) { TRANSLITERATOR_METHOD_INIT_VARS - if( zend_parse_method_parameters( ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", + if( zend_parse_method_parameters( ZEND_NUM_ARGS(), getThis(), "O", &object, Transliterator_ce_ptr ) == FAILURE ) { intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, - "transliterator_get_error_code: unable to parse input params", 0 TSRMLS_CC ); + "transliterator_get_error_code: unable to parse input params", 0 ); RETURN_FALSE; } @@ -511,11 +511,11 @@ PHP_FUNCTION( transliterator_get_error_message ) zend_string* message = NULL; TRANSLITERATOR_METHOD_INIT_VARS - if( zend_parse_method_parameters( ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", + if( zend_parse_method_parameters( ZEND_NUM_ARGS(), getThis(), "O", &object, Transliterator_ce_ptr ) == FAILURE ) { intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, - "transliterator_get_error_message: unable to parse input params", 0 TSRMLS_CC ); + "transliterator_get_error_message: unable to parse input params", 0 ); RETURN_FALSE; } @@ -527,7 +527,7 @@ PHP_FUNCTION( transliterator_get_error_message ) RETURN_FALSE; /* Return last error message. */ - message = intl_error_get_message( TRANSLITERATOR_ERROR_P( to ) TSRMLS_CC ); + message = intl_error_get_message( TRANSLITERATOR_ERROR_P( to ) ); RETURN_STR( message ); } /* }}} */ |