Remove numerous hard coded 'result' variable name in generated c/c++ wrappers. The variable name is now defined in just one place, making it possible to change the name easily if a target language so wishes - see cwrap.c.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12830 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
d1dc016b68
commit
24133bacd7
29 changed files with 252 additions and 227 deletions
|
|
@ -882,10 +882,10 @@ public:
|
|||
Printv(actioncode, tab4, "gh_allow_ints();\n", NIL);
|
||||
|
||||
// Now have return value, figure out what to do with it.
|
||||
if ((tm = Swig_typemap_lookup_out("out", n, "result", f, actioncode))) {
|
||||
if ((tm = Swig_typemap_lookup_out("out", n, Swig_cresult_name(), f, actioncode))) {
|
||||
Replaceall(tm, "$result", "gswig_result");
|
||||
Replaceall(tm, "$target", "gswig_result");
|
||||
Replaceall(tm, "$source", "result");
|
||||
Replaceall(tm, "$source", Swig_cresult_name());
|
||||
if (GetFlag(n, "feature:new"))
|
||||
Replaceall(tm, "$owner", "1");
|
||||
else
|
||||
|
|
@ -922,14 +922,14 @@ public:
|
|||
// Look for any remaining cleanup
|
||||
|
||||
if (GetFlag(n, "feature:new")) {
|
||||
if ((tm = Swig_typemap_lookup("newfree", n, "result", 0))) {
|
||||
Replaceall(tm, "$source", "result");
|
||||
if ((tm = Swig_typemap_lookup("newfree", n, Swig_cresult_name(), 0))) {
|
||||
Replaceall(tm, "$source", Swig_cresult_name());
|
||||
Printv(f->code, tm, "\n", NIL);
|
||||
}
|
||||
}
|
||||
// Free any memory allocated by the function being wrapped..
|
||||
if ((tm = Swig_typemap_lookup("ret", n, "result", 0))) {
|
||||
Replaceall(tm, "$source", "result");
|
||||
if ((tm = Swig_typemap_lookup("ret", n, Swig_cresult_name(), 0))) {
|
||||
Replaceall(tm, "$source", Swig_cresult_name());
|
||||
Printv(f->code, tm, "\n", NIL);
|
||||
}
|
||||
// Wrap things up (in a manner of speaking)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue