From 859264ab94daa50c35503f26e840f51e70924130 Mon Sep 17 00:00:00 2001 From: William S Fulton Date: Mon, 5 Sep 2022 08:23:58 +0100 Subject: [PATCH] Remove unnecessary const SWIGTYPE & typemap This is a duplicate of SWIGTYPE & and the typemap rules result in SWIGTYPE & being used if there is no const SWIGTYPE & tyemap. --- Lib/typemaps/swigtype.swg | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/Lib/typemaps/swigtype.swg b/Lib/typemaps/swigtype.swg index 65f558a27..e89e94b0b 100644 --- a/Lib/typemaps/swigtype.swg +++ b/Lib/typemaps/swigtype.swg @@ -56,15 +56,6 @@ { if (SWIG_IsNewObj(res$argnum)) %delete($1); } -#else -%typemap(in,noblock=1) const SWIGTYPE & (void *argp, int res = 0) { - res = SWIG_ConvertPtr($input, &argp, $descriptor, %convertptr_flags); - if (!SWIG_IsOK(res)) { - %argument_fail(res, "$type", $symname, $argnum); - } - if (!argp) { %argument_nullref("$type", $symname, $argnum); } - $1 = %reinterpret_cast(argp, $ltype); -} #endif /* Rvalue reference */ @@ -400,6 +391,7 @@ int res = SWIG_ConvertPtr($input, &vptr, $descriptor, SWIG_POINTER_NO_NULL); $1 = SWIG_CheckState(res); } + %typemap(typecheck,precedence=SWIG_TYPECHECK_POINTER,noblock=1) const SWIGTYPE && { void *vptr = 0; int res = SWIG_ConvertPtr($input, &vptr, $descriptor, SWIG_POINTER_NO_NULL);