[Ecls-list] FFI type mismatch for integer

Juan Jose Garcia Ripoll jlr at mpq.mpg.de
Fri Jun 3 06:03:04 UTC 2005


Goffioul Michael wrote:

>I got a problem while playing with FFI and integer types (I'm actually trying
>to build a FFI interface for Win32 GUI API). The problem is that conversion
>between C and LISP is not invertable:
>	C -> LISP : make_integer, which can produce bignums
>	LISP -> C : object_to_fixnum, which can not handle bignums (the ones produced
>			by make_integer)
>I think there should be a "object_to_integer"  function.
>  
>
Yes, I am not happy with the current set of functions. fixnnint() and 
fixint() are the functions you were looking for, and they should be 
renamed to something like ecl_object2long and ecl_object2ulong, to be 
consistent. and also because they internally use "longs".

>Another point is that FFI doesn't seem to conserve signness of integers as "make_integer" is used whether you defined the object type as :int or :unsigned-int.
>
Maybe also complementary functions ecl_long2object and ecl_ulong2object?

Regards,

Juanjo
-------------- next part --------------
A non-text attachment was scrubbed...
Name: jlr.vcf
Type: text/x-vcard
Size: 389 bytes
Desc: not available
URL: <https://mailman.common-lisp.net/pipermail/ecl-devel/attachments/20050603/cc47a6fc/attachment.vcf>


More information about the ecl-devel mailing list