@@ -154,7 +154,7 @@ PHP_FUNCTION(assert)
154
154
zval retval ;
155
155
int old_error_reporting = 0 ; /* shut up gcc! */
156
156
157
- myeval = ( * assertion )-> value . str . val ;
157
+ myeval = Z_STRVAL_PP ( assertion );
158
158
159
159
if (ASSERT (quiet_eval )) {
160
160
old_error_reporting = EG (error_reporting );
@@ -174,10 +174,10 @@ PHP_FUNCTION(assert)
174
174
}
175
175
176
176
convert_to_boolean (& retval );
177
- val = retval . value . lval ;
177
+ val = Z_LVAL ( retval ) ;
178
178
} else {
179
179
convert_to_boolean_ex (assertion );
180
- val = ( * assertion )-> value . lval ;
180
+ val = Z_LVAL_PP ( assertion );
181
181
}
182
182
183
183
if (val ) {
@@ -210,18 +210,17 @@ PHP_FUNCTION(assert)
210
210
MAKE_STD_ZVAL(args[4]);
211
211
*/
212
212
213
- args [0 ]-> type = IS_STRING ; args [ 0 ] -> value . str . val = estrdup ( SAFE_STRING (cbfunc )); args [ 0 ] -> value . str . len = strlen ( args [ 0 ] -> value . str . val );
214
- args [1 ]-> type = IS_STRING ; args [ 1 ] -> value . str . val = estrdup ( SAFE_STRING (filename )); args [ 1 ] -> value . str . len = strlen ( args [ 1 ] -> value . str . val );
215
- args [ 2 ] -> type = IS_LONG ; args [2 ]-> value . lval = lineno ;
216
- args [3 ]-> type = IS_STRING ; args [ 3 ] -> value . str . val = estrdup ( SAFE_STRING (myeval )); args [ 3 ] -> value . str . len = strlen ( args [ 3 ] -> value . str . val );
213
+ ZVAL_STRING ( args [0 ], SAFE_STRING (cbfunc ), 1 );
214
+ ZVAL_STRING ( args [1 ], SAFE_STRING (filename ), 1 );
215
+ ZVAL_LONG ( args [2 ], lineno );
216
+ ZVAL_STRING ( args [3 ], SAFE_STRING (myeval ), 1 );
217
217
/*
218
218
this is always "assert" so it's useless
219
219
args[4]->type = IS_STRING; args[4]->value.str.val = estrdup(SAFE_STRING(function)); args[4]->value.str.len = strlen(args[4]->value.str.val);
220
220
*/
221
221
222
222
MAKE_STD_ZVAL (retval );
223
- retval -> type = IS_BOOL ;
224
- retval -> value .lval = 0 ;
223
+ ZVAL_BOOL (retval ,0 );
225
224
226
225
/* XXX do we want to check for error here? */
227
226
call_user_function (CG (function_table ), NULL , args [0 ], retval , 3 , args + 1 );
@@ -268,7 +267,7 @@ PHP_FUNCTION(assert_options)
268
267
oldint = ASSERT (active );
269
268
if (ac == 2 ) {
270
269
convert_to_long_ex (value );
271
- ASSERT (active ) = ( * value )-> value . lval ;
270
+ ASSERT (active ) = Z_LVAL_PP ( value );
272
271
}
273
272
RETURN_LONG (oldint );
274
273
break ;
@@ -277,7 +276,7 @@ PHP_FUNCTION(assert_options)
277
276
oldint = ASSERT (bail );
278
277
if (ac == 2 ) {
279
278
convert_to_long_ex (value );
280
- ASSERT (bail ) = ( * value )-> value . lval ;
279
+ ASSERT (bail ) = Z_LVAL_PP ( value );
281
280
}
282
281
RETURN_LONG (oldint );
283
282
break ;
@@ -286,7 +285,7 @@ PHP_FUNCTION(assert_options)
286
285
oldint = ASSERT (quiet_eval );
287
286
if (ac == 2 ) {
288
287
convert_to_long_ex (value );
289
- ASSERT (quiet_eval ) = ( * value )-> value . lval ;
288
+ ASSERT (quiet_eval ) = Z_LVAL_PP ( value );
290
289
}
291
290
RETURN_LONG (oldint );
292
291
break ;
@@ -295,7 +294,7 @@ PHP_FUNCTION(assert_options)
295
294
oldint = ASSERT (warning );
296
295
if (ac == 2 ) {
297
296
convert_to_long_ex (value );
298
- ASSERT (warning ) = ( * value )-> value . lval ;
297
+ ASSERT (warning ) = Z_LVAL_PP ( value );
299
298
}
300
299
RETURN_LONG (oldint );
301
300
break ;
@@ -309,13 +308,13 @@ PHP_FUNCTION(assert_options)
309
308
efree (oldstr );
310
309
}
311
310
convert_to_string_ex (value );
312
- ASSERT (callback ) = estrndup (( * value )-> value . str . val ,( * value )-> value . str . len );
311
+ ASSERT (callback ) = estrndup (Z_STRVAL_PP ( value ), Z_STRLEN_PP ( value ));
313
312
}
314
313
return ;
315
314
break ;
316
315
317
316
default :
318
- php_error (E_WARNING ,"Unknown value %d." ,( * what )-> value . lval );
317
+ php_error (E_WARNING ,"Unknown value %d." ,Z_LVAL_PP ( what ));
319
318
break ;
320
319
}
321
320
0 commit comments