diff --git a/Lib/php/php.swg b/Lib/php/php.swg index 1c02d8f39..192782a5f 100644 --- a/Lib/php/php.swg +++ b/Lib/php/php.swg @@ -86,14 +86,10 @@ /* Object passed by value. Convert to a pointer */ %typemap(in) SWIGTYPE ($&1_ltype tmp) %{ - if ($needNewFlow) { - $1 = *(($1_ltype *)$obj_value); - } else { - if (SWIG_ConvertPtr(&$input, (void **) &tmp, $&1_descriptor, 0) < 0 || tmp == NULL) { - SWIG_PHP_Error(E_ERROR, "Type error in argument $argnum of $symname. Expected $&1_descriptor"); - } - $1 = *tmp; + if (SWIG_ConvertPtr(&$input, (void **) &tmp, $&1_descriptor, 0) < 0 || tmp == NULL) { + SWIG_PHP_Error(E_ERROR, "Type error in argument $argnum of $symname. Expected $&1_descriptor"); } + $1 = *tmp; %} %typemap(directorout) SWIGTYPE ($&1_ltype tmp) @@ -115,35 +111,23 @@ %typemap(in) SWIGTYPE *, SWIGTYPE [] %{ - if ($needNewFlow) { - $1 = ($1_ltype) $obj_value; - } else { - if (SWIG_ConvertPtr(&$input, (void **) &$1, $1_descriptor, 0) < 0) { - SWIG_PHP_Error(E_ERROR, "Type error in argument $argnum of $symname. Expected $1_descriptor"); - } + if (SWIG_ConvertPtr(&$input, (void **) &$1, $1_descriptor, 0) < 0) { + SWIG_PHP_Error(E_ERROR, "Type error in argument $argnum of $symname. Expected $1_descriptor"); } %} %typemap(in) SWIGTYPE &, SWIGTYPE && %{ - if ($needNewFlow) { - $1 = ($1_ltype) $obj_value; - } else { - if (SWIG_ConvertPtr(&$input, (void **) &$1, $1_descriptor, 0) < 0 || $1 == NULL) { - SWIG_PHP_Error(E_ERROR, "Type error in argument $argnum of $symname. Expected $1_descriptor"); - } + if (SWIG_ConvertPtr(&$input, (void **) &$1, $1_descriptor, 0) < 0 || $1 == NULL) { + SWIG_PHP_Error(E_ERROR, "Type error in argument $argnum of $symname. Expected $1_descriptor"); } %} %typemap(in) SWIGTYPE *const& ($*ltype temp) %{ - if ($needNewFlow) { - temp = ($*1_ltype) $obj_value; - } else { - if (SWIG_ConvertPtr(&$input, (void **) &temp, $*1_descriptor, 0) < 0) { - SWIG_PHP_Error(E_ERROR, "Type error in argument $argnum of $symname. Expected $*1_descriptor"); - } + if (SWIG_ConvertPtr(&$input, (void **) &temp, $*1_descriptor, 0) < 0) { + SWIG_PHP_Error(E_ERROR, "Type error in argument $argnum of $symname. Expected $*1_descriptor"); } $1 = ($1_ltype)&temp; %} diff --git a/Source/Modules/php.cxx b/Source/Modules/php.cxx index 957eb5143..c4e746a8b 100644 --- a/Source/Modules/php.cxx +++ b/Source/Modules/php.cxx @@ -1354,7 +1354,6 @@ public: String *paramType_class = NULL; bool paramType_valid = is_class(pt); - SwigType *resolved = SwigType_typedef_resolve_all(pt); if (paramType_valid) { paramType_class = get_class_name(pt); @@ -1365,15 +1364,9 @@ public: Replaceall(tm, "$source", source); Replaceall(tm, "$target", ln); Replaceall(tm, "$input", source); - if (paramType_valid) { - String *param_value = NewStringf("SWIG_Z_FETCH_OBJ_P(&%s)->ptr", source); - Replaceall(tm, "$obj_value", param_value); - Delete(param_value); - } Replaceall(tm, "$needNewFlow", paramType_valid ? (is_class_wrapped(paramType_class) ? "1" : "0") : "0"); String *temp_obj = NewStringEmpty(); Printf(temp_obj, "&%s", ln); - Replaceall(tm, "$obj_value", is_param_type_pointer(resolved ? resolved : pt) ? "NULL" : temp_obj); // Adding this to compile. It won't reach this if $obj_val is required. Setattr(p, "emit:input", source); Printf(f->code, "%s\n", tm); if (i == 0 && Getattr(p, "self")) {