diff options
author | Neal Norwitz <nnorwitz@gmail.com> | 2002-03-31 14:57:24 (GMT) |
---|---|---|
committer | Neal Norwitz <nnorwitz@gmail.com> | 2002-03-31 14:57:24 (GMT) |
commit | 50905b557b2a46d4db432b7a9e61fe32afa557e3 (patch) | |
tree | b86e16799cb58028893b510d0ebafa24eeecfaf8 /Modules/timingmodule.c | |
parent | 01b2694acb99e3164b8d65469ee54feb68a7cd08 (diff) | |
download | cpython-50905b557b2a46d4db432b7a9e61fe32afa557e3.zip cpython-50905b557b2a46d4db432b7a9e61fe32afa557e3.tar.gz cpython-50905b557b2a46d4db432b7a9e61fe32afa557e3.tar.bz2 |
Convert from using METH_OLDARGS to METH_NOARGS.
These should be safe.
Diffstat (limited to 'Modules/timingmodule.c')
-rw-r--r-- | Modules/timingmodule.c | 39 |
1 files changed, 11 insertions, 28 deletions
diff --git a/Modules/timingmodule.c b/Modules/timingmodule.c index 4f1d5cf..4e10e31 100644 --- a/Modules/timingmodule.c +++ b/Modules/timingmodule.c @@ -8,63 +8,46 @@ #include "timing.h" static PyObject * -start_timing(PyObject *self, PyObject *args) +start_timing(PyObject *self) { - if (!PyArg_Parse(args, "")) - return NULL; - Py_INCREF(Py_None); BEGINTIMING; return Py_None; } static PyObject * -finish_timing(PyObject *self, PyObject *args) +finish_timing(PyObject *self) { - if (!PyArg_Parse(args, "")) - return NULL; - ENDTIMING Py_INCREF(Py_None); return Py_None; } static PyObject * -seconds(PyObject *self, PyObject *args) +seconds(PyObject *self) { - if (!PyArg_Parse(args, "")) - return NULL; - return PyInt_FromLong(TIMINGS); - } static PyObject * -milli(PyObject *self, PyObject *args) +milli(PyObject *self) { - if (!PyArg_Parse(args, "")) - return NULL; - return PyInt_FromLong(TIMINGMS); - } + static PyObject * -micro(PyObject *self, PyObject *args) +micro(PyObject *self) { - if (!PyArg_Parse(args, "")) - return NULL; - return PyInt_FromLong(TIMINGUS); - } static PyMethodDef timing_methods[] = { - {"start", start_timing, METH_OLDARGS}, - {"finish", finish_timing, METH_OLDARGS}, - {"seconds", seconds, METH_OLDARGS}, - {"milli", milli, METH_OLDARGS}, - {"micro", micro, METH_OLDARGS}, + {"start", (PyCFunction)start_timing, METH_NOARGS}, + {"finish", (PyCFunction)finish_timing, METH_NOARGS}, + {"seconds", (PyCFunction)seconds, METH_NOARGS}, + {"milli", (PyCFunction)milli, METH_NOARGS}, + {"micro", (PyCFunction)micro, METH_NOARGS}, {NULL, NULL} }; |