Skip to content

Commit ce18738

Browse files
committed
Removed "_" from API functions.
1 parent 50eeb46 commit ce18738

File tree

6 files changed

+58
-54
lines changed

6 files changed

+58
-54
lines changed

Zend/zend.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,7 @@ ZEND_API int zend_make_printable_zval(zval *expr, zval *expr_copy) /* {{{ */
314314
if (Z_TYPE_P(expr) == IS_STRING) {
315315
return 0;
316316
} else {
317-
ZVAL_STR(expr_copy, _zval_get_string_func(expr));
317+
ZVAL_STR(expr_copy, zval_get_string_func(expr));
318318
return 1;
319319
}
320320
}

Zend/zend_execute.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -1096,7 +1096,7 @@ static zend_never_inline zend_long zend_check_string_offset(zval *dim, int type
10961096
break;
10971097
}
10981098

1099-
offset = _zval_get_long_func(dim);
1099+
offset = zval_get_long_func(dim);
11001100
} else {
11011101
offset = Z_LVAL_P(dim);
11021102
}
@@ -1769,7 +1769,7 @@ static zend_always_inline void zend_fetch_dimension_address_read(zval *result, z
17691769
break;
17701770
}
17711771

1772-
offset = _zval_get_long_func(dim);
1772+
offset = zval_get_long_func(dim);
17731773
} else {
17741774
offset = Z_LVAL_P(dim);
17751775
}

Zend/zend_operators.c

+3-3
Original file line numberDiff line numberDiff line change
@@ -788,7 +788,7 @@ static zend_always_inline zend_long ZEND_FASTCALL _zval_get_long_func_ex(zval *o
788788
}
789789
/* }}} */
790790

791-
ZEND_API zend_long ZEND_FASTCALL _zval_get_long_func(zval *op) /* {{{ */
791+
ZEND_API zend_long ZEND_FASTCALL zval_get_long_func(zval *op) /* {{{ */
792792
{
793793
return _zval_get_long_func_ex(op, 1);
794794
}
@@ -800,7 +800,7 @@ static zend_long ZEND_FASTCALL _zval_get_long_func_noisy(zval *op) /* {{{ */
800800
}
801801
/* }}} */
802802

803-
ZEND_API double ZEND_FASTCALL _zval_get_double_func(zval *op) /* {{{ */
803+
ZEND_API double ZEND_FASTCALL zval_get_double_func(zval *op) /* {{{ */
804804
{
805805
try_again:
806806
switch (Z_TYPE_P(op)) {
@@ -839,7 +839,7 @@ ZEND_API double ZEND_FASTCALL _zval_get_double_func(zval *op) /* {{{ */
839839
}
840840
/* }}} */
841841

842-
ZEND_API zend_string* ZEND_FASTCALL _zval_get_string_func(zval *op) /* {{{ */
842+
ZEND_API zend_string* ZEND_FASTCALL zval_get_string_func(zval *op) /* {{{ */
843843
{
844844
try_again:
845845
switch (Z_TYPE_P(op)) {

Zend/zend_operators.h

+16-12
Original file line numberDiff line numberDiff line change
@@ -259,23 +259,27 @@ ZEND_API void multi_convert_to_long_ex(int argc, ...);
259259
ZEND_API void multi_convert_to_double_ex(int argc, ...);
260260
ZEND_API void multi_convert_to_string_ex(int argc, ...);
261261

262-
ZEND_API zend_long ZEND_FASTCALL _zval_get_long_func(zval *op);
263-
ZEND_API double ZEND_FASTCALL _zval_get_double_func(zval *op);
264-
ZEND_API zend_string* ZEND_FASTCALL _zval_get_string_func(zval *op);
262+
ZEND_API zend_long ZEND_FASTCALL zval_get_long_func(zval *op);
263+
ZEND_API double ZEND_FASTCALL zval_get_double_func(zval *op);
264+
ZEND_API zend_string* ZEND_FASTCALL zval_get_string_func(zval *op);
265265

266-
static zend_always_inline zend_long _zval_get_long(zval *op) {
267-
return Z_TYPE_P(op) == IS_LONG ? Z_LVAL_P(op) : _zval_get_long_func(op);
266+
static zend_always_inline zend_long zval_get_long(zval *op) {
267+
return EXPECTED(Z_TYPE_P(op) == IS_LONG) ? Z_LVAL_P(op) : zval_get_long_func(op);
268268
}
269-
static zend_always_inline double _zval_get_double(zval *op) {
270-
return Z_TYPE_P(op) == IS_DOUBLE ? Z_DVAL_P(op) : _zval_get_double_func(op);
269+
static zend_always_inline double zval_get_double(zval *op) {
270+
return EXPECTED(Z_TYPE_P(op) == IS_DOUBLE) ? Z_DVAL_P(op) : zval_get_double_func(op);
271271
}
272-
static zend_always_inline zend_string *_zval_get_string(zval *op) {
273-
return Z_TYPE_P(op) == IS_STRING ? zend_string_copy(Z_STR_P(op)) : _zval_get_string_func(op);
272+
static zend_always_inline zend_string *zval_get_string(zval *op) {
273+
return EXPECTED(Z_TYPE_P(op) == IS_STRING) ? zend_string_copy(Z_STR_P(op)) : zval_get_string_func(op);
274274
}
275275

276-
#define zval_get_long(op) _zval_get_long((op))
277-
#define zval_get_double(op) _zval_get_double((op))
278-
#define zval_get_string(op) _zval_get_string((op))
276+
/* Compatibility macros for 7.2 and below */
277+
#define _zval_get_long(op) zval_get_long(op)
278+
#define _zval_get_double(op) zval_get_double(op)
279+
#define _zval_get_string(op) zval_get_string(op)
280+
#define _zval_get_long_func(op) zval_get_long_func(op)
281+
#define _zval_get_double_func(op) zval_get_double_func(op)
282+
#define _zval_get_string_func(op) zval_get_string_func(op)
279283

280284
#define convert_to_cstring(op) if (Z_TYPE_P(op) != IS_STRING) { _convert_to_cstring((op) ZEND_FILE_LINE_CC); }
281285
#define convert_to_string(op) if (Z_TYPE_P(op) != IS_STRING) { _convert_to_string((op) ZEND_FILE_LINE_CC); }

Zend/zend_vm_def.h

+6-6
Original file line numberDiff line numberDiff line change
@@ -1359,7 +1359,7 @@ ZEND_VM_HANDLER(40, ZEND_ECHO, CONST|TMPVAR|CV, ANY)
13591359
zend_write(ZSTR_VAL(str), ZSTR_LEN(str));
13601360
}
13611361
} else {
1362-
zend_string *str = _zval_get_string_func(z);
1362+
zend_string *str = zval_get_string_func(z);
13631363

13641364
if (ZSTR_LEN(str) != 0) {
13651365
zend_write(ZSTR_VAL(str), ZSTR_LEN(str));
@@ -2769,7 +2769,7 @@ ZEND_VM_HANDLER(53, ZEND_FAST_CONCAT, CONST|TMPVAR|CV, CONST|TMPVAR|CV)
27692769
if (OP1_TYPE == IS_CV && UNEXPECTED(Z_TYPE_P(op1) == IS_UNDEF)) {
27702770
GET_OP1_UNDEF_CV(op1, BP_VAR_R);
27712771
}
2772-
op1_str = _zval_get_string_func(op1);
2772+
op1_str = zval_get_string_func(op1);
27732773
}
27742774
if (OP2_TYPE == IS_CONST) {
27752775
op2_str = Z_STR_P(op2);
@@ -2779,7 +2779,7 @@ ZEND_VM_HANDLER(53, ZEND_FAST_CONCAT, CONST|TMPVAR|CV, CONST|TMPVAR|CV)
27792779
if (OP2_TYPE == IS_CV && UNEXPECTED(Z_TYPE_P(op2) == IS_UNDEF)) {
27802780
GET_OP2_UNDEF_CV(op2, BP_VAR_R);
27812781
}
2782-
op2_str = _zval_get_string_func(op2);
2782+
op2_str = zval_get_string_func(op2);
27832783
}
27842784
do {
27852785
if (OP1_TYPE != IS_CONST) {
@@ -2843,7 +2843,7 @@ ZEND_VM_HANDLER(54, ZEND_ROPE_INIT, UNUSED, CONST|TMPVAR|CV, NUM)
28432843
if (OP2_TYPE == IS_CV && UNEXPECTED(Z_TYPE_P(var) == IS_UNDEF)) {
28442844
GET_OP2_UNDEF_CV(var, BP_VAR_R);
28452845
}
2846-
rope[0] = _zval_get_string_func(var);
2846+
rope[0] = zval_get_string_func(var);
28472847
FREE_OP2();
28482848
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
28492849
}
@@ -2876,7 +2876,7 @@ ZEND_VM_HANDLER(55, ZEND_ROPE_ADD, TMP, CONST|TMPVAR|CV, NUM)
28762876
if (OP2_TYPE == IS_CV && UNEXPECTED(Z_TYPE_P(var) == IS_UNDEF)) {
28772877
GET_OP2_UNDEF_CV(var, BP_VAR_R);
28782878
}
2879-
rope[opline->extended_value] = _zval_get_string_func(var);
2879+
rope[opline->extended_value] = zval_get_string_func(var);
28802880
FREE_OP2();
28812881
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
28822882
}
@@ -2911,7 +2911,7 @@ ZEND_VM_HANDLER(56, ZEND_ROPE_END, TMP, CONST|TMPVAR|CV, NUM)
29112911
if (OP2_TYPE == IS_CV && UNEXPECTED(Z_TYPE_P(var) == IS_UNDEF)) {
29122912
GET_OP2_UNDEF_CV(var, BP_VAR_R);
29132913
}
2914-
rope[opline->extended_value] = _zval_get_string_func(var);
2914+
rope[opline->extended_value] = zval_get_string_func(var);
29152915
FREE_OP2();
29162916
if (UNEXPECTED(EG(exception))) {
29172917
for (i = 0; i <= opline->extended_value; i++) {

0 commit comments

Comments
 (0)