mirror of
https://github.com/python/cpython.git
synced 2025-07-24 11:44:31 +00:00
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.
This commit is contained in:
parent
50905b557b
commit
ba3a16c6c3
11 changed files with 85 additions and 164 deletions
|
@ -236,7 +236,7 @@ sizeofimage(PyObject *self, PyObject *args)
|
|||
IMAGE image;
|
||||
FILE *inf;
|
||||
|
||||
if (!PyArg_Parse(args, "s", &name))
|
||||
if (!PyArg_ParseTuple(args, "s:sizeofimage", &name))
|
||||
return NULL;
|
||||
|
||||
inf = fopen(name, "rb");
|
||||
|
@ -275,7 +275,7 @@ longimagedata(PyObject *self, PyObject *args)
|
|||
int rlebuflen;
|
||||
PyObject *rv = NULL;
|
||||
|
||||
if (!PyArg_Parse(args, "s", &name))
|
||||
if (!PyArg_ParseTuple(args, "s:longimagedata", &name))
|
||||
return NULL;
|
||||
|
||||
inf = fopen(name,"rb");
|
||||
|
@ -570,8 +570,8 @@ longstoimage(PyObject *self, PyObject *args)
|
|||
int rlebuflen, goodwrite;
|
||||
PyObject *retval = NULL;
|
||||
|
||||
if (!PyArg_Parse(args, "(s#iiis)", &lptr, &len, &xsize, &ysize, &zsize,
|
||||
&name))
|
||||
if (!PyArg_ParseTuple(args, "s#iiis:longstoimage", &lptr, &len,
|
||||
&xsize, &ysize, &zsize, &name))
|
||||
return NULL;
|
||||
|
||||
goodwrite = 1;
|
||||
|
@ -734,7 +734,7 @@ ttob(PyObject *self, PyObject *args)
|
|||
{
|
||||
int order, oldorder;
|
||||
|
||||
if (!PyArg_Parse(args, "i", &order))
|
||||
if (!PyArg_ParseTuple(args, "i:ttob", &order))
|
||||
return NULL;
|
||||
oldorder = reverse_order;
|
||||
reverse_order = order;
|
||||
|
@ -743,10 +743,10 @@ ttob(PyObject *self, PyObject *args)
|
|||
|
||||
static PyMethodDef
|
||||
rgbimg_methods[] = {
|
||||
{"sizeofimage", sizeofimage, METH_OLDARGS},
|
||||
{"longimagedata", longimagedata, METH_OLDARGS},
|
||||
{"longstoimage", longstoimage, METH_OLDARGS},
|
||||
{"ttob", ttob, METH_OLDARGS},
|
||||
{"sizeofimage", sizeofimage, METH_VARARGS},
|
||||
{"longimagedata", longimagedata, METH_VARARGS},
|
||||
{"longstoimage", longstoimage, METH_VARARGS},
|
||||
{"ttob", ttob, METH_VARARGS},
|
||||
{NULL, NULL} /* sentinel */
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue