From f9b642952acdf39e5aa395e09507a3424da9b4db Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Tue, 6 Oct 2020 14:34:03 +0200 Subject: [PATCH 1/2] Update ext/ffi parameter names --- ext/ffi/ffi.stub.php | 14 +++++++------- ext/ffi/ffi_arginfo.h | 12 ++++++------ 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/ext/ffi/ffi.stub.php b/ext/ffi/ffi.stub.php index 1662caa41b92c..b9016cb4a3787 100644 --- a/ext/ffi/ffi.stub.php +++ b/ext/ffi/ffi.stub.php @@ -10,7 +10,7 @@ public static function cdef(string $code = "", ?string $lib = null): FFI {} public static function load(string $filename): ?FFI {} - public static function scope(string $scope_name): ?FFI {} + public static function scope(string $name): ?FFI {} public static function new(FFI\CType|string $type, bool $owned = true, bool $persistent = false): ?FFI\CData {} @@ -28,7 +28,7 @@ public static function type(string $type): ?FFI\CType {} /** @prefer-ref $ptr */ public static function typeof(FFI\CData $ptr): ?FFI\CType {} - public static function arrayType(FFI\CType $type, array $dims): ?FFI\CType {} + public static function arrayType(FFI\CType $type, array $dimensions): ?FFI\CType {} /** @prefer-ref $ptr */ public static function addr(FFI\CData $ptr): FFI\CData {} @@ -40,11 +40,11 @@ public static function sizeof(object $ptr): ?int {} public static function alignof(object $ptr): ?int {} /** - * @param FFI\CData|string $src - * @prefer-ref $dst - * @prefer-ref $src + * @param FFI\CData|string $from + * @prefer-ref $to + * @prefer-ref $from */ - public static function memcpy(FFI\CData $dst, $src, int $size): void {} + public static function memcpy(FFI\CData $to, $from, int $size): void {} /** * @prefer-ref $ptr1 @@ -55,7 +55,7 @@ public static function memcpy(FFI\CData $dst, $src, int $size): void {} public static function memcmp($ptr1, $ptr2, int $size): ?int {} /** @prefer-ref $ptr */ - public static function memset(FFI\CData $ptr, int $ch, int $size): void {} + public static function memset(FFI\CData $ptr, int $byte, int $size): void {} /** @prefer-ref $ptr */ public static function string(FFI\CData $ptr, ?int $size = null): ?string {} diff --git a/ext/ffi/ffi_arginfo.h b/ext/ffi/ffi_arginfo.h index b5162fcce7a0d..aaea9bf935777 100644 --- a/ext/ffi/ffi_arginfo.h +++ b/ext/ffi/ffi_arginfo.h @@ -1,5 +1,5 @@ /* This is a generated file, edit the .stub.php file instead. - * Stub hash: 63219df3f7ccf823350d288bf2dfeba5291a3e51 */ + * Stub hash: 71fc3abb8050b454420b7f35d21d184dde844951 */ ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_class_FFI_cdef, 0, 0, FFI, 0) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, code, IS_STRING, 0, "\"\"") @@ -11,7 +11,7 @@ ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_class_FFI_load, 0, 1, FFI, 1) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_class_FFI_scope, 0, 1, FFI, 1) - ZEND_ARG_TYPE_INFO(0, scope_name, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_class_FFI_new, 0, 1, FFI\\CData, 1) @@ -39,7 +39,7 @@ ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_class_FFI_arrayType, 0, 2, FFI\\CType, 1) ZEND_ARG_OBJ_INFO(0, type, FFI\\CType, 0) - ZEND_ARG_TYPE_INFO(0, dims, IS_ARRAY, 0) + ZEND_ARG_TYPE_INFO(0, dimensions, IS_ARRAY, 0) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_class_FFI_addr, 0, 1, FFI\\CData, 0) @@ -53,8 +53,8 @@ ZEND_END_ARG_INFO() #define arginfo_class_FFI_alignof arginfo_class_FFI_sizeof ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_FFI_memcpy, 0, 3, IS_VOID, 0) - ZEND_ARG_OBJ_INFO(ZEND_SEND_PREFER_REF, dst, FFI\\CData, 0) - ZEND_ARG_INFO(ZEND_SEND_PREFER_REF, src) + ZEND_ARG_OBJ_INFO(ZEND_SEND_PREFER_REF, to, FFI\\CData, 0) + ZEND_ARG_INFO(ZEND_SEND_PREFER_REF, from) ZEND_ARG_TYPE_INFO(0, size, IS_LONG, 0) ZEND_END_ARG_INFO() @@ -66,7 +66,7 @@ ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_FFI_memset, 0, 3, IS_VOID, 0) ZEND_ARG_OBJ_INFO(ZEND_SEND_PREFER_REF, ptr, FFI\\CData, 0) - ZEND_ARG_TYPE_INFO(0, ch, IS_LONG, 0) + ZEND_ARG_TYPE_INFO(0, byte, IS_LONG, 0) ZEND_ARG_TYPE_INFO(0, size, IS_LONG, 0) ZEND_END_ARG_INFO() From 04cbaf71815383513f3b246173d231f33de4c4ab Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Wed, 7 Oct 2020 10:44:59 +0200 Subject: [PATCH 2/2] $byte -> $value --- ext/ffi/ffi.stub.php | 2 +- ext/ffi/ffi_arginfo.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ext/ffi/ffi.stub.php b/ext/ffi/ffi.stub.php index b9016cb4a3787..0a347b2aa123b 100644 --- a/ext/ffi/ffi.stub.php +++ b/ext/ffi/ffi.stub.php @@ -55,7 +55,7 @@ public static function memcpy(FFI\CData $to, $from, int $size): void {} public static function memcmp($ptr1, $ptr2, int $size): ?int {} /** @prefer-ref $ptr */ - public static function memset(FFI\CData $ptr, int $byte, int $size): void {} + public static function memset(FFI\CData $ptr, int $value, int $size): void {} /** @prefer-ref $ptr */ public static function string(FFI\CData $ptr, ?int $size = null): ?string {} diff --git a/ext/ffi/ffi_arginfo.h b/ext/ffi/ffi_arginfo.h index aaea9bf935777..4ff649967d094 100644 --- a/ext/ffi/ffi_arginfo.h +++ b/ext/ffi/ffi_arginfo.h @@ -1,5 +1,5 @@ /* This is a generated file, edit the .stub.php file instead. - * Stub hash: 71fc3abb8050b454420b7f35d21d184dde844951 */ + * Stub hash: abd3bc186ae3f71f2b7eb1d47f3b6bab84fb2bda */ ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_class_FFI_cdef, 0, 0, FFI, 0) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, code, IS_STRING, 0, "\"\"") @@ -66,7 +66,7 @@ ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_FFI_memset, 0, 3, IS_VOID, 0) ZEND_ARG_OBJ_INFO(ZEND_SEND_PREFER_REF, ptr, FFI\\CData, 0) - ZEND_ARG_TYPE_INFO(0, byte, IS_LONG, 0) + ZEND_ARG_TYPE_INFO(0, value, IS_LONG, 0) ZEND_ARG_TYPE_INFO(0, size, IS_LONG, 0) ZEND_END_ARG_INFO()