Skip to content

Commit

Permalink
Fix broken assertion; minor other fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
uuf6429 committed Feb 4, 2024
1 parent 85affa5 commit 46100f7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions src/FFI.php
Original file line number Diff line number Diff line change
Expand Up @@ -163,9 +163,9 @@ public static function version(): string
*/
public static function atLeast(int $x, int $y, int $z = 0): bool
{
return self::$library_major > $x ||
self::$library_major == $x && self::$library_minor > $y ||
self::$library_major == $x && self::$library_minor == $y && self::$library_micro >= $z;
return self::$library_major > $x
|| (self::$library_major === $x && self::$library_minor > $y)
|| (self::$library_major === $x && self::$library_minor === $y && self::$library_micro >= $z);
}

/**
Expand Down
8 changes: 4 additions & 4 deletions src/GObject.php
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ private static function getMarshaler(string $name, callable $callback): ?Closure
?CData $data
) use (&$callback): void {
assert($numberOfParams === 3);
/*
/**
* Signature: gint64(VipsSourceCustom* source, void* buffer, gint64 length, void* handle)
*/
$bufferLength = (int)FFI::gobject()->g_value_get_int64(\FFI::addr($params[2]));
Expand Down Expand Up @@ -180,7 +180,7 @@ private static function getMarshaler(string $name, callable $callback): ?Closure
?CData $data
) use (&$callback): void {
assert($numberOfParams === 3);
/*
/**
* Signature: gint64(VipsSourceCustom* source, gint64 offset, int whence, void* handle)
*/
$offset = (int)FFI::gobject()->g_value_get_int64(\FFI::addr($params[1]));
Expand All @@ -201,7 +201,7 @@ private static function getMarshaler(string $name, callable $callback): ?Closure
?CData $data
) use (&$callback): void {
assert($numberOfParams === 3);
/*
/**
* Signature: gint64(VipsTargetCustom* target, void* buffer, gint64 length, void* handle)
*/
$bufferPointer = FFI::gobject()->g_value_get_pointer(\FFI::addr($params[1]));
Expand All @@ -223,7 +223,7 @@ private static function getMarshaler(string $name, callable $callback): ?Closure
CData $hint,
?CData $data
) use (&$callback): void {
assert($numberOfParams === 0);
assert($numberOfParams === 1);
/**
* Signature: void(VipsTargetCustom* target, void* handle)
*/
Expand Down

0 comments on commit 46100f7

Please sign in to comment.