Skip to content

Commit 0db4f60

Browse files
committed
streams: refactor statbuf_from_array()
1 parent 7af46fd commit 0db4f60

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

main/streams/userspace.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -794,12 +794,12 @@ static int php_userstreamop_seek(php_stream *stream, zend_off_t offset, int when
794794

795795
/* parse the return value from one of the stat functions and store the
796796
* relevant fields into the statbuf provided */
797-
static void statbuf_from_array(zval *array, php_stream_statbuf *ssb)
797+
static void statbuf_from_array(const HashTable *array, php_stream_statbuf *ssb)
798798
{
799799
zval *elem;
800800

801801
#define STAT_PROP_ENTRY_EX(name, name2) \
802-
if (NULL != (elem = zend_hash_str_find(Z_ARRVAL_P(array), #name, sizeof(#name)-1))) { \
802+
if (NULL != (elem = zend_hash_str_find(array, #name, sizeof(#name)-1))) { \
803803
ssb->sb.st_##name2 = zval_get_long(elem); \
804804
}
805805

@@ -842,7 +842,7 @@ static int php_userstreamop_stat(php_stream *stream, php_stream_statbuf *ssb)
842842
zend_result call_result = call_method_if_exists(&us->object, &func_name, &retval, 0, NULL);
843843

844844
if (call_result == SUCCESS && Z_TYPE(retval) == IS_ARRAY) {
845-
statbuf_from_array(&retval, ssb);
845+
statbuf_from_array(Z_ARR(retval), ssb);
846846
ret = 0;
847847
} else {
848848
if (call_result == FAILURE) {
@@ -1275,7 +1275,7 @@ static int user_wrapper_stat_url(php_stream_wrapper *wrapper, const char *url, i
12751275

12761276
if (call_result == SUCCESS && Z_TYPE(zretval) == IS_ARRAY) {
12771277
/* We got the info we needed */
1278-
statbuf_from_array(&zretval, ssb);
1278+
statbuf_from_array(Z_ARR(zretval), ssb);
12791279
ret = 0;
12801280
} else {
12811281
if (call_result == FAILURE) {

0 commit comments

Comments
 (0)