ast2 multiple array type block

This commit is contained in:
Ganesh Viswanathan 2020-04-05 23:55:44 -05:00
commit e911a9ee92
3 changed files with 100 additions and 49 deletions

View file

@ -27,7 +27,7 @@ struct A4 {
float f1;
};
typedef char *A9p[3]; //, A9[4];
typedef char *A9p[3], A9[4];
typedef char *A10[3][6];
typedef char *(*A11)[3];
typedef struct A0 *A111[12];
@ -113,6 +113,16 @@ void
(*pcre_free)(void *),
*(*pcre_stack_malloc)(size_t);
typedef int ImageView, MagickBooleanType;
typedef MagickBooleanType
(*DuplexTransferImageViewMethod)(const ImageView *,const ImageView *,
ImageView *,const size_t,const int,void *),
(*GetImageViewMethod)(const ImageView *,const size_t,const int,void *),
(*SetImageViewMethod)(ImageView *,const size_t,const int,void *),
(*TransferImageViewMethod)(const ImageView *,ImageView *,const size_t,
const int,void *),
(*UpdateImageViewMethod)(ImageView *,const size_t,const int,void *);
@ -145,12 +155,15 @@ struct A4 {
float f1;
};
typedef char *A9p[3]; //, A9[4];
typedef char *A9p[3], A9[4];
typedef char *A10[3][6];
typedef char *(*A11)[3];
typedef struct A1 *A111[12];
typedef struct A0 *A111[12];
typedef int **(*A12)(int, int b, int *c, int *, int *count[4], int (*func)(int, int));
typedef int
**(*A12)(int, int b, int *c, int *, int *count[4], int (*func)(int, int)),
**(*A121)(float, float b, float *c, float *, float *count[4], float (*func)(float, float)),
**(*A122)(char, char b, char *c, char *, char *count[4], char (*func)(char, char));
typedef int A13(int, int, void (*func)(void));
struct A14 { volatile char a1; };
@ -222,6 +235,22 @@ typedef enum VSPresetFormat {
//struct A2 test_proc1(struct A0 a);
// Proc vars
void
*(*pcre_malloc)(size_t),
(*pcre_free)(void *),
*(*pcre_stack_malloc)(size_t);
typedef MagickBooleanType
(*DuplexTransferImageViewMethod)(const ImageView *,const ImageView *,
ImageView *,const size_t,const int,void *),
(*GetImageViewMethod)(const ImageView *,const size_t,const int,void *),
(*SetImageViewMethod)(ImageView *,const size_t,const int,void *),
(*TransferImageViewMethod)(const ImageView *,ImageView *,const size_t,
const int,void *),
(*UpdateImageViewMethod)(ImageView *,const size_t,const int,void *);
#endif
#ifdef __cplusplus

View file

@ -165,10 +165,10 @@ var a9p: A9p
a9p[1] = nil
a9p[2] = "hello".cstring
#Not implemented yet
#assert A9 is array[4, cchar]
#checkPragmas(A9, pHeaderImp)
#var a9: A9
assert A9 is array[4, cchar]
checkPragmas(A9, pHeaderImp)
var a9: A9
a9[2] = 'c'
assert A10 is array[3, array[6, cstring]]
checkPragmas(A10, pHeaderImp)
@ -308,4 +308,20 @@ assert pcre_free is proc(a1: pointer) {.cdecl.}
checkPragmas(pcre_free, @["importc", "cdecl"] & pHeader)
assert pcre_stack_malloc is proc(a1: uint): pointer {.cdecl.}
checkPragmas(pcre_stack_malloc, @["importc", "cdecl"] & pHeader)
checkPragmas(pcre_stack_malloc, @["importc", "cdecl"] & pHeader)
assert DuplexTransferImageViewMethod is
proc (a1: ptr ImageView; a2: ptr ImageView; a3: ptr ImageView; a4: uint;
a5: cint; a6: pointer): MagickBooleanType {.cdecl.}
assert GetImageViewMethod is
proc (a1: ptr ImageView; a2: uint; a3: cint; a4: pointer): MagickBooleanType {.cdecl.}
assert SetImageViewMethod is
proc (a1: ptr ImageView; a2: uint; a3: cint; a4: pointer): MagickBooleanType {.cdecl.}
assert TransferImageViewMethod is
proc (a1: ptr ImageView; a2: ptr ImageView; a3: uint; a4: cint; a5: pointer): MagickBooleanType {.cdecl.}
assert UpdateImageViewMethod is
proc (a1: ptr ImageView; a2: uint; a3: cint; a4: pointer): MagickBooleanType {.cdecl.}