From a060d7b206e7c3b359e20b61f610af73b5471304 Mon Sep 17 00:00:00 2001 From: Stefan Salewski Date: Mon, 18 Sep 2017 19:44:48 +0200 Subject: [PATCH] fixed default nil for object parameter --- tests/gen.nim | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/gen.nim b/tests/gen.nim index 5b05d0b..778b60d 100644 --- a/tests/gen.nim +++ b/tests/gen.nim @@ -431,7 +431,10 @@ proc genP(info: GICallableInfo; genProxy = false; binfo: GIBaseInfo = nil): (str # ------------------ if isFunctionInfo(info) and (gFunctionInfoGetFlags(info).int and GIFunctionInfoFlags.WRAPS_VFUNC.ord) == 0: if userAlloc and mayBeNil: - str.add(" | ptr " & str & " = nil") + #str.add(" | ptr " & str & " = nil") + var h = str + if h.startsWith("var "): h = h[4 .. ^1] + str.add(" = cast[ptr " & h & "](nil)[]") # ------------------ if (sym.startsWith("gdk_events_get_") or sym.startsWith("gdk_event_get_")) and str == "Event":