@@ -303,16 +303,15 @@ static PHP_MINFO_FUNCTION(bz2)
303
303
/* {{{ Reads up to length bytes from a BZip2 stream, or 1024 bytes if length is not specified */
304
304
PHP_FUNCTION (bzread )
305
305
{
306
- zval * bz ;
307
306
zend_long len = 1024 ;
308
307
php_stream * stream ;
309
308
zend_string * data ;
310
309
311
- if ( FAILURE == zend_parse_parameters ( ZEND_NUM_ARGS (), "r|l" , & bz , & len )) {
312
- RETURN_THROWS ();
313
- }
314
-
315
- php_stream_from_zval ( stream , bz );
310
+ ZEND_PARSE_PARAMETERS_START ( 1 , 2 )
311
+ PHP_Z_PARAM_STREAM ( stream )
312
+ Z_PARAM_OPTIONAL
313
+ Z_PARAM_LONG ( len )
314
+ ZEND_PARSE_PARAMETERS_END ( );
316
315
317
316
if (len < 0 ) {
318
317
zend_argument_value_error (2 , "must be greater than or equal to 0" );
@@ -563,17 +562,14 @@ PHP_FUNCTION(bzdecompress)
563
562
The central error handling interface, does the work for bzerrno, bzerrstr and bzerror */
564
563
static void php_bz2_error (INTERNAL_FUNCTION_PARAMETERS , int opt )
565
564
{
566
- zval * bzp ; /* BZip2 Resource Pointer */
567
565
php_stream * stream ;
568
566
const char * errstr ; /* Error string */
569
567
int errnum ; /* Error number */
570
568
struct php_bz2_stream_data_t * self ;
571
569
572
- if (zend_parse_parameters (ZEND_NUM_ARGS (), "r" , & bzp ) == FAILURE ) {
573
- RETURN_THROWS ();
574
- }
575
-
576
- php_stream_from_zval (stream , bzp );
570
+ ZEND_PARSE_PARAMETERS_START (1 , 1 )
571
+ PHP_Z_PARAM_STREAM (stream )
572
+ ZEND_PARSE_PARAMETERS_END ();
577
573
578
574
if (!php_stream_is (stream , PHP_STREAM_IS_BZIP2 )) {
579
575
zend_argument_type_error (1 , "must be a bz2 stream" );
0 commit comments