From 36219d31d8e7fc634bd1a3bbbb3f325f211bfbf3 Mon Sep 17 00:00:00 2001 From: Marcelo Matus Date: Fri, 29 Oct 2004 22:25:18 +0000 Subject: [PATCH] don't use in error messages, it can generate extra entries in the symbol table git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@6556 626c5289-ae23-0410-ae9c-e8d60b6d4f22 --- SWIG/Lib/python/pyinout.swg | 10 +++++----- SWIG/Lib/python/pyptrtypes.swg | 12 ++++++------ SWIG/Lib/python/pyswigtype.swg | 23 +++++++++++++---------- 3 files changed, 24 insertions(+), 21 deletions(-) diff --git a/SWIG/Lib/python/pyinout.swg b/SWIG/Lib/python/pyinout.swg index dd79b88f7..e0623487d 100644 --- a/SWIG/Lib/python/pyinout.swg +++ b/SWIG/Lib/python/pyinout.swg @@ -65,7 +65,7 @@ or you can use the %apply directive : res = SWIG_NEWOBJ; } if (!$1) { - SWIG_null_ref(SWIG_TypePrettyName($1_descriptor)); + SWIG_null_ref("$basetype"); } if (SWIG_arg_fail($argnum)) SWIG_fail; } @@ -79,10 +79,10 @@ or you can use the %apply directive : %typemap(in,fragment=asptr_frag) Type *INPUT(int res = 0) { res = asptr_meth($input, &$1); if (!res) { - SWIG_type_error(SWIG_TypePrettyName($1_descriptor), $input); + SWIG_type_error("$basetype", $input); } else { if (!$1) { - SWIG_null_ref(SWIG_TypePrettyName($1_descriptor)); + SWIG_null_ref("$basetype"); } } if (SWIG_arg_fail($argnum)) SWIG_fail; @@ -91,10 +91,10 @@ or you can use the %apply directive : %typemap(in,fragment=asptr_frag) Type &INPUT(int res = 0) { res = asptr_meth($input, &$1); if (!res) { - SWIG_type_error(SWIG_TypePrettyName($1_descriptor), $input); + SWIG_type_error("$basetype", $input); } else { if (!$1) { - SWIG_null_ref(SWIG_TypePrettyName($1_descriptor)); + SWIG_null_ref("$basetype"); } } if (SWIG_arg_fail($argnum)) SWIG_fail; diff --git a/SWIG/Lib/python/pyptrtypes.swg b/SWIG/Lib/python/pyptrtypes.swg index c918a84ca..c3106f6ae 100644 --- a/SWIG/Lib/python/pyptrtypes.swg +++ b/SWIG/Lib/python/pyptrtypes.swg @@ -11,9 +11,9 @@ int res = asptr_meth($input, &ptr); if (!res) { if (!PyErr_Occurred()) - SWIG_type_error(SWIG_TypePrettyName($&1_descriptor), $input); + SWIG_type_error("$basetype", $input); } else if (!ptr) { - SWIG_null_ref(SWIG_TypePrettyName($&1_descriptor)); + SWIG_null_ref("$basetype"); } if (SWIG_arg_fail($argnum)) SWIG_fail; $1 = *ptr; @@ -24,9 +24,9 @@ res = asptr_meth($input, &ptr); if (!res) { if (!PyErr_Occurred()) - SWIG_type_error(SWIG_TypePrettyName($1_descriptor), $input); + SWIG_type_error("$basetype", $input); } else if (!ptr) { - SWIG_null_ref(SWIG_TypePrettyName($1_descriptor)); + SWIG_null_ref("$basetype"); } if (SWIG_arg_fail($argnum)) SWIG_fail; $1 = ptr; @@ -44,11 +44,11 @@ int res = asptr_meth($input, &ptr); if (!res) { if (!PyErr_Occurred()) - SWIG_type_error(SWIG_TypePrettyName($1_descriptor), $input); + SWIG_type_error("$basetype", $input); SWIG_append_msg(" C/C++ variable '$name'"); return 1; } else if (!ptr) { - SWIG_null_ref(SWIG_TypePrettyName($1_descriptor)); + SWIG_null_ref("$basetype"); SWIG_append_msg(" C/C++ variable '$name'"); return 1; } diff --git a/SWIG/Lib/python/pyswigtype.swg b/SWIG/Lib/python/pyswigtype.swg index b3d741cfe..348347335 100644 --- a/SWIG/Lib/python/pyswigtype.swg +++ b/SWIG/Lib/python/pyswigtype.swg @@ -19,13 +19,15 @@ if (SWIG_arg_fail($argnum)) SWIG_fail;"; /* Additional check for null references */ -%typemap(in) SWIGTYPE & - "SWIG_Python_ConvertPtr($input, (void **)&$1, $descriptor, SWIG_POINTER_EXCEPTION | $disown); +%typemap(in) SWIGTYPE & { + SWIG_Python_ConvertPtr($input, (void **)&$1, $descriptor, SWIG_POINTER_EXCEPTION | $disown); if (SWIG_arg_fail($argnum)) SWIG_fail; if ($1 == NULL) { - SWIG_null_ref(SWIG_TypePrettyName($descriptor)); + SWIG_null_ref("$basetype"); } - if (SWIG_arg_fail($argnum)) SWIG_fail;"; + if (SWIG_arg_fail($argnum)) SWIG_fail; +} + /* Object passed by value. Convert to a pointer */ %typemap(in) SWIGTYPE { @@ -33,7 +35,7 @@ SWIG_Python_ConvertPtr($input, (void **)&argp, $&descriptor, SWIG_POINTER_EXCEPTION); if (SWIG_arg_fail($argnum)) SWIG_fail; if (argp == NULL) { - SWIG_null_ref(SWIG_TypePrettyName($&descriptor)); + SWIG_null_ref("$basetype"); } if (SWIG_arg_fail($argnum)) SWIG_fail; $1 = *argp; @@ -41,12 +43,13 @@ /* Pointer to a class member */ -%typemap(in) SWIGTYPE (CLASS::*) - "if ((SWIG_ConvertPacked($input,(void *)(&$1),sizeof($type),$descriptor,0)) == -1) { - SWIG_type_error(SWIG_TypePrettyName($descriptor),$input); +%typemap(in) SWIGTYPE (CLASS::*) { + if ((SWIG_ConvertPacked($input,(void *)(&$1),sizeof($type),$descriptor,0)) == -1) { + SWIG_type_error("$basetype",$input); } - if (SWIG_arg_fail($argnum)) SWIG_fail; - "; + if (SWIG_arg_fail($argnum)) SWIG_fail; +} + /* -----------------------------------------------------------------------------