Great! Thank you

On Saturday, August 8, 2015 at 1:13:52 PM UTC-7, Yichao Yu wrote:
>
> On Sat, Aug 8, 2015 at 4:08 PM, Tim Wheeler <[email protected] 
> <javascript:>> wrote: 
> > Hello Julia Users, 
> > 
> > I have been using Julia's `ccall` interface and was wondering how to 
> handle 
> > C structs containing fixed-length arrays: 
> > 
> > typedef struct 
> > { 
> >     uint8 x; // this is fine 
> >     uint8 y[2]; // this will cause issues 
> > } MY_STRUCT; 
> > 
> > 
> > My current conversion is: 
> > 
> > type MY_STRUCT 
> >     x::Uint8 // this is fine 
> >     y::(Uint8,Uint8) // this will cause issues 
> > end 
>
> This works on 0.4 (after replacing the old tuple type syntax with the 
> new one Tuple{UInt8,UInt8} or even better, NTuple{2,UInt8}) 
>
> > 
> > I can create `read` and `write` functions but also have to overwrite 
> > `sizeof` because the tuple appears to be stored as a pointer instead of 
> > being stored `flat`. 
> > Is there a better suggestion for how to store a fixed-length array? 
> > 
> > Thanks! 
> > 
>

Reply via email to