<div dir="ltr"><div dir="ltr"><div class="gmail_default" style="font-size:small">Hi,</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Sep 6, 2021 at 11:58 PM Michał Olszewski <<a href="mailto:m.olszewski@nexat.pl">m.olszewski@nexat.pl</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex">Hello,<br>
<br>
I'm currently working on bindings to vector graphics engine library and, <br>
to avoid creating redundant classes, I pass float arrays (Float64Array) <br>
to functions expecting a struct (the parameter is declared as <br>
void*/double*. Its not like C cares whether its an array of constant <br>
size or a struct).<br>
<br>
However, I'm unable to do this because the call results in "could not <br>
coerce the arguments" error.<br>
<br>
I performed a small test, by using #adoptInstance (damn, love how I can <br>
fiddle with guts of the system, so cool) on Float64Array object to turn <br>
it into ByteArray and... it actually works.<br>
<br>
Am I doing something wrong or it's just that the FFI doesn't support <br>
passing RawBitsArray subclasses (besides ByteArray) yet?<br>
<br>
PS. I'm using Squeak 6.0 20623<br></blockquote><div><br></div><div class="gmail_default" style="font-size:small">see VMMaker.oscog-eem.3068/opensmalltalk-vm commit ae0c1a6b473aa5ed05433d91a3257804aa1ddd90</div><div class="gmail_quote"><br></div>Author: Eliot Miranda <<a href="mailto:eliot.miranda@gmail.com">eliot.miranda@gmail.com</a>><br>Date:   Sat Sep 11 16:19:04 2021 -0700<br><br>    CogVM source as per VMMaker.oscog-eem.3068<br><br>    ThreadedFFIPlugin:<br>    pass any kind of non-pointer object to non-byte */char * args.<br><div class="gmail_default" style="font-size:small">    We could insist on void *, but let's see how we get on with this.</div></div><br clear="all"><div><div class="gmail_default" style="font-size:small">This should fix the issue.  So pick up a new VM from a Ci near you once the crank has turned.</div><div class="gmail_default" style="font-size:small"><br></div></div><div dir="ltr" class="gmail_signature"><div dir="ltr"><div><span style="font-size:small;border-collapse:separate"><div>_,,,^..^,,,_<br></div><div>best, Eliot</div></span></div></div></div></div>