better error messages, more comments, clean up for the next major modifications

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@6284 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
Marcelo Matus 2004-10-02 01:43:17 +00:00
commit 3ae15c245c
25 changed files with 633 additions and 286 deletions

View file

@ -41,7 +41,7 @@ SWIGSTATICINLINE(int)
}
}
if (val) {
PyErr_SetString(PyExc_TypeError, "a Type is expected");
SWIG_type_error("Type", o);
}
return 0;
}
@ -64,8 +64,8 @@ SWIGSTATICINLINE(int)
double im = PyComplex_ImagAsDouble(o);
if (SWIG_CheckDoubleInRange(re, -FLT_MAX, FLT_MAX, errmsg)
&& SWIG_CheckDoubleInRange(im, -FLT_MAX, FLT_MAX, errmsg)) {
if (val) *val = Constructor(swig_numeric_cast(re, float),
swig_numeric_cast(im, float));
if (val) *val = Constructor(SWIG_numeric_cast(re, float),
SWIG_numeric_cast(im, float));
return 1;
} else {
return 0;
@ -74,7 +74,7 @@ SWIGSTATICINLINE(int)
double re;
if (SWIG_AsVal(double)(o, &re)) {
if (SWIG_CheckDoubleInRange(re, -FLT_MAX, FLT_MAX, errmsg)) {
if (val) *val = Constructor(swig_numeric_cast(re,float), 0);
if (val) *val = Constructor(SWIG_numeric_cast(re,float), 0);
return 1;
} else {
return 0;
@ -84,7 +84,7 @@ SWIGSTATICINLINE(int)
}
}
if (val) {
PyErr_SetString(PyExc_TypeError, "a Type is expected");
SWIG_type_error("Type", o);
}
return 0;
}