Re: Fixed Length Array Syntax in extern(C) Function Signatures

2015-07-10 Thread Nordlöw
On Friday, 10 July 2015 at 03:18:23 UTC, Mike Parker wrote: You should just be able to replace `[4]` with `*` in the arguments. [1]http://dlang.org/interfaceToC.html Great! One more thing: How shall my call to `avg_image_copy()` (from D) look then? Is the slicing syntax `[0 .. 4]` I use

Re: Fixed Length Array Syntax in extern(C) Function Signatures

2015-07-10 Thread via Digitalmars-d-learn
On Friday, 10 July 2015 at 03:18:23 UTC, Mike Parker wrote: [1]http://dlang.org/interfaceToC.html Is there any tool out there that automatically creates D wrappers from C headers`?

Re: Fixed Length Array Syntax in extern(C) Function Signatures

2015-07-10 Thread Andrea Fontana via Digitalmars-d-learn
On Friday, 10 July 2015 at 08:42:06 UTC, Per Nordlöw wrote: On Friday, 10 July 2015 at 03:18:23 UTC, Mike Parker wrote: [1]http://dlang.org/interfaceToC.html Is there any tool out there that automatically creates D wrappers from C headers`? https://github.com/jacob-carlborg/dstep ?

Re: Fixed Length Array Syntax in extern(C) Function Signatures

2015-07-10 Thread via Digitalmars-d-learn
On Friday, 10 July 2015 at 08:54:57 UTC, Andrea Fontana wrote: Is there any tool out there that automatically creates D wrappers from C headers`? https://github.com/jacob-carlborg/dstep ? Great! I'll try that!

Fixed Length Array Syntax in extern(C) Function Signatures

2015-07-09 Thread Nordlöw
Given extern(C): struct AVFrame { uint8_t*[AV_NUM_DATA_POINTERS] data; int[AV_NUM_DATA_POINTERS] linesize; int width, height; ... } void av_image_copy(ubyte *[4] dst_data, int[4] dst_linesizes, const ubyte *[4]

Re: Fixed Length Array Syntax in extern(C) Function Signatures

2015-07-09 Thread Nordlöw
On Thursday, 9 July 2015 at 15:19:41 UTC, Nordlöw wrote: uint8_t*[AV_NUM_DATA_POINTERS] data; int[AV_NUM_DATA_POINTERS] linesize; Forgot enum AV_NUM_DATA_POINTERS = 8;

Re: Fixed Length Array Syntax in extern(C) Function Signatures

2015-07-09 Thread Timon Gehr via Digitalmars-d-learn
On 07/09/2015 05:19 PM, Nordlöw wrote: Given extern(C): struct AVFrame { uint8_t*[AV_NUM_DATA_POINTERS] data; int[AV_NUM_DATA_POINTERS] linesize; int width, height; ... } void av_image_copy(ubyte *[4] dst_data, int[4] dst_linesizes,

Re: Fixed Length Array Syntax in extern(C) Function Signatures

2015-07-09 Thread via Digitalmars-d-learn
On Thursday, 9 July 2015 at 16:12:27 UTC, Timon Gehr wrote: No. You'll need explicit pass by reference on the D side. So, how should I modify my call to `image_copy` with respect to the four first parameters?

Re: Fixed Length Array Syntax in extern(C) Function Signatures

2015-07-09 Thread Alex Parrill via Digitalmars-d-learn
On Thursday, 9 July 2015 at 17:11:36 UTC, Per Nordlöw wrote: On Thursday, 9 July 2015 at 16:12:27 UTC, Timon Gehr wrote: No. You'll need explicit pass by reference on the D side. So, how should I modify my call to `image_copy` with respect to the four first parameters? In C, array

Re: Fixed Length Array Syntax in extern(C) Function Signatures

2015-07-09 Thread Mike Parker via Digitalmars-d-learn
On Thursday, 9 July 2015 at 17:42:33 UTC, Alex Parrill wrote: On Thursday, 9 July 2015 at 17:11:36 UTC, Per Nordlöw wrote: On Thursday, 9 July 2015 at 16:12:27 UTC, Timon Gehr wrote: No. You'll need explicit pass by reference on the D side. So, how should I modify my call to `image_copy`