Python warning fixes for gcc -Wall -Wextra

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/branches/szager-python-builtin@12584 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
William S Fulton 2011-04-01 06:46:14 +00:00
commit 960b503a72
3 changed files with 57 additions and 47 deletions

View file

@ -32,7 +32,7 @@ typedef struct swig_const_info {
* Wrapper of PyInstanceMethod_New() used in Python 3
* It is exported to the generated module, used for -fastproxy
* ----------------------------------------------------------------------------- */
SWIGRUNTIME PyObject* SWIG_PyInstanceMethod_New(PyObject *SWIGUNUSEDPARM(self), PyObject *func)
SWIGRUNTIME PyObject* SWIG_PyInstanceMethod_New(PyObject *SWIGUNUSEDPARM(self), PyObject *SWIGUNUSEDPARM(func))
{
#if PY_VERSION_HEX >= 0x03000000
return PyInstanceMethod_New(func);

View file

@ -179,6 +179,9 @@ swig_varlink_type(void) {
#if PY_VERSION_HEX >= 0x02030000
0, /* tp_del */
#endif
#if PY_VERSION_HEX >= 0x02060000
0, /* tp_version */
#endif
#ifdef COUNT_ALLOCS
0,0,0,0 /* tp_alloc -> tp_next */
#endif
@ -321,7 +324,6 @@ SWIGEXPORT
#endif
SWIG_init(void) {
PyObject *m, *d, *md;
PyTypeObject *builtin_type;
#if PY_VERSION_HEX >= 0x03000000
static struct PyModuleDef SWIG_module = {
PyModuleDef_HEAD_INIT,

View file

@ -416,7 +416,7 @@ SwigPyObject_repr(SwigPyObject *v, PyObject *args)
#endif
{
const char *name = SWIG_TypePrettyName(v->ty);
PyObject *repr = SWIG_Python_str_FromFormat("<Swig Object of type '%s' at %p>", name, v);
PyObject *repr = SWIG_Python_str_FromFormat("<Swig Object of type '%s' at %p>", name, (void *)v);
if (v->next) {
# ifdef METH_NOARGS
PyObject *nrep = SwigPyObject_repr((SwigPyObject *)v->next);
@ -804,6 +804,9 @@ SwigPyObject_TypeOnce(void) {
#if PY_VERSION_HEX >= 0x02030000
0, /* tp_del */
#endif
#if PY_VERSION_HEX >= 0x02060000
0, /* tp_version */
#endif
#ifdef COUNT_ALLOCS
0,0,0,0 /* tp_alloc -> tp_next */
#endif
@ -973,12 +976,15 @@ SwigPyPacked_TypeOnce(void) {
0, /* tp_bases */
0, /* tp_mro */
0, /* tp_cache */
0, /* tp_subclasses */
0, /* tp_subclasses */
0, /* tp_weaklist */
#endif
#if PY_VERSION_HEX >= 0x02030000
0, /* tp_del */
#endif
#if PY_VERSION_HEX >= 0x02060000
0, /* tp_version */
#endif
#ifdef COUNT_ALLOCS
0,0,0,0 /* tp_alloc -> tp_next */
#endif
@ -1136,10 +1142,12 @@ SWIG_Python_ConvertPtrAndOwn(PyObject *obj, void **ptr, swig_type_info *ty, int
int res;
SwigPyObject *sobj;
if (!obj) return SWIG_ERROR;
if (!obj)
return SWIG_ERROR;
if (obj == Py_None) {
if (ptr) *ptr = 0;
return SWIG_OK;
if (ptr)
*ptr = 0;
return SWIG_OK;
}
res = SWIG_ERROR;
@ -1667,7 +1675,7 @@ SWIG_Python_TypeError(const char *type, PyObject *obj)
/* Convert a pointer value, signal an exception on a type mismatch */
SWIGRUNTIME void *
SWIG_Python_MustGetPtr(PyObject *obj, swig_type_info *ty, int argnum, int flags) {
SWIG_Python_MustGetPtr(PyObject *obj, swig_type_info *ty, int SWIGUNUSEDPARM(argnum), int flags) {
void *result;
if (SWIG_Python_ConvertPtr(obj, &result, ty, flags) == -1) {
PyErr_Clear();