[squeak-dev] FFI problem: "could not coerce arguments"

Mariano Martinez Peck marianopeck at gmail.com
Mon May 26 13:44:16 UTC 2008


On Mon, May 26, 2008 at 10:36 AM, Bert Freudenberg <bert at freudenbergs.de>
wrote:

>
> On 26.05.2008, at 15:21, Mariano Martinez Peck wrote:
>
>  "could not coerce arguments"
>> int odbx_set_option(
>>    odbx_t* handle,
>>    unsigned int option,
>>    void* value )
>> apiSetOption: handle option: anOption value: aValue
>>    "int odbx_unbind(odbx_t*)"
>>    <cdecl: long 'odbx_set_option' (ulong ulong void*) module: 'opendbx' >
>>    ^self externalCallFailed
>>
>> err := OpenDBX apiSetOption: self option:32  value:1.
>>
>
>
> The first argument appears to be a pointer to a handle object. You probably
> should not declare that as ulong if you then pass "self" (which I assume is
> a ExternalStructure subclass). But that depends on how you acquire the
> handle, and how you represent it in the image.
>

Yes you are right, sorry. It was not self, but a attribute called handle. My
mistake.


>
> The argument to void* should be a ByteArray or WordArray, methinks, I'd try
> "WordArray with: 1" if you want to pass a pointer to the Integer 1.
>
> - Bert -
>

Sounds interesting. I will test it and then I tell you.

Thanks,

Mariano
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20080526/69ef8d8b/attachment.htm


More information about the Squeak-dev mailing list