Re: [fpc-pascal] NULL pointer to array of integer

2006-09-14 Thread Marc Santhoff
Am Mittwoch, den 13.09.2006, 14:13 +0200 schrieb Jonas Maebe: On 13 Sep 2006, at 10:04, Marc Santhoff wrote: (* hid_t H5Screate_simple(int rank, const hsize_t * dims, const hsize_t * maxdims ) -- h2pas -- Add an overloaded literal translation if you want to be able to pass nil:

Re: [fpc-pascal] NULL pointer to array of integer

2006-09-14 Thread Jonas Maebe
On 14 Sep 2006, at 10:50, Marc Santhoff wrote: function H5Screate_simple(rank:longint; dims: phsize_t; maxdims:phsize_t):hid_t;cdecl;external; Yes, this does actually work. :) When passing arrays, pass the address of the first element of the array. Still thinking about that, I don't

Re: [fpc-pascal] NULL pointer to array of integer

2006-09-14 Thread Marc Santhoff
Am Donnerstag, den 14.09.2006, 11:14 +0200 schrieb Jonas Maebe: On 14 Sep 2006, at 10:50, Marc Santhoff wrote: function H5Screate_simple(rank:longint; dims: phsize_t; maxdims:phsize_t):hid_t;cdecl;external; Yes, this does actually work. :) When passing arrays, pass the address of

[fpc-pascal] NULL pointer to array of integer

2006-09-13 Thread Marc Santhoff
Hi, while fiddling with some C'isms I've stumbled over a function in a library expecting an array of integers *or* a NULL pointer. How can I hand over any NIL or 0 or something equal to NULL in C that is accepted by fpc? Using NIL or 0 does not work certainly... In code: hsize_t = qword; (*

Re: [fpc-pascal] NULL pointer to array of integer

2006-09-13 Thread Eduardo
At 10:04 13/09/2006, you wrote: Hi, while fiddling with some C'isms I've stumbled over a function in a library expecting an array of integers *or* a NULL pointer. How can I hand over any NIL or 0 or something equal to NULL in C that is accepted by fpc? Using NIL or 0 does not work

Re: [fpc-pascal] NULL pointer to array of integer

2006-09-13 Thread Jonas Maebe
On 13 Sep 2006, at 10:04, Marc Santhoff wrote: (* hid_t H5Screate_simple(int rank, const hsize_t * dims, const hsize_t * maxdims ) -- h2pas -- Add an overloaded literal translation if you want to be able to pass nil: type phsize_t = ^hsize_t; function H5Screate_simple(rank:longint;

Re: [fpc-pascal] NULL pointer to array of integer

2006-09-13 Thread Marc Santhoff
Am Mittwoch, den 13.09.2006, 14:00 +0200 schrieb Eduardo: At 10:04 13/09/2006, you wrote: Hi, while fiddling with some C'isms I've stumbled over a function in a library expecting an array of integers *or* a NULL pointer. How can I hand over any NIL or 0 or something equal to NULL in C

Re: [fpc-pascal] NULL pointer to array of integer

2006-09-13 Thread Vinzent Höfler
Marc Santhoff wrote: Am Mittwoch, den 13.09.2006, 14:00 +0200 schrieb Eduardo: At 10:04 13/09/2006, you wrote: Hi, while fiddling with some C'isms I've stumbled over a function in a library expecting an array of integers *or* a NULL pointer. How can I hand over any NIL or 0 or something

Re: [fpc-pascal] NULL pointer to array of integer

2006-09-13 Thread Vinzent Höfler
Jonas Maebe wrote: On 13 Sep 2006, at 14:00, Eduardo wrote: I remember that on c a null pointer has value 0, but in ansi pascal it has value 23. The value of nil is not defined in the ISO Ansi Pascal standard. Neither it is in any official C standard. In FPC, nil = pointer(0) on all

Re: [fpc-pascal] NULL pointer to array of integer

2006-09-13 Thread Jonas Maebe
On 13 Sep 2006, at 19:39, Vinzent Höfler wrote: In FPC, nil = pointer(0) on all currently supported platforms, but in principle it could be anything. I'm making enemies now, Where? but: If the NIL pointer is represented by another value (like 0xF780 or such) on a given target

Re: [fpc-pascal] NULL pointer to array of integer

2006-09-13 Thread Vinzent Höfler
Jonas Maebe wrote: On 13 Sep 2006, at 19:39, Vinzent Höfler wrote: In FPC, nil = pointer(0) on all currently supported platforms, but in principle it could be anything. I'm making enemies now, Where? but: If the NIL pointer is represented by another value (like 0xF780 or such)

Re: [fpc-pascal] NULL pointer to array of integer

2006-09-13 Thread Eduardo
At 18:37 13/09/2006, you wrote: On 13 Sep 2006, at 14:00, Eduardo wrote: I remember that on c a null pointer has value 0, but in ansi pascal it has value 23. The value of nil is not defined in the ISO Ansi Pascal standard. In FPC, nil = pointer(0) on all currently supported platforms, but