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
This commit is contained in:
Marcelo Matus 2004-10-29 22:25:18 +00:00
commit 36219d31d8
3 changed files with 24 additions and 21 deletions

View file

@ -65,7 +65,7 @@ or you can use the %apply directive :
res = SWIG_NEWOBJ; res = SWIG_NEWOBJ;
} }
if (!$1) { if (!$1) {
SWIG_null_ref(SWIG_TypePrettyName($1_descriptor)); SWIG_null_ref("$basetype");
} }
if (SWIG_arg_fail($argnum)) SWIG_fail; 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) { %typemap(in,fragment=asptr_frag) Type *INPUT(int res = 0) {
res = asptr_meth($input, &$1); res = asptr_meth($input, &$1);
if (!res) { if (!res) {
SWIG_type_error(SWIG_TypePrettyName($1_descriptor), $input); SWIG_type_error("$basetype", $input);
} else { } else {
if (!$1) { if (!$1) {
SWIG_null_ref(SWIG_TypePrettyName($1_descriptor)); SWIG_null_ref("$basetype");
} }
} }
if (SWIG_arg_fail($argnum)) SWIG_fail; 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) { %typemap(in,fragment=asptr_frag) Type &INPUT(int res = 0) {
res = asptr_meth($input, &$1); res = asptr_meth($input, &$1);
if (!res) { if (!res) {
SWIG_type_error(SWIG_TypePrettyName($1_descriptor), $input); SWIG_type_error("$basetype", $input);
} else { } else {
if (!$1) { if (!$1) {
SWIG_null_ref(SWIG_TypePrettyName($1_descriptor)); SWIG_null_ref("$basetype");
} }
} }
if (SWIG_arg_fail($argnum)) SWIG_fail; if (SWIG_arg_fail($argnum)) SWIG_fail;

View file

@ -11,9 +11,9 @@
int res = asptr_meth($input, &ptr); int res = asptr_meth($input, &ptr);
if (!res) { if (!res) {
if (!PyErr_Occurred()) if (!PyErr_Occurred())
SWIG_type_error(SWIG_TypePrettyName($&1_descriptor), $input); SWIG_type_error("$basetype", $input);
} else if (!ptr) { } else if (!ptr) {
SWIG_null_ref(SWIG_TypePrettyName($&1_descriptor)); SWIG_null_ref("$basetype");
} }
if (SWIG_arg_fail($argnum)) SWIG_fail; if (SWIG_arg_fail($argnum)) SWIG_fail;
$1 = *ptr; $1 = *ptr;
@ -24,9 +24,9 @@
res = asptr_meth($input, &ptr); res = asptr_meth($input, &ptr);
if (!res) { if (!res) {
if (!PyErr_Occurred()) if (!PyErr_Occurred())
SWIG_type_error(SWIG_TypePrettyName($1_descriptor), $input); SWIG_type_error("$basetype", $input);
} else if (!ptr) { } else if (!ptr) {
SWIG_null_ref(SWIG_TypePrettyName($1_descriptor)); SWIG_null_ref("$basetype");
} }
if (SWIG_arg_fail($argnum)) SWIG_fail; if (SWIG_arg_fail($argnum)) SWIG_fail;
$1 = ptr; $1 = ptr;
@ -44,11 +44,11 @@
int res = asptr_meth($input, &ptr); int res = asptr_meth($input, &ptr);
if (!res) { if (!res) {
if (!PyErr_Occurred()) if (!PyErr_Occurred())
SWIG_type_error(SWIG_TypePrettyName($1_descriptor), $input); SWIG_type_error("$basetype", $input);
SWIG_append_msg(" C/C++ variable '$name'"); SWIG_append_msg(" C/C++ variable '$name'");
return 1; return 1;
} else if (!ptr) { } else if (!ptr) {
SWIG_null_ref(SWIG_TypePrettyName($1_descriptor)); SWIG_null_ref("$basetype");
SWIG_append_msg(" C/C++ variable '$name'"); SWIG_append_msg(" C/C++ variable '$name'");
return 1; return 1;
} }

View file

@ -19,13 +19,15 @@
if (SWIG_arg_fail($argnum)) SWIG_fail;"; if (SWIG_arg_fail($argnum)) SWIG_fail;";
/* Additional check for null references */ /* Additional check for null references */
%typemap(in) SWIGTYPE & %typemap(in) SWIGTYPE & {
"SWIG_Python_ConvertPtr($input, (void **)&$1, $descriptor, SWIG_POINTER_EXCEPTION | $disown); SWIG_Python_ConvertPtr($input, (void **)&$1, $descriptor, SWIG_POINTER_EXCEPTION | $disown);
if (SWIG_arg_fail($argnum)) SWIG_fail; if (SWIG_arg_fail($argnum)) SWIG_fail;
if ($1 == NULL) { 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 */ /* Object passed by value. Convert to a pointer */
%typemap(in) SWIGTYPE { %typemap(in) SWIGTYPE {
@ -33,7 +35,7 @@
SWIG_Python_ConvertPtr($input, (void **)&argp, $&descriptor, SWIG_POINTER_EXCEPTION); SWIG_Python_ConvertPtr($input, (void **)&argp, $&descriptor, SWIG_POINTER_EXCEPTION);
if (SWIG_arg_fail($argnum)) SWIG_fail; if (SWIG_arg_fail($argnum)) SWIG_fail;
if (argp == NULL) { if (argp == 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;
$1 = *argp; $1 = *argp;
@ -41,12 +43,13 @@
/* Pointer to a class member */ /* Pointer to a class member */
%typemap(in) SWIGTYPE (CLASS::*) %typemap(in) SWIGTYPE (CLASS::*) {
"if ((SWIG_ConvertPacked($input,(void *)(&$1),sizeof($type),$descriptor,0)) == -1) { if ((SWIG_ConvertPacked($input,(void *)(&$1),sizeof($type),$descriptor,0)) == -1) {
SWIG_type_error(SWIG_TypePrettyName($descriptor),$input); SWIG_type_error("$basetype",$input);
} }
if (SWIG_arg_fail($argnum)) SWIG_fail; if (SWIG_arg_fail($argnum)) SWIG_fail;
"; }
/* ----------------------------------------------------------------------------- /* -----------------------------------------------------------------------------