@@ -350,11 +350,7 @@ static php_stream *user_wrapper_opener(php_stream_wrapper *wrapper, const char *
350
350
ZVAL_STRING (& zfuncname , USERSTREAM_OPEN );
351
351
352
352
zend_try {
353
- call_result = call_user_function (NULL ,
354
- Z_ISUNDEF (us -> object )? NULL : & us -> object ,
355
- & zfuncname ,
356
- & zretval ,
357
- 4 , args );
353
+ call_result = call_user_function (NULL , & us -> object , & zfuncname , & zretval , 4 , args );
358
354
} zend_catch {
359
355
FG (user_stream_current_filename ) = NULL ;
360
356
zend_bailout ();
@@ -428,11 +424,7 @@ static php_stream *user_wrapper_opendir(php_stream_wrapper *wrapper, const char
428
424
429
425
ZVAL_STRING (& zfuncname , USERSTREAM_DIR_OPEN );
430
426
431
- call_result = call_user_function (NULL ,
432
- Z_ISUNDEF (us -> object )? NULL : & us -> object ,
433
- & zfuncname ,
434
- & zretval ,
435
- 2 , args );
427
+ call_result = call_user_function (NULL , & us -> object , & zfuncname , & zretval , 2 , args );
436
428
437
429
if (call_result == SUCCESS && Z_TYPE (zretval ) != IS_UNDEF && zval_is_true (& zretval )) {
438
430
/* the stream is now open! */
@@ -571,11 +563,7 @@ static ssize_t php_userstreamop_write(php_stream *stream, const char *buf, size_
571
563
572
564
ZVAL_STRINGL (& args [0 ], (char * )buf , count );
573
565
574
- call_result = call_user_function (NULL ,
575
- Z_ISUNDEF (us -> object )? NULL : & us -> object ,
576
- & func_name ,
577
- & retval ,
578
- 1 , args );
566
+ call_result = call_user_function (NULL , & us -> object , & func_name , & retval , 1 , args );
579
567
zval_ptr_dtor (& args [0 ]);
580
568
zval_ptr_dtor (& func_name );
581
569
@@ -624,11 +612,7 @@ static ssize_t php_userstreamop_read(php_stream *stream, char *buf, size_t count
624
612
625
613
ZVAL_LONG (& args [0 ], count );
626
614
627
- call_result = call_user_function (NULL ,
628
- Z_ISUNDEF (us -> object )? NULL : & us -> object ,
629
- & func_name ,
630
- & retval ,
631
- 1 , args );
615
+ call_result = call_user_function (NULL , & us -> object , & func_name , & retval , 1 , args );
632
616
633
617
zval_ptr_dtor (& args [0 ]);
634
618
zval_ptr_dtor (& func_name );
@@ -667,11 +651,7 @@ static ssize_t php_userstreamop_read(php_stream *stream, char *buf, size_t count
667
651
/* since the user stream has no way of setting the eof flag directly, we need to ask it if we hit eof */
668
652
669
653
ZVAL_STRINGL (& func_name , USERSTREAM_EOF , sizeof (USERSTREAM_EOF )- 1 );
670
- call_result = call_user_function (NULL ,
671
- Z_ISUNDEF (us -> object )? NULL : & us -> object ,
672
- & func_name ,
673
- & retval ,
674
- 0 , NULL );
654
+ call_result = call_user_function (NULL , & us -> object , & func_name , & retval , 0 , NULL );
675
655
zval_ptr_dtor (& func_name );
676
656
677
657
if (EG (exception )) {
@@ -704,11 +684,7 @@ static int php_userstreamop_close(php_stream *stream, int close_handle)
704
684
705
685
ZVAL_STRINGL (& func_name , USERSTREAM_CLOSE , sizeof (USERSTREAM_CLOSE )- 1 );
706
686
707
- call_user_function (NULL ,
708
- Z_ISUNDEF (us -> object )? NULL : & us -> object ,
709
- & func_name ,
710
- & retval ,
711
- 0 , NULL );
687
+ call_user_function (NULL , & us -> object , & func_name , & retval , 0 , NULL );
712
688
713
689
zval_ptr_dtor (& retval );
714
690
zval_ptr_dtor (& func_name );
@@ -732,11 +708,7 @@ static int php_userstreamop_flush(php_stream *stream)
732
708
733
709
ZVAL_STRINGL (& func_name , USERSTREAM_FLUSH , sizeof (USERSTREAM_FLUSH )- 1 );
734
710
735
- call_result = call_user_function (NULL ,
736
- Z_ISUNDEF (us -> object )? NULL : & us -> object ,
737
- & func_name ,
738
- & retval ,
739
- 0 , NULL );
711
+ call_result = call_user_function (NULL , & us -> object , & func_name , & retval , 0 , NULL );
740
712
741
713
if (call_result == SUCCESS && Z_TYPE (retval ) != IS_UNDEF && zval_is_true (& retval ))
742
714
call_result = 0 ;
@@ -764,11 +736,7 @@ static int php_userstreamop_seek(php_stream *stream, zend_off_t offset, int when
764
736
ZVAL_LONG (& args [0 ], offset );
765
737
ZVAL_LONG (& args [1 ], whence );
766
738
767
- call_result = call_user_function (NULL ,
768
- Z_ISUNDEF (us -> object )? NULL : & us -> object ,
769
- & func_name ,
770
- & retval ,
771
- 2 , args );
739
+ call_result = call_user_function (NULL , & us -> object , & func_name , & retval , 2 , args );
772
740
773
741
zval_ptr_dtor (& args [0 ]);
774
742
zval_ptr_dtor (& args [1 ]);
@@ -798,11 +766,7 @@ static int php_userstreamop_seek(php_stream *stream, zend_off_t offset, int when
798
766
/* now determine where we are */
799
767
ZVAL_STRINGL (& func_name , USERSTREAM_TELL , sizeof (USERSTREAM_TELL )- 1 );
800
768
801
- call_result = call_user_function (NULL ,
802
- Z_ISUNDEF (us -> object )? NULL : & us -> object ,
803
- & func_name ,
804
- & retval ,
805
- 0 , NULL );
769
+ call_result = call_user_function (NULL , & us -> object , & func_name , & retval , 0 , NULL );
806
770
807
771
if (call_result == SUCCESS && Z_TYPE (retval ) == IS_LONG ) {
808
772
* newoffs = Z_LVAL (retval );
@@ -868,11 +832,7 @@ static int php_userstreamop_stat(php_stream *stream, php_stream_statbuf *ssb)
868
832
869
833
ZVAL_STRINGL (& func_name , USERSTREAM_STAT , sizeof (USERSTREAM_STAT )- 1 );
870
834
871
- call_result = call_user_function (NULL ,
872
- Z_ISUNDEF (us -> object )? NULL : & us -> object ,
873
- & func_name ,
874
- & retval ,
875
- 0 , NULL );
835
+ call_result = call_user_function (NULL , & us -> object , & func_name , & retval , 0 , NULL );
876
836
877
837
if (call_result == SUCCESS && Z_TYPE (retval ) == IS_ARRAY ) {
878
838
if (SUCCESS == statbuf_from_array (& retval , ssb ))
@@ -902,7 +862,7 @@ static int php_userstreamop_set_option(php_stream *stream, int option, int value
902
862
switch (option ) {
903
863
case PHP_STREAM_OPTION_CHECK_LIVENESS :
904
864
ZVAL_STRINGL (& func_name , USERSTREAM_EOF , sizeof (USERSTREAM_EOF )- 1 );
905
- call_result = call_user_function (NULL , Z_ISUNDEF ( us -> object )? NULL : & us -> object , & func_name , & retval , 0 , NULL );
865
+ call_result = call_user_function (NULL , & us -> object , & func_name , & retval , 0 , NULL );
906
866
if (call_result == SUCCESS && (Z_TYPE (retval ) == IS_FALSE || Z_TYPE (retval ) == IS_TRUE )) {
907
867
ret = zval_is_true (& retval ) ? PHP_STREAM_OPTION_RETURN_ERR : PHP_STREAM_OPTION_RETURN_OK ;
908
868
} else {
@@ -936,11 +896,7 @@ static int php_userstreamop_set_option(php_stream *stream, int option, int value
936
896
/* TODO wouldblock */
937
897
ZVAL_STRINGL (& func_name , USERSTREAM_LOCK , sizeof (USERSTREAM_LOCK )- 1 );
938
898
939
- call_result = call_user_function (NULL ,
940
- Z_ISUNDEF (us -> object )? NULL : & us -> object ,
941
- & func_name ,
942
- & retval ,
943
- 1 , args );
899
+ call_result = call_user_function (NULL , & us -> object , & func_name , & retval , 1 , args );
944
900
945
901
if (call_result == SUCCESS && (Z_TYPE (retval ) == IS_FALSE || Z_TYPE (retval ) == IS_TRUE )) {
946
902
ret = (Z_TYPE (retval ) == IS_FALSE );
@@ -965,9 +921,7 @@ static int php_userstreamop_set_option(php_stream *stream, int option, int value
965
921
966
922
switch (value ) {
967
923
case PHP_STREAM_TRUNCATE_SUPPORTED :
968
- if (zend_is_callable_ex (& func_name ,
969
- Z_ISUNDEF (us -> object )? NULL : Z_OBJ (us -> object ),
970
- 0 , NULL , NULL , NULL ))
924
+ if (zend_is_callable_ex (& func_name , Z_OBJ (us -> object ), 0 , NULL , NULL , NULL ))
971
925
ret = PHP_STREAM_OPTION_RETURN_OK ;
972
926
else
973
927
ret = PHP_STREAM_OPTION_RETURN_ERR ;
@@ -977,11 +931,7 @@ static int php_userstreamop_set_option(php_stream *stream, int option, int value
977
931
ptrdiff_t new_size = * (ptrdiff_t * ) ptrparam ;
978
932
if (new_size >= 0 && new_size <= (ptrdiff_t )LONG_MAX ) {
979
933
ZVAL_LONG (& args [0 ], (zend_long )new_size );
980
- call_result = call_user_function (NULL ,
981
- Z_ISUNDEF (us -> object )? NULL : & us -> object ,
982
- & func_name ,
983
- & retval ,
984
- 1 , args );
934
+ call_result = call_user_function (NULL , & us -> object , & func_name , & retval , 1 , args );
985
935
if (call_result == SUCCESS && Z_TYPE (retval ) != IS_UNDEF ) {
986
936
if (Z_TYPE (retval ) == IS_FALSE || Z_TYPE (retval ) == IS_TRUE ) {
987
937
ret = (Z_TYPE (retval ) == IS_TRUE ) ? PHP_STREAM_OPTION_RETURN_OK :
@@ -1041,11 +991,7 @@ static int php_userstreamop_set_option(php_stream *stream, int option, int value
1041
991
break ;
1042
992
}
1043
993
1044
- call_result = call_user_function (NULL ,
1045
- Z_ISUNDEF (us -> object )? NULL : & us -> object ,
1046
- & func_name ,
1047
- & retval ,
1048
- 3 , args );
994
+ call_result = call_user_function (NULL , & us -> object , & func_name , & retval , 3 , args );
1049
995
1050
996
if (call_result == FAILURE ) {
1051
997
php_error_docref (NULL , E_WARNING , "%s::" USERSTREAM_SET_OPTION " is not implemented!" ,
@@ -1388,11 +1334,7 @@ static ssize_t php_userstreamop_readdir(php_stream *stream, char *buf, size_t co
1388
1334
1389
1335
ZVAL_STRINGL (& func_name , USERSTREAM_DIR_READ , sizeof (USERSTREAM_DIR_READ )- 1 );
1390
1336
1391
- call_result = call_user_function (NULL ,
1392
- Z_ISUNDEF (us -> object )? NULL : & us -> object ,
1393
- & func_name ,
1394
- & retval ,
1395
- 0 , NULL );
1337
+ call_result = call_user_function (NULL , & us -> object , & func_name , & retval , 0 , NULL );
1396
1338
1397
1339
if (call_result == SUCCESS && Z_TYPE (retval ) != IS_FALSE && Z_TYPE (retval ) != IS_TRUE ) {
1398
1340
convert_to_string (& retval );
@@ -1420,11 +1362,7 @@ static int php_userstreamop_closedir(php_stream *stream, int close_handle)
1420
1362
1421
1363
ZVAL_STRINGL (& func_name , USERSTREAM_DIR_CLOSE , sizeof (USERSTREAM_DIR_CLOSE )- 1 );
1422
1364
1423
- call_user_function (NULL ,
1424
- Z_ISUNDEF (us -> object )? NULL : & us -> object ,
1425
- & func_name ,
1426
- & retval ,
1427
- 0 , NULL );
1365
+ call_user_function (NULL , & us -> object , & func_name , & retval , 0 , NULL );
1428
1366
1429
1367
zval_ptr_dtor (& retval );
1430
1368
zval_ptr_dtor (& func_name );
@@ -1444,11 +1382,7 @@ static int php_userstreamop_rewinddir(php_stream *stream, zend_off_t offset, int
1444
1382
1445
1383
ZVAL_STRINGL (& func_name , USERSTREAM_DIR_REWIND , sizeof (USERSTREAM_DIR_REWIND )- 1 );
1446
1384
1447
- call_user_function (NULL ,
1448
- Z_ISUNDEF (us -> object )? NULL : & us -> object ,
1449
- & func_name ,
1450
- & retval ,
1451
- 0 , NULL );
1385
+ call_user_function (NULL , & us -> object , & func_name , & retval , 0 , NULL );
1452
1386
1453
1387
zval_ptr_dtor (& retval );
1454
1388
zval_ptr_dtor (& func_name );
@@ -1478,11 +1412,7 @@ static int php_userstreamop_cast(php_stream *stream, int castas, void **retptr)
1478
1412
break ;
1479
1413
}
1480
1414
1481
- call_result = call_user_function (NULL ,
1482
- Z_ISUNDEF (us -> object )? NULL : & us -> object ,
1483
- & func_name ,
1484
- & retval ,
1485
- 1 , args );
1415
+ call_result = call_user_function (NULL , & us -> object , & func_name , & retval , 1 , args );
1486
1416
1487
1417
do {
1488
1418
if (call_result == FAILURE ) {
0 commit comments