summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Lance Taylor <iant@golang.org>2015-03-16 11:45:15 -0700
committerIan Lance Taylor <iant@golang.org>2015-03-16 11:45:15 -0700
commitbaf1fe036a56e6a9637406763b75a280330d1061 (patch)
treed5ace03c4fed43ef5fd8e4d8e0489e4c362678ff
parentab677205d87aa39a1506a543e595cd848382c6b6 (diff)
downloadswig-baf1fe036a56e6a9637406763b75a280330d1061.tar.gz
[Go] Correct goargout typemap when matching multiple parameters.
-rw-r--r--Source/Modules/go.cxx17
1 files changed, 8 insertions, 9 deletions
diff --git a/Source/Modules/go.cxx b/Source/Modules/go.cxx
index 4ec5dae62..087a71999 100644
--- a/Source/Modules/go.cxx
+++ b/Source/Modules/go.cxx
@@ -1353,7 +1353,7 @@ private:
Delete(ret_type);
}
- goargout(info->parms, parm_count);
+ goargout(info->parms);
if (SwigType_type(info->result) != T_VOID) {
String *goout = goTypemapLookup("goout", info->n, "swig_r");
@@ -1945,7 +1945,7 @@ private:
Printv(f_go_wrappers, call, NULL);
Delete(call);
- goargout(parms, parm_count);
+ goargout(parms);
if (need_return_var) {
if (goout == NULL) {
@@ -2487,18 +2487,17 @@ private:
* property with the name to use to refer to that parameter.
* ----------------------------------------------------------------------- */
- void goargout(ParmList *parms, int parm_count) {
+ void goargout(ParmList *parms) {
Parm *p = parms;
- for (int i = 0; i < parm_count; ++i) {
- p = getParm(p);
- String *tm = goGetattr(p, "tmap:goargout");
+ while (p) {
+ String *tm = Getattr(p, "tmap:goargout");
if (!tm) {
p = nextSibling(p);
} else {
tm = Copy(tm);
Replaceall(tm, "$result", "swig_r");
Replaceall(tm, "$input", Getattr(p, "emit:goinput"));
- Printv(f_go_wrappers, tm, NULL);
+ Printv(f_go_wrappers, tm, "\n", NULL);
Delete(tm);
p = Getattr(p, "tmap:goargout:next");
}
@@ -4456,7 +4455,7 @@ private:
Printv(f_go_wrappers, "\tswig_r = *(*", ret_type, ")(unsafe.Pointer(&swig_r_p))\n", NULL);
}
- goargout(parms, parm_count);
+ goargout(parms);
if (SwigType_type(result) != T_VOID) {
if (goout == NULL) {
@@ -4758,7 +4757,7 @@ private:
Printv(f_go_wrappers, "\tswig_r = *(*", ret_type, ")(unsafe.Pointer(&swig_r_p))\n", NULL);
}
- goargout(parms, parm_count);
+ goargout(parms);
if (SwigType_type(result) != T_VOID) {
if (goout == NULL) {