From d062b4381aefe8bc71484c92ea3312d25aa6006e Mon Sep 17 00:00:00 2001 From: Olly Betts Date: Tue, 24 Jun 2008 00:41:07 +0000 Subject: [PATCH] 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 --- Source/Modules/php4.cxx | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) diff --git a/Source/Modules/php4.cxx b/Source/Modules/php4.cxx index ded77e3c4..42d71e79a 100644 --- a/Source/Modules/php4.cxx +++ b/Source/Modules/php4.cxx @@ -1194,7 +1194,7 @@ public: if (native_constructor == NATIVE_CONSTRUCTOR) { Printf(f->code, "add_property_zval(this_ptr,\"" SWIG_PTR "\",_cPtr);\n"); } else { - String *shadowrettype = SwigToPhpType(n, true); + String *shadowrettype = GetShadowReturnType(n); Printf(f->code, "object_init_ex(return_value,ptr_ce_swig_%s);\n", shadowrettype); Delete(shadowrettype); Printf(f->code, "add_property_zval(return_value,\"" SWIG_PTR "\",_cPtr);\n"); @@ -2559,20 +2559,9 @@ public: return SWIG_OK; } - - String * SwigToPhpType(Node *n, int shadow_flag) { - String *ptype = 0; + String * GetShadowReturnType(Node *n) { 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 */ switch (SwigType_type(t)) { case T_CHAR: @@ -2593,7 +2582,7 @@ public: case T_POINTER: case T_REFERENCE: case T_USER: - if (shadow_flag && is_shadow(t)) { + if (is_shadow(t)) { return NewString(Char(is_shadow(t))); } break; @@ -2601,7 +2590,7 @@ public: /* TODO */ break; 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; }