Kaydet (Commit) 14f51584 authored tarafından Andrew M. Kuchling's avatar Andrew M. Kuchling

Use METH_VARARGS instead of numeric constant 1

üst 6c7a46a2
...@@ -610,7 +610,7 @@ PyZlib_unflush(compobject *self, PyObject *args) ...@@ -610,7 +610,7 @@ PyZlib_unflush(compobject *self, PyObject *args)
int length=0, err; int length=0, err;
PyObject *RetVal; PyObject *RetVal;
if (!PyArg_NoArgs(args)) if (!PyArg_ParseTuple(args, ""))
return NULL; return NULL;
if (!(RetVal = PyString_FromStringAndSize(NULL, DEFAULTALLOC))) if (!(RetVal = PyString_FromStringAndSize(NULL, DEFAULTALLOC)))
{ {
...@@ -675,15 +675,19 @@ PyZlib_unflush(compobject *self, PyObject *args) ...@@ -675,15 +675,19 @@ PyZlib_unflush(compobject *self, PyObject *args)
static PyMethodDef comp_methods[] = static PyMethodDef comp_methods[] =
{ {
{"compress", (binaryfunc)PyZlib_objcompress, 1, comp_compress__doc__}, {"compress", (binaryfunc)PyZlib_objcompress,
{"flush", (binaryfunc)PyZlib_flush, 1, comp_flush__doc__}, METH_VARARGS, comp_compress__doc__},
{"flush", (binaryfunc)PyZlib_flush,
METH_VARARGS, comp_flush__doc__},
{NULL, NULL} {NULL, NULL}
}; };
static PyMethodDef Decomp_methods[] = static PyMethodDef Decomp_methods[] =
{ {
{"decompress", (binaryfunc)PyZlib_objdecompress, 1, decomp_decompress__doc__}, {"decompress", (binaryfunc)PyZlib_objdecompress,
{"flush", (binaryfunc)PyZlib_unflush, 0, decomp_flush__doc__}, METH_VARARGS, decomp_decompress__doc__},
{"flush", (binaryfunc)PyZlib_unflush,
METH_VARARGS, decomp_flush__doc__},
{NULL, NULL} {NULL, NULL}
}; };
...@@ -750,13 +754,19 @@ PyZlib_crc32(PyObject *self, PyObject *args) ...@@ -750,13 +754,19 @@ PyZlib_crc32(PyObject *self, PyObject *args)
static PyMethodDef zlib_methods[] = static PyMethodDef zlib_methods[] =
{ {
{"adler32", (PyCFunction)PyZlib_adler32, 1, adler32__doc__}, {"adler32", (PyCFunction)PyZlib_adler32,
{"compress", (PyCFunction)PyZlib_compress, 1, compress__doc__}, METH_VARARGS, adler32__doc__},
{"compressobj", (PyCFunction)PyZlib_compressobj, 1, compressobj__doc__}, {"compress", (PyCFunction)PyZlib_compress,
{"crc32", (PyCFunction)PyZlib_crc32, 1, crc32__doc__}, METH_VARARGS, compress__doc__},
{"decompress", (PyCFunction)PyZlib_decompress, 1, decompress__doc__}, {"compressobj", (PyCFunction)PyZlib_compressobj,
{"decompressobj", (PyCFunction)PyZlib_decompressobj, 1, decompressobj__doc__}, METH_VARARGS, compressobj__doc__},
{NULL, NULL} {"crc32", (PyCFunction)PyZlib_crc32,
METH_VARARGS, crc32__doc__},
{"decompress", (PyCFunction)PyZlib_decompress,
METH_VARARGS, decompress__doc__},
{"decompressobj", (PyCFunction)PyZlib_decompressobj,
METH_VARARGS, decompressobj__doc__},
{NULL, NULL}
}; };
statichere PyTypeObject Comptype = { statichere PyTypeObject Comptype = {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment