[Ecls-list] FFI paradigms (was Re: ECL 10.2.1 RC)
Matthew Mondor
mm_lists at pulsar-zone.net
Tue Feb 16 02:16:44 UTC 2010
On Sat, 13 Feb 2010 16:13:52 -0500
Matthew Mondor <mm_lists at pulsar-zone.net> wrote:
> On Sat, 13 Feb 2010 15:40:37 +0100
> Juan Jose Garcia-Ripoll <juanjose.garciaripoll at googlemail.com> wrote:
>
> > A test case would be nice. I did not investigate this further because of the
> > lack of information -- and also because I tend to forget problems unless
> > reminded frequently :-) It may well be that ECL does not have enough
> > information about alignment in structures and is thus wrongly identifying
> > the location of a slot value.
With the following patch from Alexander Gavrilov he posted on this list
earlier, the behaviour of get-slot-value/get-slot-pointer seems less
erroneous indeed :)
I no longer saw values too large to belong to the expected types,
although interestingly I did get 0 values from a few slots where I
expected there would be values.
His patch re-aligns an object.h enum with the ffi.d types array:
===
--- a/src/h/object.h
+++ b/src/h/object.h
@@ -747,6 +747,10 @@ enum ecl_ffi_tag {
ECL_FFI_UNSIGNED_INT,
ECL_FFI_LONG,
ECL_FFI_UNSIGNED_LONG,
+#ifdef ecl_uint8_t
+ ECL_FFI_INT8_T,
+ ECL_FFI_UINT8_T,
+#endif
#ifdef ecl_uint16_t
ECL_FFI_INT16_T,
ECL_FFI_UINT16_T,
Rationale: The enum contents must match the tables in ffi.d, or bad things happen.
===
Thanks,
--
Matt
More information about the ecl-devel
mailing list