Skip to content

Commit 5602f64

Browse files
committed
Eliminate usages of _PP macros
These are either in debug code (fix them), commented out (drop them) or in dead compatibility macros (drop them). One usage was in php_stream_get_from_zval(), which we have not used since at least PHP 5.2 and, judging from the fact that nobody complained about it causing compile errors in PHP 7, nobody else uses it either, so drop it. There are still remaining uses in mysqli embedded and odbc birdstep. These probably need to be dropped outright.
1 parent 3240dd9 commit 5602f64

File tree

9 files changed

+20
-58
lines changed

9 files changed

+20
-58
lines changed

ext/dba/php_dba.h

-2
Original file line numberDiff line numberDiff line change
@@ -129,8 +129,6 @@ typedef struct dba_handler {
129129
DBA_SYNC_FUNC(x); \
130130
DBA_INFO_FUNC(x)
131131

132-
#define VALLEN(p) Z_STRVAL_PP(p), Z_STRLEN_PP(p)
133-
134132
PHP_FUNCTION(dba_open);
135133
PHP_FUNCTION(dba_popen);
136134
PHP_FUNCTION(dba_close);

ext/exif/exif.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -4074,7 +4074,7 @@ PHP_FUNCTION(exif_read_data)
40744074
exif_discard_imageinfo(&ImageInfo);
40754075

40764076
#ifdef EXIF_DEBUG
4077-
php_error_docref1(NULL, Z_STRVAL_PP(p_name), E_NOTICE, "done");
4077+
php_error_docref1(NULL, p_name, E_NOTICE, "done");
40784078
#endif
40794079
}
40804080
/* }}} */

ext/mysqlnd/mysqlnd_priv.h

-14
Original file line numberDiff line numberDiff line change
@@ -23,24 +23,10 @@
2323
#ifndef MYSQLND_PRIV_H
2424
#define MYSQLND_PRIV_H
2525

26-
#ifndef Z_ADDREF_P
27-
/* PHP 5.2, old GC */
28-
#define Z_ADDREF_P(pz) (++(pz)->refcount)
29-
#define Z_DELREF_P(pz) (--(pz)->refcount)
30-
#define Z_REFCOUNT_P(pz) ((pz)->refcount)
31-
#define Z_SET_REFCOUNT_P(pz, rc) ((pz)->refcount = rc)
32-
#define Z_REFCOUNT_PP(ppz) Z_REFCOUNT_P(*(ppz))
33-
#define Z_DELREF_PP(ppz) Z_DELREF_P(*(ppz))
34-
#endif
35-
3626
#ifdef ZTS
3727
#include "TSRM.h"
3828
#endif
3929

40-
#ifndef pestrndup
41-
#define pestrndup(s, length, persistent) ((persistent)?zend_strndup((s),(length)):estrndup((s),(length)))
42-
#endif
43-
4430
#define MYSQLND_STR_W_LEN(str) str, (sizeof(str) - 1)
4531

4632
#define MYSQLND_DEBUG_DUMP_TIME 1

ext/readline/readline.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,7 @@ PHP_FUNCTION(readline_info)
305305
oldval = rl_erase_empty_line;
306306
if (value) {
307307
convert_to_long_ex(value);
308-
rl_erase_empty_line = Z_LVAL_PP(value);
308+
rl_erase_empty_line = Z_LVAL_P(value);
309309
}
310310
RETVAL_LONG(oldval);
311311
#endif

ext/soap/php_http.c

-10
Original file line numberDiff line numberDiff line change
@@ -700,16 +700,6 @@ int make_http_soap_request(zval *this_ptr,
700700
PHP_MD5Update(&md5ctx, (unsigned char*)phpurl->query, strlen(phpurl->query));
701701
}
702702

703-
/* TODO: Support for qop="auth-int" */
704-
/*
705-
if (zend_hash_find(Z_ARRVAL_PP(digest), "qop", sizeof("qop"), (void **)&tmp) == SUCCESS &&
706-
Z_TYPE_PP(tmp) == IS_STRING &&
707-
Z_STRLEN_PP(tmp) == sizeof("auth-int")-1 &&
708-
stricmp(Z_STRVAL_PP(tmp), "auth-int") == 0) {
709-
PHP_MD5Update(&md5ctx, ":", 1);
710-
PHP_MD5Update(&md5ctx, HEntity, HASHHEXLEN);
711-
}
712-
*/
713703
PHP_MD5Final(hash, &md5ctx);
714704
make_digest(HA2, hash);
715705

ext/standard/var_unserializer.c

+16-17
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* Generated by re2c 0.13.7.5 */
1+
/* Generated by re2c 0.13.5 */
22
#line 1 "ext/standard/var_unserializer.re"
33
/*
44
+----------------------------------------------------------------------+
@@ -44,7 +44,7 @@ static inline void var_push(php_unserialize_data_t *var_hashx, zval *rval)
4444
{
4545
var_entries *var_hash = (*var_hashx)->last;
4646
#if VAR_ENTRIES_DBG
47-
fprintf(stderr, "var_push(%ld): %d\n", var_hash?var_hash->used_slots:-1L, Z_TYPE_PP(rval));
47+
fprintf(stderr, "var_push(%ld): %d\n", var_hash?var_hash->used_slots:-1L, Z_TYPE_P(rval));
4848
#endif
4949

5050
if (!var_hash || var_hash->used_slots == VAR_ENTRIES_MAX) {
@@ -104,7 +104,7 @@ PHPAPI void var_replace(php_unserialize_data_t *var_hashx, zval *ozval, zval *nz
104104
zend_long i;
105105
var_entries *var_hash = (*var_hashx)->first;
106106
#if VAR_ENTRIES_DBG
107-
fprintf(stderr, "var_replace(%ld): %d\n", var_hash?var_hash->used_slots:-1L, Z_TYPE_PP(nzval));
107+
fprintf(stderr, "var_replace(%ld): %d\n", var_hash?var_hash->used_slots:-1L, Z_TYPE_P(nzval));
108108
#endif
109109

110110
while (var_hash) {
@@ -651,8 +651,7 @@ PHPAPI int php_var_unserialize_ex(UNSERIALIZE_PARAMETER)
651651
if (yybm[0+yych] & 128) {
652652
goto yy20;
653653
}
654-
if (yych <= '/') goto yy18;
655-
if (yych >= ';') goto yy18;
654+
if (yych != ':') goto yy18;
656655
yych = *++YYCURSOR;
657656
if (yych != '"') goto yy18;
658657
++YYCURSOR;
@@ -801,7 +800,7 @@ PHPAPI int php_var_unserialize_ex(UNSERIALIZE_PARAMETER)
801800

802801
return object_common2(UNSERIALIZE_PASSTHRU, elements);
803802
}
804-
#line 805 "ext/standard/var_unserializer.c"
803+
#line 804 "ext/standard/var_unserializer.c"
805804
yy25:
806805
yych = *++YYCURSOR;
807806
if (yych <= ',') {
@@ -833,7 +832,7 @@ PHPAPI int php_var_unserialize_ex(UNSERIALIZE_PARAMETER)
833832
return object_common2(UNSERIALIZE_PASSTHRU,
834833
object_common1(UNSERIALIZE_PASSTHRU, ZEND_STANDARD_CLASS_DEF_PTR));
835834
}
836-
#line 837 "ext/standard/var_unserializer.c"
835+
#line 836 "ext/standard/var_unserializer.c"
837836
yy32:
838837
yych = *++YYCURSOR;
839838
if (yych == '+') goto yy33;
@@ -878,7 +877,7 @@ PHPAPI int php_var_unserialize_ex(UNSERIALIZE_PARAMETER)
878877

879878
return finish_nested_data(UNSERIALIZE_PASSTHRU);
880879
}
881-
#line 882 "ext/standard/var_unserializer.c"
880+
#line 881 "ext/standard/var_unserializer.c"
882881
yy39:
883882
yych = *++YYCURSOR;
884883
if (yych == '+') goto yy40;
@@ -927,7 +926,7 @@ PHPAPI int php_var_unserialize_ex(UNSERIALIZE_PARAMETER)
927926
ZVAL_STR(rval, str);
928927
return 1;
929928
}
930-
#line 931 "ext/standard/var_unserializer.c"
929+
#line 930 "ext/standard/var_unserializer.c"
931930
yy46:
932931
yych = *++YYCURSOR;
933932
if (yych == '+') goto yy47;
@@ -975,7 +974,7 @@ PHPAPI int php_var_unserialize_ex(UNSERIALIZE_PARAMETER)
975974
ZVAL_STRINGL(rval, str, len);
976975
return 1;
977976
}
978-
#line 979 "ext/standard/var_unserializer.c"
977+
#line 978 "ext/standard/var_unserializer.c"
979978
yy53:
980979
yych = *++YYCURSOR;
981980
if (yych <= '/') {
@@ -1072,7 +1071,7 @@ PHPAPI int php_var_unserialize_ex(UNSERIALIZE_PARAMETER)
10721071
ZVAL_DOUBLE(rval, zend_strtod((const char *)start + 2, NULL));
10731072
return 1;
10741073
}
1075-
#line 1076 "ext/standard/var_unserializer.c"
1074+
#line 1075 "ext/standard/var_unserializer.c"
10761075
yy65:
10771076
yych = *++YYCURSOR;
10781077
if (yych <= ',') {
@@ -1147,7 +1146,7 @@ PHPAPI int php_var_unserialize_ex(UNSERIALIZE_PARAMETER)
11471146

11481147
return 1;
11491148
}
1150-
#line 1151 "ext/standard/var_unserializer.c"
1149+
#line 1150 "ext/standard/var_unserializer.c"
11511150
yy76:
11521151
yych = *++YYCURSOR;
11531152
if (yych == 'N') goto yy73;
@@ -1200,7 +1199,7 @@ PHPAPI int php_var_unserialize_ex(UNSERIALIZE_PARAMETER)
12001199
ZVAL_LONG(rval, parse_iv(start + 2));
12011200
return 1;
12021201
}
1203-
#line 1204 "ext/standard/var_unserializer.c"
1202+
#line 1203 "ext/standard/var_unserializer.c"
12041203
yy83:
12051204
yych = *++YYCURSOR;
12061205
if (yych <= '/') goto yy18;
@@ -1214,7 +1213,7 @@ PHPAPI int php_var_unserialize_ex(UNSERIALIZE_PARAMETER)
12141213
ZVAL_BOOL(rval, parse_iv(start + 2));
12151214
return 1;
12161215
}
1217-
#line 1218 "ext/standard/var_unserializer.c"
1216+
#line 1217 "ext/standard/var_unserializer.c"
12181217
yy87:
12191218
++YYCURSOR;
12201219
#line 573 "ext/standard/var_unserializer.re"
@@ -1223,7 +1222,7 @@ PHPAPI int php_var_unserialize_ex(UNSERIALIZE_PARAMETER)
12231222
ZVAL_NULL(rval);
12241223
return 1;
12251224
}
1226-
#line 1227 "ext/standard/var_unserializer.c"
1225+
#line 1226 "ext/standard/var_unserializer.c"
12271226
yy89:
12281227
yych = *++YYCURSOR;
12291228
if (yych <= ',') {
@@ -1271,7 +1270,7 @@ PHPAPI int php_var_unserialize_ex(UNSERIALIZE_PARAMETER)
12711270

12721271
return 1;
12731272
}
1274-
#line 1275 "ext/standard/var_unserializer.c"
1273+
#line 1274 "ext/standard/var_unserializer.c"
12751274
yy95:
12761275
yych = *++YYCURSOR;
12771276
if (yych <= ',') {
@@ -1320,7 +1319,7 @@ PHPAPI int php_var_unserialize_ex(UNSERIALIZE_PARAMETER)
13201319

13211320
return 1;
13221321
}
1323-
#line 1324 "ext/standard/var_unserializer.c"
1322+
#line 1323 "ext/standard/var_unserializer.c"
13241323
}
13251324
#line 875 "ext/standard/var_unserializer.re"
13261325

ext/standard/var_unserializer.re

+2-2
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ static inline void var_push(php_unserialize_data_t *var_hashx, zval *rval)
4242
{
4343
var_entries *var_hash = (*var_hashx)->last;
4444
#if VAR_ENTRIES_DBG
45-
fprintf(stderr, "var_push(%ld): %d\n", var_hash?var_hash->used_slots:-1L, Z_TYPE_PP(rval));
45+
fprintf(stderr, "var_push(%ld): %d\n", var_hash?var_hash->used_slots:-1L, Z_TYPE_P(rval));
4646
#endif
4747

4848
if (!var_hash || var_hash->used_slots == VAR_ENTRIES_MAX) {
@@ -102,7 +102,7 @@ PHPAPI void var_replace(php_unserialize_data_t *var_hashx, zval *ozval, zval *nz
102102
zend_long i;
103103
var_entries *var_hash = (*var_hashx)->first;
104104
#if VAR_ENTRIES_DBG
105-
fprintf(stderr, "var_replace(%ld): %d\n", var_hash?var_hash->used_slots:-1L, Z_TYPE_PP(nzval));
105+
fprintf(stderr, "var_replace(%ld): %d\n", var_hash?var_hash->used_slots:-1L, Z_TYPE_P(nzval));
106106
#endif
107107

108108
while (var_hash) {

main/php_streams.h

-6
Original file line numberDiff line numberDiff line change
@@ -568,12 +568,6 @@ PHPAPI const char *php_stream_locate_eol(php_stream *stream, zend_string *buf);
568568
#define php_stream_open_wrapper(path, mode, options, opened) _php_stream_open_wrapper_ex((path), (mode), (options), (opened), NULL STREAMS_CC)
569569
#define php_stream_open_wrapper_ex(path, mode, options, opened, context) _php_stream_open_wrapper_ex((path), (mode), (options), (opened), (context) STREAMS_CC)
570570

571-
#define php_stream_get_from_zval(stream, zstream, mode, options, opened, context) \
572-
if (Z_TYPE_PP((zstream)) == IS_RESOURCE) { \
573-
php_stream_from_zval((stream), (zstream)); \
574-
} else (stream) = Z_TYPE_PP((zstream)) == IS_STRING ? \
575-
php_stream_open_wrapper_ex(Z_STRVAL_PP((zstream)), (mode), (options), (opened), (context)) : NULL
576-
577571
/* pushes an error message onto the stack for a wrapper instance */
578572
PHPAPI void php_stream_wrapper_log_error(php_stream_wrapper *wrapper, int options, const char *fmt, ...) PHP_ATTRIBUTE_FORMAT(printf, 3, 4);
579573

sapi/phpdbg/phpdbg_wait.c

-5
Original file line numberDiff line numberDiff line change
@@ -281,11 +281,6 @@ void phpdbg_webdata_decompress(char *msg, int len) {
281281
pefree(elm, zend_extensions.persistent);
282282
zend_extensions.count--;
283283
} else {
284-
/* zend_hash_get_current_key_zval_ex(Z_ARRVAL_PP(zvpp), &key, &hpos);
285-
if (Z_TYPE(key) == IS_LONG) {
286-
zend_hash_index_del(Z_ARRVAL_PP(zvpp), Z_LVAL(key));
287-
}
288-
*/
289284
zend_hash_del(Z_ARRVAL_P(zvp), strkey);
290285
}
291286
}

0 commit comments

Comments
 (0)