diff options
author | Neal Norwitz <nnorwitz@gmail.com> | 2002-03-25 20:46:46 (GMT) |
---|---|---|
committer | Neal Norwitz <nnorwitz@gmail.com> | 2002-03-25 20:46:46 (GMT) |
commit | 3a6f97850b2a4071f3015033fa3d68ce6fa576f4 (patch) | |
tree | 46311b5e874d4c733748e5a20de70336bf282323 /Modules/md5module.c | |
parent | 57f8e06e4f797abe4d2cbb41a298c5541f69b7f6 (diff) | |
download | cpython-3a6f97850b2a4071f3015033fa3d68ce6fa576f4.zip cpython-3a6f97850b2a4071f3015033fa3d68ce6fa576f4.tar.gz cpython-3a6f97850b2a4071f3015033fa3d68ce6fa576f4.tar.bz2 |
Remove many uses of PyArg_NoArgs macro, change METH_OLDARGS to METH_NOARGS.
Diffstat (limited to 'Modules/md5module.c')
-rw-r--r-- | Modules/md5module.c | 21 |
1 files changed, 6 insertions, 15 deletions
diff --git a/Modules/md5module.c b/Modules/md5module.c index 3ddacf5..fb904f4 100644 --- a/Modules/md5module.c +++ b/Modules/md5module.c @@ -70,14 +70,11 @@ arguments."; static PyObject * -md5_digest(md5object *self, PyObject *args) +md5_digest(md5object *self) { MD5_CTX mdContext; unsigned char aDigest[16]; - if (!PyArg_NoArgs(args)) - return NULL; - /* make a temporary copy, and perform the final */ mdContext = self->md5; MD5Final(aDigest, &mdContext); @@ -94,16 +91,13 @@ including null bytes."; static PyObject * -md5_hexdigest(md5object *self, PyObject *args) +md5_hexdigest(md5object *self) { MD5_CTX mdContext; unsigned char digest[16]; unsigned char hexdigest[32]; int i, j; - if (!PyArg_NoArgs(args)) - return NULL; - /* make a temporary copy, and perform the final */ mdContext = self->md5; MD5Final(digest, &mdContext); @@ -129,13 +123,10 @@ Like digest(), but returns the digest as a string of hexadecimal digits."; static PyObject * -md5_copy(md5object *self, PyObject *args) +md5_copy(md5object *self) { md5object *md5p; - if (!PyArg_NoArgs(args)) - return NULL; - if ((md5p = newmd5object()) == NULL) return NULL; @@ -152,9 +143,9 @@ Return a copy (``clone'') of the md5 object."; static PyMethodDef md5_methods[] = { {"update", (PyCFunction)md5_update, METH_OLDARGS, update_doc}, - {"digest", (PyCFunction)md5_digest, METH_OLDARGS, digest_doc}, - {"hexdigest", (PyCFunction)md5_hexdigest, METH_OLDARGS, hexdigest_doc}, - {"copy", (PyCFunction)md5_copy, METH_OLDARGS, copy_doc}, + {"digest", (PyCFunction)md5_digest, METH_NOARGS, digest_doc}, + {"hexdigest", (PyCFunction)md5_hexdigest, METH_NOARGS, hexdigest_doc}, + {"copy", (PyCFunction)md5_copy, METH_NOARGS, copy_doc}, {NULL, NULL} /* sentinel */ }; |