[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Procedure with just data type but no parameter name
From: |
Gaius Mulley |
Subject: |
Re: Procedure with just data type but no parameter name |
Date: |
Mon, 30 Mar 2020 14:25:34 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) |
Hưng Hưng <address@hidden> writes:
> For example: PROCEDURE test(INTEGER, INTEGER): INTEGER;
>
> Does GM2 allow this? As I know it's allowed in C.
>
> e.g:
>
> typedef void (*IFiis)(int, int, char*); /* globalmotion_cb */
>
> typedef int(*IFniiiiiiC)(Ihandle*, int, int, int, int, int, int,
> struct _cdCanvas*); /* draw_cb */
>
> I think it map to PROCEDURE TYPE in GM2. I translated the header just
> follow the C declaration but I don't know GM2 would allow procedure
> without parameter names like that. If it is required to have parameter
> name it will be very troublesome for me. As I have to name parameters
> myself and I think it's no possible way other than do everything by
> hand, find and replace even with the help of regex will not be
> possible to do that.
>
> If it's a known limitation I think I would have to give up my
> translation job as so many C libraries use declaration like I
> mentioned above.
Hi,
I think there are two separate issue here:
the first:
PROCEDURE test(INTEGER, INTEGER): INTEGER;
the parameters to a procedure must have names.
the second:
> typedef void (*IFiis)(int, int, char*); /* globalmotion_cb */
is the procedure type which does not have parameter names.
TYPE
foo = PROCEDURE (INTEGER; INTEGER): INTEGER;