Skip to content

Commit

Permalink
Fix the signature of FFI::typeof() and FFI::memcmp()
Browse files Browse the repository at this point in the history
  • Loading branch information
kocsismate committed Dec 24, 2020
1 parent c1d7661 commit ab4c597
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions ext/ffi/ffi.stub.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public static function cast(FFI\CType|string $type, $ptr): ?FFI\CData {}
public static function type(string $type): ?FFI\CType {}

/** @prefer-ref $ptr */
public static function typeof(FFI\CData $ptr): ?FFI\CType {}
public static function typeof(FFI\CData $ptr): FFI\CType {}

public static function arrayType(FFI\CType $type, array $dimensions): ?FFI\CType {}

Expand Down Expand Up @@ -58,7 +58,7 @@ public static function memcpy(FFI\CData $to, $from, int $size): void {}
* @prefer-ref $ptr2
* @param string|FFI\CData $ptr2
*/
public static function memcmp($ptr1, $ptr2, int $size): ?int {}
public static function memcmp($ptr1, $ptr2, int $size): int {}

/** @prefer-ref $ptr */
public static function memset(FFI\CData $ptr, int $value, int $size): void {}
Expand Down
6 changes: 3 additions & 3 deletions ext/ffi/ffi_arginfo.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* This is a generated file, edit the .stub.php file instead.
* Stub hash: f106049da816d8fef7bbfb40c5335245b57044e0 */
* Stub hash: 677c62adf295003b4b2d273995a4bda623d507bf */

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, "\"\"")
Expand Down Expand Up @@ -33,7 +33,7 @@ ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_class_FFI_type, 0, 1, FFI\\CType,
ZEND_ARG_TYPE_INFO(0, type, IS_STRING, 0)
ZEND_END_ARG_INFO()

ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_class_FFI_typeof, 0, 1, FFI\\CType, 1)
ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_class_FFI_typeof, 0, 1, FFI\\CType, 0)
ZEND_ARG_OBJ_INFO(ZEND_SEND_PREFER_REF, ptr, FFI\\CData, 0)
ZEND_END_ARG_INFO()

Expand All @@ -58,7 +58,7 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_FFI_memcpy, 0, 3, IS_VOID,
ZEND_ARG_TYPE_INFO(0, size, IS_LONG, 0)
ZEND_END_ARG_INFO()

ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_FFI_memcmp, 0, 3, IS_LONG, 1)
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_FFI_memcmp, 0, 3, IS_LONG, 0)
ZEND_ARG_INFO(ZEND_SEND_PREFER_REF, ptr1)
ZEND_ARG_INFO(ZEND_SEND_PREFER_REF, ptr2)
ZEND_ARG_TYPE_INFO(0, size, IS_LONG, 0)
Expand Down

0 comments on commit ab4c597

Please sign in to comment.