Skip to content

Commit 7aa7627

Browse files
committed
Use ZSTR_ API to access zend_string elements (this is just renaming without semantick changes).
1 parent d554d64 commit 7aa7627

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+1358
-1358
lines changed

Zend/zend.c

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ static ZEND_INI_MH(OnUpdateErrorReporting) /* {{{ */
6969
if (!new_value) {
7070
EG(error_reporting) = E_ALL & ~E_NOTICE & ~E_STRICT & ~E_DEPRECATED;
7171
} else {
72-
EG(error_reporting) = atoi(new_value->val);
72+
EG(error_reporting) = atoi(ZSTR_VAL(new_value));
7373
}
7474
return SUCCESS;
7575
}
@@ -95,7 +95,7 @@ static ZEND_INI_MH(OnUpdateScriptEncoding) /* {{{ */
9595
if (!zend_multibyte_get_functions()) {
9696
return SUCCESS;
9797
}
98-
return zend_multibyte_set_script_encoding_by_string(new_value ? new_value->val : NULL, new_value ? new_value->len : 0);
98+
return zend_multibyte_set_script_encoding_by_string(new_value ? ZSTR_VAL(new_value) : NULL, new_value ? ZSTR_LEN(new_value) : 0);
9999
}
100100
/* }}} */
101101

@@ -112,7 +112,7 @@ static ZEND_INI_MH(OnUpdateAssertions) /* {{{ */
112112

113113
p = (zend_long *) (base+(size_t) mh_arg1);
114114

115-
val = zend_atol(new_value->val, (int)new_value->len);
115+
val = zend_atol(ZSTR_VAL(new_value), (int)ZSTR_LEN(new_value));
116116

117117
if (stage != ZEND_INI_STAGE_STARTUP &&
118118
stage != ZEND_INI_STAGE_SHUTDOWN &&
@@ -199,7 +199,7 @@ static void print_hash(zend_write_func_t write_func, HashTable *ht, int indent,
199199
}
200200
}
201201
} else {
202-
ZEND_WRITE_EX(string_key->val, string_key->len);
202+
ZEND_WRITE_EX(ZSTR_VAL(string_key), ZSTR_LEN(string_key));
203203
}
204204
} else {
205205
char key[25];
@@ -231,7 +231,7 @@ static void print_flat_hash(HashTable *ht) /* {{{ */
231231
}
232232
ZEND_PUTS("[");
233233
if (string_key) {
234-
ZEND_WRITE(string_key->val, string_key->len);
234+
ZEND_WRITE(ZSTR_VAL(string_key), ZSTR_LEN(string_key));
235235
} else {
236236
zend_printf(ZEND_ULONG_FMT, num_key);
237237
}
@@ -261,10 +261,10 @@ ZEND_API size_t zend_print_zval(zval *expr, int indent) /* {{{ */
261261
ZEND_API size_t zend_print_zval_ex(zend_write_func_t write_func, zval *expr, int indent) /* {{{ */
262262
{
263263
zend_string *str = zval_get_string(expr);
264-
size_t len = str->len;
264+
size_t len = ZSTR_LEN(str);
265265

266266
if (len != 0) {
267-
write_func(str->val, len);
267+
write_func(ZSTR_VAL(str), len);
268268
}
269269

270270
zend_string_release(str);
@@ -293,7 +293,7 @@ ZEND_API void zend_print_flat_zval_r(zval *expr) /* {{{ */
293293
{
294294
HashTable *properties = NULL;
295295
zend_string *class_name = Z_OBJ_HANDLER_P(expr, get_class_name)(Z_OBJ_P(expr));
296-
zend_printf("%s Object (", class_name->val);
296+
zend_printf("%s Object (", ZSTR_VAL(class_name));
297297
zend_string_release(class_name);
298298

299299
if (Z_OBJ_APPLY_COUNT_P(expr) > 0) {
@@ -348,7 +348,7 @@ ZEND_API void zend_print_zval_r_ex(zend_write_func_t write_func, zval *expr, int
348348
int is_temp;
349349

350350
zend_string *class_name = Z_OBJ_HANDLER_P(expr, get_class_name)(Z_OBJ_P(expr));
351-
ZEND_PUTS_EX(class_name->val);
351+
ZEND_PUTS_EX(ZSTR_VAL(class_name));
352352
zend_string_release(class_name);
353353

354354
ZEND_PUTS_EX(" Object\n");
@@ -1121,7 +1121,7 @@ static void zend_error_va_list(int type, const char *format, va_list args)
11211121
case E_USER_DEPRECATED:
11221122
case E_RECOVERABLE_ERROR:
11231123
if (zend_is_compiling()) {
1124-
error_filename = zend_get_compiled_filename()->val;
1124+
error_filename = ZSTR_VAL(zend_get_compiled_filename());
11251125
error_lineno = zend_get_compiled_lineno();
11261126
} else if (zend_is_executing()) {
11271127
error_filename = zend_get_executed_filename();
@@ -1435,7 +1435,7 @@ ZEND_API char *zend_make_compiled_string_description(const char *name) /* {{{ */
14351435
char *compiled_string_description;
14361436

14371437
if (zend_is_compiling()) {
1438-
cur_filename = zend_get_compiled_filename()->val;
1438+
cur_filename = ZSTR_VAL(zend_get_compiled_filename());
14391439
cur_lineno = zend_get_compiled_lineno();
14401440
} else if (zend_is_executing()) {
14411441
cur_filename = zend_get_executed_filename();

Zend/zend_API.c

Lines changed: 104 additions & 104 deletions
Large diffs are not rendered by default.

Zend/zend_ast.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -557,8 +557,8 @@ static void zend_ast_export_str(smart_str *str, zend_string *s)
557557
{
558558
size_t i;
559559

560-
for (i = 0; i < s->len; i++) {
561-
unsigned char c = s->val[i];
560+
for (i = 0; i < ZSTR_LEN(s); i++) {
561+
unsigned char c = ZSTR_VAL(s)[i];
562562
if (c == '\'' || c == '\\') {
563563
smart_str_appendc(str, '\\');
564564
smart_str_appendc(str, c);
@@ -572,8 +572,8 @@ static void zend_ast_export_qstr(smart_str *str, char quote, zend_string *s)
572572
{
573573
size_t i;
574574

575-
for (i = 0; i < s->len; i++) {
576-
unsigned char c = s->val[i];
575+
for (i = 0; i < ZSTR_LEN(s); i++) {
576+
unsigned char c = ZSTR_VAL(s)[i];
577577
if (c < ' ') {
578578
switch (c) {
579579
case '\n':
@@ -879,7 +879,7 @@ static void zend_ast_export_zval(smart_str *str, zval *zv, int priority, int ind
879879
break;
880880
case IS_DOUBLE:
881881
key = zend_strpprintf(0, "%.*G", (int) EG(precision), Z_DVAL_P(zv));
882-
smart_str_appendl(str, key->val, key->len);
882+
smart_str_appendl(str, ZSTR_VAL(key), ZSTR_LEN(key));
883883
zend_string_release(key);
884884
break;
885885
case IS_STRING:
@@ -1006,7 +1006,7 @@ static void zend_ast_export_ex(smart_str *str, zend_ast *ast, int priority, int
10061006
smart_str_appendc(str, '&');
10071007
}
10081008
if (ast->kind != ZEND_AST_CLOSURE) {
1009-
smart_str_appendl(str, decl->name->val, decl->name->len);
1009+
smart_str_appendl(str, ZSTR_VAL(decl->name), ZSTR_LEN(decl->name));
10101010
}
10111011
smart_str_appendc(str, '(');
10121012
zend_ast_export_ex(str, decl->child[0], 0, indent);
@@ -1043,7 +1043,7 @@ static void zend_ast_export_ex(smart_str *str, zend_ast *ast, int priority, int
10431043
}
10441044
smart_str_appends(str, "class ");
10451045
}
1046-
smart_str_appendl(str, decl->name->val, decl->name->len);
1046+
smart_str_appendl(str, ZSTR_VAL(decl->name), ZSTR_LEN(decl->name));
10471047
if (decl->child[0]) {
10481048
smart_str_appends(str, " extends ");
10491049
zend_ast_export_ns_name(str, decl->child[0], 0, indent);

0 commit comments

Comments
 (0)