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 * Wrapper of PyInstanceMethod_New() used in Python 3
* It is exported to the generated module, used for -fastproxy * 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 #if PY_VERSION_HEX >= 0x03000000
return PyInstanceMethod_New(func); return PyInstanceMethod_New(func);

View file

@ -138,7 +138,7 @@ SWIGINTERN PyTypeObject*
swig_varlink_type(void) { swig_varlink_type(void) {
static char varlink__doc__[] = "Swig var link object"; static char varlink__doc__[] = "Swig var link object";
static PyTypeObject varlink_type; static PyTypeObject varlink_type;
static int type_init = 0; static int type_init = 0;
if (!type_init) { if (!type_init) {
const PyTypeObject tmp const PyTypeObject tmp
= { = {
@ -152,7 +152,7 @@ swig_varlink_type(void) {
(char *)"swigvarlink", /* Type name (tp_name) */ (char *)"swigvarlink", /* Type name (tp_name) */
sizeof(swig_varlinkobject), /* Basic size (tp_basicsize) */ sizeof(swig_varlinkobject), /* Basic size (tp_basicsize) */
0, /* Itemsize (tp_itemsize) */ 0, /* Itemsize (tp_itemsize) */
(destructor) swig_varlink_dealloc, /* Deallocator (tp_dealloc) */ (destructor) swig_varlink_dealloc, /* Deallocator (tp_dealloc) */
(printfunc) swig_varlink_print, /* Print (tp_print) */ (printfunc) swig_varlink_print, /* Print (tp_print) */
(getattrfunc) swig_varlink_getattr, /* get attr (tp_getattr) */ (getattrfunc) swig_varlink_getattr, /* get attr (tp_getattr) */
(setattrfunc) swig_varlink_setattr, /* Set attr (tp_setattr) */ (setattrfunc) swig_varlink_setattr, /* Set attr (tp_setattr) */
@ -179,6 +179,9 @@ swig_varlink_type(void) {
#if PY_VERSION_HEX >= 0x02030000 #if PY_VERSION_HEX >= 0x02030000
0, /* tp_del */ 0, /* tp_del */
#endif #endif
#if PY_VERSION_HEX >= 0x02060000
0, /* tp_version */
#endif
#ifdef COUNT_ALLOCS #ifdef COUNT_ALLOCS
0,0,0,0 /* tp_alloc -> tp_next */ 0,0,0,0 /* tp_alloc -> tp_next */
#endif #endif
@ -321,7 +324,6 @@ SWIGEXPORT
#endif #endif
SWIG_init(void) { SWIG_init(void) {
PyObject *m, *d, *md; PyObject *m, *d, *md;
PyTypeObject *builtin_type;
#if PY_VERSION_HEX >= 0x03000000 #if PY_VERSION_HEX >= 0x03000000
static struct PyModuleDef SWIG_module = { static struct PyModuleDef SWIG_module = {
PyModuleDef_HEAD_INIT, PyModuleDef_HEAD_INIT,

View file

@ -416,7 +416,7 @@ SwigPyObject_repr(SwigPyObject *v, PyObject *args)
#endif #endif
{ {
const char *name = SWIG_TypePrettyName(v->ty); 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) { if (v->next) {
# ifdef METH_NOARGS # ifdef METH_NOARGS
PyObject *nrep = SwigPyObject_repr((SwigPyObject *)v->next); PyObject *nrep = SwigPyObject_repr((SwigPyObject *)v->next);
@ -688,7 +688,7 @@ SwigPyObject_getattr(SwigPyObject *sobj,char *name)
SWIGRUNTIME PyTypeObject* SWIGRUNTIME PyTypeObject*
SwigPyObject_TypeOnce(void) { SwigPyObject_TypeOnce(void) {
static char swigobject_doc[] = "Swig object carries a C/C++ instance pointer"; static char swigobject_doc[] = "Swig object carries a C/C++ instance pointer";
static PyNumberMethods SwigPyObject_as_number = { static PyNumberMethods SwigPyObject_as_number = {
(binaryfunc)0, /*nb_add*/ (binaryfunc)0, /*nb_add*/
(binaryfunc)0, /*nb_subtract*/ (binaryfunc)0, /*nb_subtract*/
@ -735,7 +735,7 @@ SwigPyObject_TypeOnce(void) {
#endif #endif
}; };
static PyTypeObject swigpyobject_type; static PyTypeObject swigpyobject_type;
static int type_init = 0; static int type_init = 0;
if (!type_init) { if (!type_init) {
const PyTypeObject tmp const PyTypeObject tmp
@ -743,7 +743,7 @@ SwigPyObject_TypeOnce(void) {
/* PyObject header changed in Python 3 */ /* PyObject header changed in Python 3 */
#if PY_VERSION_HEX >= 0x03000000 #if PY_VERSION_HEX >= 0x03000000
PyVarObject_HEAD_INIT(&PyType_Type, 0) PyVarObject_HEAD_INIT(&PyType_Type, 0)
#else #else
PyObject_HEAD_INIT(NULL) PyObject_HEAD_INIT(NULL)
0, /* ob_size */ 0, /* ob_size */
#endif #endif
@ -753,17 +753,17 @@ SwigPyObject_TypeOnce(void) {
(destructor)SwigPyObject_dealloc, /* tp_dealloc */ (destructor)SwigPyObject_dealloc, /* tp_dealloc */
(printfunc)SwigPyObject_print, /* tp_print */ (printfunc)SwigPyObject_print, /* tp_print */
#if PY_VERSION_HEX < 0x02020000 #if PY_VERSION_HEX < 0x02020000
(getattrfunc)SwigPyObject_getattr, /* tp_getattr */ (getattrfunc)SwigPyObject_getattr, /* tp_getattr */
#else #else
(getattrfunc)0, /* tp_getattr */ (getattrfunc)0, /* tp_getattr */
#endif #endif
(setattrfunc)0, /* tp_setattr */ (setattrfunc)0, /* tp_setattr */
#if PY_VERSION_HEX >= 0x03000000 #if PY_VERSION_HEX >= 0x03000000
0, /* tp_reserved in 3.0.1, tp_compare in 3.0.0 but not used */ 0, /* tp_reserved in 3.0.1, tp_compare in 3.0.0 but not used */
#else #else
(cmpfunc)SwigPyObject_compare, /* tp_compare */ (cmpfunc)SwigPyObject_compare, /* tp_compare */
#endif #endif
(reprfunc)SwigPyObject_repr, /* tp_repr */ (reprfunc)SwigPyObject_repr, /* tp_repr */
&SwigPyObject_as_number, /* tp_as_number */ &SwigPyObject_as_number, /* tp_as_number */
0, /* tp_as_sequence */ 0, /* tp_as_sequence */
0, /* tp_as_mapping */ 0, /* tp_as_mapping */
@ -774,7 +774,7 @@ SwigPyObject_TypeOnce(void) {
0, /* tp_setattro */ 0, /* tp_setattro */
0, /* tp_as_buffer */ 0, /* tp_as_buffer */
Py_TPFLAGS_DEFAULT, /* tp_flags */ Py_TPFLAGS_DEFAULT, /* tp_flags */
swigobject_doc, /* tp_doc */ swigobject_doc, /* tp_doc */
0, /* tp_traverse */ 0, /* tp_traverse */
0, /* tp_clear */ 0, /* tp_clear */
(richcmpfunc)SwigPyObject_richcompare, /* tp_richcompare */ (richcmpfunc)SwigPyObject_richcompare, /* tp_richcompare */
@ -782,28 +782,31 @@ SwigPyObject_TypeOnce(void) {
#if PY_VERSION_HEX >= 0x02020000 #if PY_VERSION_HEX >= 0x02020000
0, /* tp_iter */ 0, /* tp_iter */
0, /* tp_iternext */ 0, /* tp_iternext */
swigobject_methods, /* tp_methods */ swigobject_methods, /* tp_methods */
0, /* tp_members */ 0, /* tp_members */
0, /* tp_getset */ 0, /* tp_getset */
0, /* tp_base */ 0, /* tp_base */
0, /* tp_dict */ 0, /* tp_dict */
0, /* tp_descr_get */ 0, /* tp_descr_get */
0, /* tp_descr_set */ 0, /* tp_descr_set */
0, /* tp_dictoffset */ 0, /* tp_dictoffset */
0, /* tp_init */ 0, /* tp_init */
0, /* tp_alloc */ 0, /* tp_alloc */
0, /* tp_new */ 0, /* tp_new */
0, /* tp_free */ 0, /* tp_free */
0, /* tp_is_gc */ 0, /* tp_is_gc */
0, /* tp_bases */ 0, /* tp_bases */
0, /* tp_mro */ 0, /* tp_mro */
0, /* tp_cache */ 0, /* tp_cache */
0, /* tp_subclasses */ 0, /* tp_subclasses */
0, /* tp_weaklist */ 0, /* tp_weaklist */
#endif #endif
#if PY_VERSION_HEX >= 0x02030000 #if PY_VERSION_HEX >= 0x02030000
0, /* tp_del */ 0, /* tp_del */
#endif #endif
#if PY_VERSION_HEX >= 0x02060000
0, /* tp_version */
#endif
#ifdef COUNT_ALLOCS #ifdef COUNT_ALLOCS
0,0,0,0 /* tp_alloc -> tp_next */ 0,0,0,0 /* tp_alloc -> tp_next */
#endif #endif
@ -915,7 +918,7 @@ SWIGRUNTIME PyTypeObject*
SwigPyPacked_TypeOnce(void) { SwigPyPacked_TypeOnce(void) {
static char swigpacked_doc[] = "Swig object carries a C/C++ instance pointer"; static char swigpacked_doc[] = "Swig object carries a C/C++ instance pointer";
static PyTypeObject swigpypacked_type; static PyTypeObject swigpypacked_type;
static int type_init = 0; static int type_init = 0;
if (!type_init) { if (!type_init) {
const PyTypeObject tmp const PyTypeObject tmp
= { = {
@ -957,28 +960,31 @@ SwigPyPacked_TypeOnce(void) {
#if PY_VERSION_HEX >= 0x02020000 #if PY_VERSION_HEX >= 0x02020000
0, /* tp_iter */ 0, /* tp_iter */
0, /* tp_iternext */ 0, /* tp_iternext */
0, /* tp_methods */ 0, /* tp_methods */
0, /* tp_members */ 0, /* tp_members */
0, /* tp_getset */ 0, /* tp_getset */
0, /* tp_base */ 0, /* tp_base */
0, /* tp_dict */ 0, /* tp_dict */
0, /* tp_descr_get */ 0, /* tp_descr_get */
0, /* tp_descr_set */ 0, /* tp_descr_set */
0, /* tp_dictoffset */ 0, /* tp_dictoffset */
0, /* tp_init */ 0, /* tp_init */
0, /* tp_alloc */ 0, /* tp_alloc */
0, /* tp_new */ 0, /* tp_new */
0, /* tp_free */ 0, /* tp_free */
0, /* tp_is_gc */ 0, /* tp_is_gc */
0, /* tp_bases */ 0, /* tp_bases */
0, /* tp_mro */ 0, /* tp_mro */
0, /* tp_cache */ 0, /* tp_cache */
0, /* tp_subclasses */ 0, /* tp_subclasses */
0, /* tp_weaklist */ 0, /* tp_weaklist */
#endif #endif
#if PY_VERSION_HEX >= 0x02030000 #if PY_VERSION_HEX >= 0x02030000
0, /* tp_del */ 0, /* tp_del */
#endif #endif
#if PY_VERSION_HEX >= 0x02060000
0, /* tp_version */
#endif
#ifdef COUNT_ALLOCS #ifdef COUNT_ALLOCS
0,0,0,0 /* tp_alloc -> tp_next */ 0,0,0,0 /* tp_alloc -> tp_next */
#endif #endif
@ -1136,10 +1142,12 @@ SWIG_Python_ConvertPtrAndOwn(PyObject *obj, void **ptr, swig_type_info *ty, int
int res; int res;
SwigPyObject *sobj; SwigPyObject *sobj;
if (!obj) return SWIG_ERROR; if (!obj)
return SWIG_ERROR;
if (obj == Py_None) { if (obj == Py_None) {
if (ptr) *ptr = 0; if (ptr)
return SWIG_OK; *ptr = 0;
return SWIG_OK;
} }
res = SWIG_ERROR; 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 */ /* Convert a pointer value, signal an exception on a type mismatch */
SWIGRUNTIME void * 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; void *result;
if (SWIG_Python_ConvertPtr(obj, &result, ty, flags) == -1) { if (SWIG_Python_ConvertPtr(obj, &result, ty, flags) == -1) {
PyErr_Clear(); PyErr_Clear();