From 8e340c158c41ee053fd2be2f30b47e9a060515c9 Mon Sep 17 00:00:00 2001 From: Michel Zou Date: Fri, 22 Feb 2013 10:11:50 +0100 Subject: Fixed #1300 clang warning in SWIG_Python_ConvertPtrAndOwn. --- Lib/swigrun.swg | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'Lib/swigrun.swg') diff --git a/Lib/swigrun.swg b/Lib/swigrun.swg index e5afb62c4..3f68d66d6 100644 --- a/Lib/swigrun.swg +++ b/Lib/swigrun.swg @@ -161,13 +161,20 @@ # endif # define SWIG_CASTRANKMASK ((SWIG_CASTRANKLIMIT) -1) # define SWIG_CastRank(r) (r & SWIG_CASTRANKMASK) -SWIGINTERNINLINE int SWIG_AddCast(int r) { - return SWIG_IsOK(r) ? ((SWIG_CastRank(r) < SWIG_MAXCASTRANK) ? (r + 1) : SWIG_ERROR) : r; +SWIGINTERNINLINE int SWIG_AddCastInplace(int *r) { + if (SWIG_IsOK(*r)) { + *r = (SWIG_CastRank(*r) < SWIG_MAXCASTRANK) ? (*r + 1) : SWIG_ERROR; + } +} +SWIGINTERNINLINE int SWIG_AddCast(int r) { + SWIG_AddCastInplace(&r); + return r; } SWIGINTERNINLINE int SWIG_CheckState(int r) { return SWIG_IsOK(r) ? SWIG_CastRank(r) + 1 : 0; } #else /* no cast-rank mode */ +# define SWIG_AddCastInplace(r) # define SWIG_AddCast # define SWIG_CheckState(r) (SWIG_IsOK(r) ? 1 : 0) #endif -- cgit v1.2.1