remove the _AS_XX macros, just in case the Check methods are too permissive

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@7311 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
Marcelo Matus 2005-06-21 18:52:04 +00:00
commit a663b62852
2 changed files with 7 additions and 7 deletions

View file

@ -53,7 +53,7 @@ SWIGINTERN int
SWIG_AsVal(unsigned long)(PyObject *obj, unsigned long *val) SWIG_AsVal(unsigned long)(PyObject *obj, unsigned long *val)
{ {
if (PyInt_Check(obj)) { if (PyInt_Check(obj)) {
long v = PyInt_AS_LONG(obj); long v = PyInt_AsLong(obj);
if (v >= 0) { if (v >= 0) {
if (val) *val = v; if (val) *val = v;
return 1; return 1;
@ -126,11 +126,11 @@ SWIGINTERN int
SWIG_AsVal(double)(PyObject *obj, double *val) SWIG_AsVal(double)(PyObject *obj, double *val)
{ {
if (PyFloat_Check(obj)) { if (PyFloat_Check(obj)) {
if (val) *val = PyFloat_AS_DOUBLE(obj); if (val) *val = PyFloat_AsDouble(obj);
return 1; return 1;
} }
if (PyInt_Check(obj)) { if (PyInt_Check(obj)) {
if (val) *val = PyInt_AS_LONG(obj); if (val) *val = PyInt_AsLong(obj);
return 1; return 1;
} }
if (PyLong_Check(obj)) { if (PyLong_Check(obj)) {
@ -155,7 +155,7 @@ SWIGINTERN int
SWIG_AsVal(long)(PyObject * obj, long* val) SWIG_AsVal(long)(PyObject * obj, long* val)
{ {
if (PyInt_Check(obj)) { if (PyInt_Check(obj)) {
if (val) *val = PyInt_AS_LONG(obj); if (val) *val = PyInt_AsLong(obj);
return 1; return 1;
} }
if (PyLong_Check(obj)) { if (PyLong_Check(obj)) {
@ -214,7 +214,7 @@ SWIGINTERN int
} }
} }
if (PyInt_Check(obj)) { if (PyInt_Check(obj)) {
if (val) *val = PyInt_AS_LONG(obj); if (val) *val = PyInt_AsLong(obj);
return 1; return 1;
} }
if (val) { if (val) {

View file

@ -610,7 +610,7 @@ SWIG_Python_ConvertPtr(PyObject *obj, void **ptr, swig_type_info *ty, int flags)
goto type_error; goto type_error;
} }
} }
c = PyString_AS_STRING(obj); c = PyString_AsString(obj);
/* Pointer values must start with leading underscore */ /* Pointer values must start with leading underscore */
c = SWIG_UnpackVoidPtr(c, &vptr, ty->name); c = SWIG_UnpackVoidPtr(c, &vptr, ty->name);
if (newref) { Py_DECREF(obj); } if (newref) { Py_DECREF(obj); }
@ -679,7 +679,7 @@ SWIG_Python_ConvertPacked(PyObject *obj, void *ptr, size_t sz, swig_type_info *t
c = PySwigPacked_UnpackData(obj, ptr, sz); c = PySwigPacked_UnpackData(obj, ptr, sz);
#else #else
if ((!obj) || (!PyString_Check(obj))) goto type_error; if ((!obj) || (!PyString_Check(obj))) goto type_error;
c = PyString_AS_STRING(obj); c = PyString_AsString(obj);
/* Pointer values must start with leading underscore */ /* Pointer values must start with leading underscore */
c = SWIG_UnpackDataName(c, ptr, sz, ty->name); c = SWIG_UnpackDataName(c, ptr, sz, ty->name);
#endif #endif