Skip to content

Commit 69ba2b9

Browse files
committed
Fix var_unserializer debug code
At least it now compiles and should be free of warnings.
1 parent 1eb75f2 commit 69ba2b9

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

ext/standard/var_unserializer.re

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ static inline void var_push(php_unserialize_data_t *var_hashx, zval *rval)
9696
{
9797
var_entries *var_hash = (*var_hashx)->last;
9898
#if VAR_ENTRIES_DBG
99-
fprintf(stderr, "var_push(%ld): %d\n", var_hash?var_hash->used_slots:-1L, Z_TYPE_P(rval));
99+
fprintf(stderr, "var_push(" ZEND_LONG_FMT "): %d\n", var_hash?var_hash->used_slots:-1L, Z_TYPE_P(rval));
100100
#endif
101101

102102
if (var_hash->used_slots == VAR_ENTRIES_MAX) {
@@ -154,7 +154,7 @@ PHPAPI void var_replace(php_unserialize_data_t *var_hashx, zval *ozval, zval *nz
154154
zend_long i;
155155
var_entries *var_hash = &(*var_hashx)->entries;
156156
#if VAR_ENTRIES_DBG
157-
fprintf(stderr, "var_replace(%ld): %d\n", var_hash?var_hash->used_slots:-1L, Z_TYPE_P(nzval));
157+
fprintf(stderr, "var_replace(" ZEND_LONG_FMT "): %d\n", var_hash?var_hash->used_slots:-1L, Z_TYPE_P(nzval));
158158
#endif
159159

160160
while (var_hash) {
@@ -172,7 +172,7 @@ static zval *var_access(php_unserialize_data_t *var_hashx, zend_long id)
172172
{
173173
var_entries *var_hash = &(*var_hashx)->entries;
174174
#if VAR_ENTRIES_DBG
175-
fprintf(stderr, "var_access(%ld): %ld\n", var_hash?var_hash->used_slots:-1L, id);
175+
fprintf(stderr, "var_access(" ZEND_LONG_FMT "): " ZEND_LONG_FMT "\n", var_hash?var_hash->used_slots:-1L, id);
176176
#endif
177177

178178
while (id >= VAR_ENTRIES_MAX && var_hash && var_hash->used_slots == VAR_ENTRIES_MAX) {
@@ -199,7 +199,7 @@ PHPAPI void var_destroy(php_unserialize_data_t *var_hashx)
199199
ZVAL_UNDEF(&unserialize_name);
200200

201201
#if VAR_ENTRIES_DBG
202-
fprintf(stderr, "var_destroy(%ld)\n", var_hash?var_hash->used_slots:-1L);
202+
fprintf(stderr, "var_destroy( " ZEND_LONG_FMT ")\n", var_hash?var_hash->used_slots:-1L);
203203
#endif
204204

205205
while (var_hash) {
@@ -212,7 +212,7 @@ PHPAPI void var_destroy(php_unserialize_data_t *var_hashx)
212212
for (i = 0; i < var_dtor_hash->used_slots; i++) {
213213
zval *zv = &var_dtor_hash->data[i];
214214
#if VAR_ENTRIES_DBG
215-
fprintf(stderr, "var_destroy dtor(%p, %ld)\n", var_dtor_hash->data[i], Z_REFCOUNT_P(var_dtor_hash->data[i]));
215+
fprintf(stderr, "var_destroy dtor(%p, %ld)\n", &var_dtor_hash->data[i], Z_REFCOUNT_P(&var_dtor_hash->data[i]));
216216
#endif
217217

218218
if (Z_EXTRA_P(zv) == VAR_WAKEUP_FLAG) {

0 commit comments

Comments
 (0)