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
This commit is contained in:
Logan Johnson 2004-02-06 17:46:50 +00:00
commit acbb784a50

View file

@ -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) {