From: Fred Drake Date: Sat, 17 Nov 2001 06:30:20 +0000 (+0000) Subject: Update to use more modern calling conventions; also avoid a magic number X-Git-Tag: v2.2.1c1~738 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=3176b08874941c2be97b7ab5b1efbfae886eac01;p=thirdparty%2FPython%2Fcpython.git Update to use more modern calling conventions; also avoid a magic number in the function table. Add a docstring for the function as well, since examples should show good form. --- diff --git a/Demo/embed/demo.c b/Demo/embed/demo.c index 581365f36e20..6005f1396bf1 100644 --- a/Demo/embed/demo.c +++ b/Demo/embed/demo.c @@ -48,13 +48,12 @@ main(int argc, char **argv) static PyObject * xyzzy_foo(PyObject *self, PyObject* args) { - if (!PyArg_ParseTuple(args, "")) - return NULL; return PyInt_FromLong(42L); } static PyMethodDef xyzzy_methods[] = { - {"foo", xyzzy_foo, 1}, + {"foo", xyzzy_foo, METH_NOARGS, + "Return the meaning of everything."}, {NULL, NULL} /* sentinel */ };