Fix Travis, tests for varargs

This commit is contained in:
Ganesh Viswanathan 2020-04-16 08:39:52 -05:00
commit 281d260912
3 changed files with 9 additions and 9 deletions

View file

@ -296,9 +296,9 @@ proc getVarargs*(node: TSNode): bool =
# ... is an unnamed node, second last node and ) is last node
let
nlen = node.tsNodeChildCount()
if nlen > 1:
if nlen > 1.uint32:
let
nval = node.tsNodeChild(nlen - 2).getName()
nval = node.tsNodeChild(nlen - 2.uint32).getName()
if nval == "...":
result = true

View file

@ -109,7 +109,7 @@ typedef enum VSPresetFormat {
// Proc vars
void
*(*pcre_malloc)(size_t),
*(*pcre_malloc)(size_t, ...),
(*pcre_free)(void *),
*(*pcre_stack_malloc)(size_t);
@ -144,7 +144,7 @@ struct ucArrType2 {
};
typedef struct fieldfuncfunc {
int *(*func1)(int f1, int *(*sfunc1)(int f1, int *(*ssfunc1)(int f1)));
int *(*func1)(int f1, int *(*sfunc1)(int f1, int *(*ssfunc1)(int f1, ...)));
};
int *func2(int f1, int *(*sfunc2)(int f1, int *(*ssfunc2)(int f1)));
@ -311,7 +311,7 @@ typedef enum VSPresetFormat {
// Proc vars
void
*(*pcre_malloc)(size_t),
*(*pcre_malloc)(size_t, ...),
(*pcre_free)(void *),
*(*pcre_stack_malloc)(size_t);
@ -336,7 +336,7 @@ void
int sqlite3_bind_blob(struct A1*, int, const void*, int n, void(*)(void*));
typedef struct fieldfuncfunc {
int *(*func1)(int f1, int *(*sfunc1)(int f1, int *(*ssfunc1)(int f1)));
int *(*func1)(int f1, int *(*sfunc1)(int f1, int *(*ssfunc1)(int f1, ...)));
};
int *func2(int f1, int *(*sfunc2)(int f1, int *(*ssfunc2)(int f1)));

View file

@ -302,8 +302,8 @@ assert pfYUV422P8 == pfYUV420P8 + 1
assert pfRGB27 == cmRGB.VSPresetFormat + 11
assert pfCompatYUY2 == pfCompatBGR32 + 1
assert pcre_malloc is proc(a1: uint): pointer {.cdecl.}
checkPragmas(pcre_malloc, @["importc", "cdecl"] & pHeader)
assert pcre_malloc is proc(a1: uint): pointer {.cdecl, varargs.}
checkPragmas(pcre_malloc, @["importc", "cdecl", "varargs"] & pHeader)
assert pcre_free is proc(a1: pointer) {.cdecl.}
checkPragmas(pcre_free, @["importc", "cdecl"] & pHeader)
@ -351,7 +351,7 @@ checkPragmas(ucArrType2, pHeaderBy, istype = false)
assert fieldfuncfunc is object
testFields(fieldfuncfunc,
"func1!proc (f1: cint; sfunc1: proc (f1: cint; ssfunc1: proc (f1: cint): ptr cint {.cdecl.}): ptr cint {.cdecl.}): ptr cint {.cdecl.}")
"func1!proc (f1: cint; sfunc1: proc (f1: cint; ssfunc1: proc (f1: cint): ptr cint {.cdecl, varargs.}): ptr cint {.cdecl.}): ptr cint {.cdecl.}")
assert func2 is proc (f1: cint; sfunc2: proc (f1: cint; ssfunc2: proc (f1: cint): ptr cint {.cdecl.}): ptr cint {.cdecl.}): ptr cint {.cdecl.}