From acbb784a50c8b04138e3fcd848ed2e5b7d77ce61 Mon Sep 17 00:00:00 2001 From: Logan Johnson Date: Fri, 6 Feb 2004 17:46:50 +0000 Subject: [PATCH] Be sure to initialize all of the fields of a PyMethodDef struct to some value, to avoid numerous compiler warnings. git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5701 626c5289-ae23-0410-ae9c-e8d60b6d4f22 --- Source/Modules/python.cxx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Source/Modules/python.cxx b/Source/Modules/python.cxx index 6c87d2bd3..5d12e2d00 100644 --- a/Source/Modules/python.cxx +++ b/Source/Modules/python.cxx @@ -330,13 +330,13 @@ public: Language::top(n); /* Close language module */ - Printf(methods,"\t { NULL, NULL }\n"); + Printf(methods,"\t { NULL, NULL, 0, NULL }\n"); Printf(methods,"};\n"); Printf(f_wrappers,"%s\n",methods); SwigType_emit_type_table(f_runtime,f_wrappers); - Printf(const_code, "{0}};\n"); + Printf(const_code, "{0, 0, 0, 0.0, 0, 0}};\n"); Printf(f_wrappers,"%s\n",const_code); Printf(f_init,"}\n"); @@ -472,9 +472,9 @@ public: void add_method(String *name, String *function, int kw) { if (!kw) - Printf(methods,"\t { (char *)\"%s\", %s, METH_VARARGS },\n", name, function); + Printf(methods,"\t { (char *)\"%s\", %s, METH_VARARGS, NULL },\n", name, function); else - Printf(methods,"\t { (char *)\"%s\", (PyCFunction) %s, METH_VARARGS | METH_KEYWORDS },\n", name, function); + Printf(methods,"\t { (char *)\"%s\", (PyCFunction) %s, METH_VARARGS | METH_KEYWORDS, NULL },\n", name, function); } /* ------------------------------------------------------------ @@ -571,7 +571,7 @@ public: } Printv(f->def, "static PyObject *", wname, - "(PyObject *self, PyObject *args, PyObject *kwargs) {", + "(PyObject *, PyObject *args, PyObject *kwargs) {", NIL); } if (!allow_kwargs) {