-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix broken assertion; minor other fixes #233
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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])); | ||
|
@@ -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])); | ||
|
@@ -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])); | ||
|
@@ -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); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This was causing a test to fail. I saw that the other asserts checked the param count based on the commented signature - 1, so it looks like this one should have been 1. As to why it doesn't break in git actions, my guess is that they are running against an older version of libvips? (I noted the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Actually, that doesn't seem to be the case. A slightly older successful build used libvips 8.12: https://github.com/libvips/php-vips/actions/runs/7757736861/job/21160084456#step:4:121 Maybe PHP is running in production mode in the GitHub actions, which disables assertions? If that's the case, @jcupitt shouldn't we enable enable them? |
||
/** | ||
* Signature: void(VipsTargetCustom* target, void* handle) | ||
*/ | ||
|
@@ -242,7 +242,7 @@ private static function getMarshaler(string $name, callable $callback): ?Closure | |
CData $hint, | ||
?CData $data | ||
) use (&$callback): void { | ||
assert($numberOfParams === 0); | ||
assert($numberOfParams === 1); | ||
/** | ||
* Signature: int(VipsTargetCustom* target, void* handle) | ||
*/ | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this fixes (or breaks) anything, but at least it should be clearer now.