Clean up dead and unused code in SwigToPhpType(), and rename to
GetShadowReturnType(). git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@10567 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
5ea3e69bef
commit
d062b4381a
1 changed files with 4 additions and 15 deletions
|
|
@ -1194,7 +1194,7 @@ public:
|
||||||
if (native_constructor == NATIVE_CONSTRUCTOR) {
|
if (native_constructor == NATIVE_CONSTRUCTOR) {
|
||||||
Printf(f->code, "add_property_zval(this_ptr,\"" SWIG_PTR "\",_cPtr);\n");
|
Printf(f->code, "add_property_zval(this_ptr,\"" SWIG_PTR "\",_cPtr);\n");
|
||||||
} else {
|
} else {
|
||||||
String *shadowrettype = SwigToPhpType(n, true);
|
String *shadowrettype = GetShadowReturnType(n);
|
||||||
Printf(f->code, "object_init_ex(return_value,ptr_ce_swig_%s);\n", shadowrettype);
|
Printf(f->code, "object_init_ex(return_value,ptr_ce_swig_%s);\n", shadowrettype);
|
||||||
Delete(shadowrettype);
|
Delete(shadowrettype);
|
||||||
Printf(f->code, "add_property_zval(return_value,\"" SWIG_PTR "\",_cPtr);\n");
|
Printf(f->code, "add_property_zval(return_value,\"" SWIG_PTR "\",_cPtr);\n");
|
||||||
|
|
@ -2559,20 +2559,9 @@ public:
|
||||||
return SWIG_OK;
|
return SWIG_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
String * GetShadowReturnType(Node *n) {
|
||||||
String * SwigToPhpType(Node *n, int shadow_flag) {
|
|
||||||
String *ptype = 0;
|
|
||||||
SwigType *t = Getattr(n, "type");
|
SwigType *t = Getattr(n, "type");
|
||||||
|
|
||||||
if (shadow_flag) {
|
|
||||||
ptype = PhpTypeFromTypemap((char *) "pstype", n, (char *) "");
|
|
||||||
}
|
|
||||||
if (!ptype) {
|
|
||||||
ptype = PhpTypeFromTypemap((char *) "ptype", n, (char *) "");
|
|
||||||
}
|
|
||||||
|
|
||||||
if (ptype) return ptype;
|
|
||||||
|
|
||||||
/* Map type here */
|
/* Map type here */
|
||||||
switch (SwigType_type(t)) {
|
switch (SwigType_type(t)) {
|
||||||
case T_CHAR:
|
case T_CHAR:
|
||||||
|
|
@ -2593,7 +2582,7 @@ public:
|
||||||
case T_POINTER:
|
case T_POINTER:
|
||||||
case T_REFERENCE:
|
case T_REFERENCE:
|
||||||
case T_USER:
|
case T_USER:
|
||||||
if (shadow_flag && is_shadow(t)) {
|
if (is_shadow(t)) {
|
||||||
return NewString(Char(is_shadow(t)));
|
return NewString(Char(is_shadow(t)));
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
@ -2601,7 +2590,7 @@ public:
|
||||||
/* TODO */
|
/* TODO */
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
Printf(stderr, "SwigToPhpType: unhandled data type: %s\n", SwigType_str(t, 0));
|
Printf(stderr, "GetShadowReturnType: unhandled data type: %s\n", SwigType_str(t, 0));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue