diff options
author | Dmitry Stogov <dmitry@zend.com> | 2015-06-30 04:05:24 +0300 |
---|---|---|
committer | Dmitry Stogov <dmitry@zend.com> | 2015-06-30 04:05:24 +0300 |
commit | 4a2e40bb861bc3cf5fb6863e57486ed60316e97c (patch) | |
tree | 6579660b282fdd1bc50095e48d702913a0b6aa97 /ext/intl/breakiterator | |
parent | 8cce5b2641fb91c3073018b59f6f044b843041a8 (diff) | |
download | php-git-4a2e40bb861bc3cf5fb6863e57486ed60316e97c.tar.gz |
Use ZSTR_ API to access zend_string elements (this is just renaming without semantick changes).
Diffstat (limited to 'ext/intl/breakiterator')
4 files changed, 11 insertions, 11 deletions
diff --git a/ext/intl/breakiterator/breakiterator_class.cpp b/ext/intl/breakiterator/breakiterator_class.cpp index 813204cd21..db99ad09cf 100644 --- a/ext/intl/breakiterator/breakiterator_class.cpp +++ b/ext/intl/breakiterator/breakiterator_class.cpp @@ -120,7 +120,7 @@ static zend_object *BreakIterator_clone_obj(zval *object) intl_errors_set_custom_msg(BREAKITER_ERROR_P(bio_orig), "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_throw_exception(NULL, ZSTR_VAL(err_msg), 0); zend_string_free(err_msg); } else { bio_new->biter = new_biter; diff --git a/ext/intl/breakiterator/breakiterator_iterators.cpp b/ext/intl/breakiterator/breakiterator_iterators.cpp index aa2f92763b..bdf1b3e53f 100644 --- a/ext/intl/breakiterator/breakiterator_iterators.cpp +++ b/ext/intl/breakiterator/breakiterator_iterators.cpp @@ -177,8 +177,8 @@ static void _breakiterator_parts_move_forward(zend_object_iterator *iter) assert(next <= slen && next >= cur); res = zend_string_alloc(next - cur, 0); - memcpy(res->val, &s[cur], res->len); - res->val[res->len] = '\0'; + memcpy(ZSTR_VAL(res), &s[cur], ZSTR_LEN(res)); + ZSTR_VAL(res)[ZSTR_LEN(res)] = '\0'; ZVAL_STR(&zoi_bit->zoi_cur.current, res); } @@ -249,14 +249,14 @@ U_CFUNC zend_function *IntlPartsIterator_get_method(zend_object **object_ptr, ze ALLOCA_FLAG(use_heap); if (key == NULL) { - ZSTR_ALLOCA_ALLOC(lc_method_name, method->len, use_heap); - zend_str_tolower_copy(lc_method_name->val, method->val, method->len); + ZSTR_ALLOCA_ALLOC(lc_method_name, ZSTR_LEN(method), use_heap); + zend_str_tolower_copy(ZSTR_VAL(lc_method_name), ZSTR_VAL(method), ZSTR_LEN(method)); } else { lc_method_name = Z_STR_P(key); } - if (method->len == sizeof("getrulestatus") - 1 - && memcmp("getrulestatus", lc_method_name->val, lc_method_name->len) == 0) { + if (ZSTR_LEN(method) == sizeof("getrulestatus") - 1 + && memcmp("getrulestatus", ZSTR_VAL(lc_method_name), ZSTR_LEN(lc_method_name)) == 0) { IntlIterator_object *obj = php_intl_iterator_fetch_object(*object_ptr); if (obj->iterator && !Z_ISUNDEF(obj->iterator->data)) { zval *break_iter_zv = &obj->iterator->data; diff --git a/ext/intl/breakiterator/breakiterator_methods.cpp b/ext/intl/breakiterator/breakiterator_methods.cpp index ce855ebacd..0363198f06 100644 --- a/ext/intl/breakiterator/breakiterator_methods.cpp +++ b/ext/intl/breakiterator/breakiterator_methods.cpp @@ -161,7 +161,7 @@ U_CFUNC PHP_FUNCTION(breakiter_set_text) BREAKITER_METHOD_FETCH_OBJECT; - ut = utext_openUTF8(ut, text->val, text->len, BREAKITER_ERROR_CODE_P(bio)); + ut = utext_openUTF8(ut, ZSTR_VAL(text), ZSTR_LEN(text), BREAKITER_ERROR_CODE_P(bio)); INTL_METHOD_CHECK_STATUS_OR_NULL(bio, "breakiter_set_text: error opening UText"); bio->biter->setText(ut, BREAKITER_ERROR_CODE(bio)); diff --git a/ext/intl/breakiterator/rulebasedbreakiterator_methods.cpp b/ext/intl/breakiterator/rulebasedbreakiterator_methods.cpp index 8acf128b2c..1988e7477d 100644 --- a/ext/intl/breakiterator/rulebasedbreakiterator_methods.cpp +++ b/ext/intl/breakiterator/rulebasedbreakiterator_methods.cpp @@ -66,7 +66,7 @@ static void _php_intlrbbi_constructor_body(INTERNAL_FUNCTION_PARAMETERS) smart_str parse_error_str; parse_error_str = intl_parse_error_to_string(&parseError); spprintf(&msg, 0, "rbbi_create_instance: unable to create " - "RuleBasedBreakIterator from rules (%s)", parse_error_str.s? parse_error_str.s->val : ""); + "RuleBasedBreakIterator from rules (%s)", parse_error_str.s? ZSTR_VAL(parse_error_str.s) : ""); smart_str_free(&parse_error_str); intl_error_set_custom_msg(NULL, msg, 1); efree(msg); @@ -211,8 +211,8 @@ U_CFUNC PHP_FUNCTION(rbbi_get_binary_rules) } zend_string *ret_rules = zend_string_alloc(rules_len, 0); - memcpy(ret_rules->val, rules, rules_len); - ret_rules->val[rules_len] = '\0'; + memcpy(ZSTR_VAL(ret_rules), rules, rules_len); + ZSTR_VAL(ret_rules)[rules_len] = '\0'; RETURN_STR(ret_rules); } |