summaryrefslogtreecommitdiffstats
path: root/Modules/rotormodule.c
diff options
context:
space:
mode:
authorNeal Norwitz <nnorwitz@gmail.com>2002-03-31 15:27:00 (GMT)
committerNeal Norwitz <nnorwitz@gmail.com>2002-03-31 15:27:00 (GMT)
commitba3a16c6c3d3da0903873e9464dbc540eaeda1f7 (patch)
tree6094d419dcf56dfdb9bdb50da0a15d0c0160573a /Modules/rotormodule.c
parent50905b557b2a46d4db432b7a9e61fe32afa557e3 (diff)
downloadcpython-ba3a16c6c3d3da0903873e9464dbc540eaeda1f7.zip
cpython-ba3a16c6c3d3da0903873e9464dbc540eaeda1f7.tar.gz
cpython-ba3a16c6c3d3da0903873e9464dbc540eaeda1f7.tar.bz2
Remove METH_OLDARGS:
Convert METH_OLDARGS -> METH_VARARGS: also PyArg_Parse -> PyArg_ParseTuple Convert METH_OLDARGS -> METH_NOARGS: remove args parameter Please review. All tests pass, but some modules don't have tests. I spot checked various functions to try to make sure nothing broke.
Diffstat (limited to 'Modules/rotormodule.c')
-rw-r--r--Modules/rotormodule.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/Modules/rotormodule.c b/Modules/rotormodule.c
index 23ded46..ea91af0 100644
--- a/Modules/rotormodule.c
+++ b/Modules/rotormodule.c
@@ -463,7 +463,7 @@ rotorobj_encrypt(Rotorobj *self, PyObject *args)
PyObject *rtn = NULL;
char *tmp;
- if (!PyArg_Parse(args, "s#", &string, &len))
+ if (!PyArg_ParseTuple(args, "s#:encrypt", &string, &len))
return NULL;
if (!(tmp = PyMem_NEW(char, len+5))) {
PyErr_NoMemory();
@@ -485,7 +485,7 @@ rotorobj_encrypt_more(Rotorobj *self, PyObject *args)
PyObject *rtn = NULL;
char *tmp;
- if (!PyArg_Parse(args, "s#", &string, &len))
+ if (!PyArg_ParseTuple(args, "s#:encrypt_more", &string, &len))
return NULL;
if (!(tmp = PyMem_NEW(char, len+5))) {
PyErr_NoMemory();
@@ -507,7 +507,7 @@ rotorobj_decrypt(Rotorobj *self, PyObject *args)
PyObject *rtn = NULL;
char *tmp;
- if (!PyArg_Parse(args, "s#", &string, &len))
+ if (!PyArg_ParseTuple(args, "s#:decrypt", &string, &len))
return NULL;
if (!(tmp = PyMem_NEW(char, len+5))) {
PyErr_NoMemory();
@@ -529,7 +529,7 @@ rotorobj_decrypt_more(Rotorobj *self, PyObject *args)
PyObject *rtn = NULL;
char *tmp;
- if (!PyArg_Parse(args, "s#", &string, &len))
+ if (!PyArg_ParseTuple(args, "s#:decrypt_more", &string, &len))
return NULL;
if (!(tmp = PyMem_NEW(char, len+5))) {
PyErr_NoMemory();
@@ -558,10 +558,10 @@ rotorobj_setkey(Rotorobj *self, PyObject *args)
static struct PyMethodDef
rotorobj_methods[] = {
- {"encrypt", (PyCFunction)rotorobj_encrypt, METH_OLDARGS},
- {"encryptmore", (PyCFunction)rotorobj_encrypt_more, METH_OLDARGS},
- {"decrypt", (PyCFunction)rotorobj_decrypt, METH_OLDARGS},
- {"decryptmore", (PyCFunction)rotorobj_decrypt_more, METH_OLDARGS},
+ {"encrypt", (PyCFunction)rotorobj_encrypt, METH_VARARGS},
+ {"encryptmore", (PyCFunction)rotorobj_encrypt_more, METH_VARARGS},
+ {"decrypt", (PyCFunction)rotorobj_decrypt, METH_VARARGS},
+ {"decryptmore", (PyCFunction)rotorobj_decrypt_more, METH_VARARGS},
{"setkey", (PyCFunction)rotorobj_setkey, METH_VARARGS},
{NULL, NULL} /* sentinel */
};
@@ -611,7 +611,7 @@ rotor_rotor(PyObject *self, PyObject *args)
static struct PyMethodDef
rotor_methods[] = {
- {"newrotor", rotor_rotor, 1},
+ {"newrotor", rotor_rotor, METH_VARARGS},
{NULL, NULL} /* sentinel */
};