Tweak Perl's director method's $result variable generation.
Use same code as other languages - no real change in output.
This commit is contained in:
parent
717b7866d4
commit
589b7237e9
1 changed files with 17 additions and 18 deletions
|
|
@ -2138,27 +2138,26 @@ public:
|
|||
* if the return value is a reference or const reference, a specialized typemap must
|
||||
* handle it, including declaration of c_result ($result).
|
||||
*/
|
||||
if (!is_void) {
|
||||
if (!ignored_method || pure_virtual) {
|
||||
if (!SwigType_isclass(returntype)) {
|
||||
if (!(SwigType_ispointer(returntype) || SwigType_isreference(returntype))) {
|
||||
String *construct_result = NewStringf("= SwigValueInit< %s >()", SwigType_lstr(returntype, 0));
|
||||
Wrapper_add_localv(w, "c_result", SwigType_lstr(returntype, "c_result"), construct_result, NIL);
|
||||
Delete(construct_result);
|
||||
} else {
|
||||
Wrapper_add_localv(w, "c_result", SwigType_lstr(returntype, "c_result"), "= 0", NIL);
|
||||
}
|
||||
if (!is_void && (!ignored_method || pure_virtual)) {
|
||||
if (!SwigType_isclass(returntype)) {
|
||||
if (!(SwigType_ispointer(returntype) || SwigType_isreference(returntype))) {
|
||||
String *construct_result = NewStringf("= SwigValueInit< %s >()", SwigType_lstr(returntype, 0));
|
||||
Wrapper_add_localv(w, "c_result", SwigType_lstr(returntype, "c_result"), construct_result, NIL);
|
||||
Delete(construct_result);
|
||||
} else {
|
||||
String *cres = SwigType_lstr(returntype, "c_result");
|
||||
Printf(w->code, "%s;\n", cres);
|
||||
Delete(cres);
|
||||
Wrapper_add_localv(w, "c_result", SwigType_lstr(returntype, "c_result"), "= 0", NIL);
|
||||
}
|
||||
} else {
|
||||
String *cres = SwigType_lstr(returntype, "c_result");
|
||||
Printf(w->code, "%s;\n", cres);
|
||||
Delete(cres);
|
||||
}
|
||||
if (!ignored_method) {
|
||||
String *pres = NewStringf("SV *%s", Swig_cresult_name());
|
||||
Wrapper_add_local(w, Swig_cresult_name(), pres);
|
||||
Delete(pres);
|
||||
}
|
||||
}
|
||||
|
||||
if (!is_void && !ignored_method) {
|
||||
String *pres = NewStringf("SV *%s", Swig_cresult_name());
|
||||
Wrapper_add_local(w, Swig_cresult_name(), pres);
|
||||
Delete(pres);
|
||||
}
|
||||
|
||||
if (ignored_method) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue