From 57ad898945008b2371cd9825bfa98180dfa4147f Mon Sep 17 00:00:00 2001 From: Greg Date: Wed, 1 May 2019 11:01:50 -0400 Subject: [PATCH] Bug fix: Process types before converting to go function parameter lists. --- types/convert.go | 2 +- wrap/main.go | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/types/convert.go b/types/convert.go index dc85fa9..620e2e6 100644 --- a/types/convert.go +++ b/types/convert.go @@ -217,7 +217,7 @@ func (t *Type) CTypeAttrib() string { func (t *Type) _CType(attrib bool) string { if t == nil { - fmt.Println("nil sent to _CType()") + //fmt.Println("nil sent to _CType()") return "" } //if !attrib && c.ctype != "" ... FIXME? diff --git a/wrap/main.go b/wrap/main.go index 0ad6995..15924f9 100644 --- a/wrap/main.go +++ b/wrap/main.go @@ -151,7 +151,8 @@ var goreserved map[string]bool = map[string]bool{ "range": true, } -func (m *Method) gpntp() ([]string,[]*types.Type,string) { +func (w *Wrapper) gpntp(m *Method) ([]string,[]*types.Type,string) { + w.processType(m.Type) ns := []string{} tps := []*types.Type{} if !m.ClassMethod { @@ -166,6 +167,7 @@ func (m *Method) gpntp() ([]string,[]*types.Type,string) { ns = append(ns,gname) tps = append(tps,p.Type) } + w.processTypes(tps) ret := []string{} i := 0 if !m.ClassMethod { i = 1 } @@ -488,9 +490,7 @@ func (w *Wrapper) _processMethod(m *Method,fun bool) { } cmtype := m.Type.CTypeAttrib() - ns,tps,gplist := m.gpntp() - w.processTypes(tps) - w.processType(m.Type) + ns,tps,gplist := w.gpntp(m) grtype := m.Type.GoType() if grtype == "Void" { grtype = ""