Re: Help with array maniipulation

2014-02-04 Thread bearophile
Ali Çehreli: Is that the C extension where the last array in a struct can have more elements than its size? That will be a problem in D. Since V.2.065 D supports well variable-length structs. You have to use ubyte[0] data, and then allocate a large enough memory for the whole variable-length

Re: Help with array maniipulation

2014-02-04 Thread ollie
On Tue, 04 Feb 2014 11:16:00 -0800, Ali Çehreli wrote: > Is that the C extension where the last array in a struct can have more > elements than its size? That will be a problem in D. yes it is. > int[] D_slice = C_array[0 .. C_array_number_of_elements]; Thank you, that gives me what I wa

Re: Help with array maniipulation

2014-02-04 Thread Ali Çehreli
On 02/04/2014 10:58 AM, ollie wrote: > I have a C Struct: [...] > uintdata_size; > ubyte[1]data; Is that the C extension where the last array in a struct can have more elements than its size? That will be a problem in D. > } > > libraw

Help with array maniipulation

2014-02-04 Thread ollie
I have a C Struct: typedef struct { enum LibRaw_image_formats type; ushort height, width, colors, bits; unsigned int data_size; unsigned char data[1]; }libraw_processed_image_t; with a D version