[Python-checkins] CVS: python/dist/src/Modules sgimodule.c,1.18,1.19 imageop.c,2.26,2.27 clmodule.c,2.27,2.28
Neal Norwitz
nnorwitz@users.sourceforge.net
Tue, 02 Apr 2002 10:26:35 -0800
Update of /cvsroot/python/python/dist/src/Modules
In directory usw-pr-cvs1:/tmp/cvs-serv30763
Modified Files:
sgimodule.c imageop.c clmodule.c
Log Message:
Convert more METH_OLDARGS & PyArg_Parse()
Please review.
Index: sgimodule.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Modules/sgimodule.c,v
retrieving revision 1.18
retrieving revision 1.19
diff -C2 -d -r1.18 -r1.19
*** sgimodule.c 17 Jan 2002 23:15:58 -0000 1.18
--- sgimodule.c 2 Apr 2002 18:26:33 -0000 1.19
***************
*** 12,16 ****
{
long ticks;
! if (!PyArg_Parse(args, "l", &ticks))
return NULL;
Py_BEGIN_ALLOW_THREADS
--- 12,16 ----
{
long ticks;
! if (!PyArg_ParseTuple(args, "l:nap", &ticks))
return NULL;
Py_BEGIN_ALLOW_THREADS
***************
*** 31,35 ****
char *name;
int fildes;
! if (!PyArg_Parse(args, "(iii)", &oflag, &mode, &nofork))
return NULL;
errno = 0;
--- 31,35 ----
char *name;
int fildes;
! if (!PyArg_ParseTuple(args, "iii:_getpty", &oflag, &mode, &nofork))
return NULL;
errno = 0;
***************
*** 43,48 ****
static PyMethodDef sgi_methods[] = {
! {"nap", sgi_nap, METH_OLDARGS},
! {"_getpty", sgi__getpty, METH_OLDARGS},
{NULL, NULL} /* sentinel */
};
--- 43,48 ----
static PyMethodDef sgi_methods[] = {
! {"nap", sgi_nap, METH_VARARGS},
! {"_getpty", sgi__getpty, METH_VARARGS},
{NULL, NULL} /* sentinel */
};
Index: imageop.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Modules/imageop.c,v
retrieving revision 2.26
retrieving revision 2.27
diff -C2 -d -r2.26 -r2.27
*** imageop.c 17 Jan 2002 23:15:58 -0000 2.26
--- imageop.c 2 Apr 2002 18:26:33 -0000 2.27
***************
*** 36,40 ****
PyObject *rv;
! if ( !PyArg_Parse(args, "(s#iiiiiii)", &cp, &len, &size, &x, &y,
&newx1, &newy1, &newx2, &newy2) )
return 0;
--- 36,40 ----
PyObject *rv;
! if ( !PyArg_ParseTuple(args, "s#iiiiiii", &cp, &len, &size, &x, &y,
&newx1, &newy1, &newx2, &newy2) )
return 0;
***************
*** 91,95 ****
PyObject *rv;
! if ( !PyArg_Parse(args, "(s#iiiii)",
&cp, &len, &size, &x, &y, &newx, &newy) )
return 0;
--- 91,95 ----
PyObject *rv;
! if ( !PyArg_ParseTuple(args, "s#iiiii",
&cp, &len, &size, &x, &y, &newx, &newy) )
return 0;
***************
*** 137,141 ****
! if ( !PyArg_Parse(args, "(s#iii)", &cp, &len, &width, &maxx, &maxy) )
return 0;
--- 137,141 ----
! if ( !PyArg_ParseTuple(args, "s#iii", &cp, &len, &width, &maxx, &maxy) )
return 0;
***************
*** 191,195 ****
! if ( !PyArg_Parse(args, "(s#iii)", &cp, &len, &x, &y, &tres) )
return 0;
--- 191,195 ----
! if ( !PyArg_ParseTuple(args, "s#iii", &cp, &len, &x, &y, &tres) )
return 0;
***************
*** 232,236 ****
! if ( !PyArg_Parse(args, "(s#ii)", &cp, &len, &x, &y) )
return 0;
--- 232,236 ----
! if ( !PyArg_ParseTuple(args, "s#ii", &cp, &len, &x, &y) )
return 0;
***************
*** 271,275 ****
! if ( !PyArg_Parse(args, "(s#ii)", &cp, &len, &x, &y) )
return 0;
--- 271,275 ----
! if ( !PyArg_ParseTuple(args, "s#ii", &cp, &len, &x, &y) )
return 0;
***************
*** 309,313 ****
! if ( !PyArg_Parse(args, "(s#ii)", &cp, &len, &x, &y) )
return 0;
--- 309,313 ----
! if ( !PyArg_ParseTuple(args, "s#ii", &cp, &len, &x, &y) )
return 0;
***************
*** 355,359 ****
! if ( !PyArg_Parse(args, "(s#ii)", &cp, &len, &x, &y) )
return 0;
--- 355,359 ----
! if ( !PyArg_ParseTuple(args, "s#ii", &cp, &len, &x, &y) )
return 0;
***************
*** 394,398 ****
int i, bit;
! if ( !PyArg_Parse(args, "(s#iiii)", &cp, &len, &x, &y, &v0, &v1) )
return 0;
--- 394,398 ----
int i, bit;
! if ( !PyArg_ParseTuple(args, "s#iiii", &cp, &len, &x, &y, &v0, &v1) )
return 0;
***************
*** 431,435 ****
int i, pos, value = 0, nvalue;
! if ( !PyArg_Parse(args, "(s#ii)", &cp, &len, &x, &y) )
return 0;
--- 431,435 ----
int i, pos, value = 0, nvalue;
! if ( !PyArg_ParseTuple(args, "s#ii", &cp, &len, &x, &y) )
return 0;
***************
*** 467,471 ****
int i, pos, value = 0, nvalue;
! if ( !PyArg_Parse(args, "(s#ii)", &cp, &len, &x, &y) )
return 0;
--- 467,471 ----
int i, pos, value = 0, nvalue;
! if ( !PyArg_ParseTuple(args, "s#ii", &cp, &len, &x, &y) )
return 0;
***************
*** 504,508 ****
Py_UInt32 value, nvalue;
! if ( !PyArg_Parse(args, "(s#ii)", &cp, &len, &x, &y) )
return 0;
--- 504,508 ----
Py_UInt32 value, nvalue;
! if ( !PyArg_ParseTuple(args, "s#ii", &cp, &len, &x, &y) )
return 0;
***************
*** 546,550 ****
Py_UInt32 value, nvalue;
! if ( !PyArg_Parse(args, "(s#ii)", &cp, &len, &x, &y) )
return 0;
--- 546,550 ----
Py_UInt32 value, nvalue;
! if ( !PyArg_ParseTuple(args, "s#ii", &cp, &len, &x, &y) )
return 0;
***************
*** 587,591 ****
Py_UInt32 value, nvalue;
! if ( !PyArg_Parse(args, "(s#ii)", &cp, &len, &x, &y) )
return 0;
--- 587,591 ----
Py_UInt32 value, nvalue;
! if ( !PyArg_ParseTuple(args, "s#ii", &cp, &len, &x, &y) )
return 0;
***************
*** 623,627 ****
Py_UInt32 value;
! if ( !PyArg_Parse(args, "(s#ii)", &cp, &len, &x, &y) )
return 0;
--- 623,627 ----
Py_UInt32 value;
! if ( !PyArg_ParseTuple(args, "s#ii", &cp, &len, &x, &y) )
return 0;
***************
*** 678,696 ****
static PyMethodDef imageop_methods[] = {
! { "crop", imageop_crop, METH_OLDARGS },
! { "scale", imageop_scale, METH_OLDARGS },
! { "grey2mono", imageop_grey2mono, METH_OLDARGS },
! { "grey2grey2", imageop_grey2grey2, METH_OLDARGS },
! { "grey2grey4", imageop_grey2grey4, METH_OLDARGS },
! { "dither2mono", imageop_dither2mono, METH_OLDARGS },
! { "dither2grey2", imageop_dither2grey2, METH_OLDARGS },
! { "mono2grey", imageop_mono2grey, METH_OLDARGS },
! { "grey22grey", imageop_grey22grey, METH_OLDARGS },
! { "grey42grey", imageop_grey42grey, METH_OLDARGS },
! { "tovideo", imageop_tovideo, METH_OLDARGS },
! { "rgb2rgb8", imageop_rgb2rgb8, METH_OLDARGS },
! { "rgb82rgb", imageop_rgb82rgb, METH_OLDARGS },
! { "rgb2grey", imageop_rgb2grey, METH_OLDARGS },
! { "grey2rgb", imageop_grey2rgb, METH_OLDARGS },
{ 0, 0 }
};
--- 678,696 ----
static PyMethodDef imageop_methods[] = {
! { "crop", imageop_crop, METH_VARARGS },
! { "scale", imageop_scale, METH_VARARGS },
! { "grey2mono", imageop_grey2mono, METH_VARARGS },
! { "grey2grey2", imageop_grey2grey2, METH_VARARGS },
! { "grey2grey4", imageop_grey2grey4, METH_VARARGS },
! { "dither2mono", imageop_dither2mono, METH_VARARGS },
! { "dither2grey2", imageop_dither2grey2, METH_VARARGS },
! { "mono2grey", imageop_mono2grey, METH_VARARGS },
! { "grey22grey", imageop_grey22grey, METH_VARARGS },
! { "grey42grey", imageop_grey42grey, METH_VARARGS },
! { "tovideo", imageop_tovideo, METH_VARARGS },
! { "rgb2rgb8", imageop_rgb2rgb8, METH_VARARGS },
! { "rgb82rgb", imageop_rgb82rgb, METH_VARARGS },
! { "rgb2grey", imageop_rgb2grey, METH_VARARGS },
! { "grey2rgb", imageop_grey2rgb, METH_VARARGS },
{ 0, 0 }
};
Index: clmodule.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Modules/clmodule.c,v
retrieving revision 2.27
retrieving revision 2.28
diff -C2 -d -r2.27 -r2.28
*** clmodule.c 31 Mar 2002 14:57:24 -0000 2.27
--- clmodule.c 2 Apr 2002 18:26:33 -0000 2.28
***************
*** 105,109 ****
PyObject *compressedBuffer;
! if (!PyArg_Parse(args, "(iiiifs#)", &compressionScheme,
&width, &height,
&originalFormat, &compressionRatio, &frameBuffer,
--- 105,109 ----
PyObject *compressedBuffer;
! if (!PyArg_ParseTuple(args, "iiiifs#", &compressionScheme,
&width, &height,
&originalFormat, &compressionRatio, &frameBuffer,
***************
*** 150,154 ****
PyObject *frameBuffer;
! if (!PyArg_Parse(args, "(iiiis#)", &compressionScheme, &width, &height,
&originalFormat, &compressedBuffer,
&compressedBufferSize))
--- 150,154 ----
PyObject *frameBuffer;
! if (!PyArg_ParseTuple(args, "iiiis#", &compressionScheme, &width, &height,
&originalFormat, &compressedBuffer,
&compressedBufferSize))
***************
*** 671,675 ****
clobject *new;
! if (!PyArg_Parse(args, "i", &scheme))
return NULL;
--- 671,675 ----
clobject *new;
! if (!PyArg_ParseTuple(args, "i", &scheme))
return NULL;
***************
*** 712,716 ****
int scheme;
! if (!PyArg_Parse(args, "s#", &header, &headerlen))
return NULL;
--- 712,716 ----
int scheme;
! if (!PyArg_ParseTuple(args, "s#", &header, &headerlen))
return NULL;
***************
*** 729,733 ****
int scheme;
! if (!PyArg_Parse(args, "i", &scheme))
return NULL;
--- 729,733 ----
int scheme;
! if (!PyArg_ParseTuple(args, "i", &scheme))
return NULL;
***************
*** 744,748 ****
int i;
! if (!PyArg_Parse(args, "i", &algorithmMediaType))
return NULL;
--- 744,748 ----
int i;
! if (!PyArg_ParseTuple(args, "i", &algorithmMediaType))
return NULL;
***************
*** 792,796 ****
int scheme;
! if (!PyArg_Parse(args, "(is)", &algorithmMediaType, &name))
return NULL;
--- 792,796 ----
int scheme;
! if (!PyArg_ParseTuple(args, "is", &algorithmMediaType, &name))
return NULL;
***************
*** 811,815 ****
char *name;
! if (!PyArg_Parse(args, "i", &scheme))
return NULL;
--- 811,815 ----
char *name;
! if (!PyArg_ParseTuple(args, "i", &scheme))
return NULL;
***************
*** 830,836 ****
int is_float = 0;
! if (!PyArg_Parse(args, "(iii)", &scheme, ¶mID, &value)) {
PyErr_Clear();
! if (!PyArg_Parse(args, "(iif)", &scheme, ¶mID, &fvalue)) {
PyErr_Clear();
PyErr_SetString(PyExc_TypeError,
--- 830,836 ----
int is_float = 0;
! if (!PyArg_ParseTuple(args, "iii", &scheme, ¶mID, &value)) {
PyErr_Clear();
! if (!PyArg_ParseTuple(args, "iif", &scheme, ¶mID, &fvalue)) {
PyErr_Clear();
PyErr_SetString(PyExc_TypeError,
***************
*** 885,889 ****
{ \
int x; \
! if (!PyArg_Parse(args, "i", &x)) return NULL; \
return Py##handler(CL_##name(x)); \
}
--- 885,889 ----
{ \
int x; \
! if (!PyArg_ParseTuple(args, "i", &x)) return NULL; \
return Py##handler(CL_##name(x)); \
}
***************
*** 893,897 ****
{ \
int a1, a2; \
! if (!PyArg_Parse(args, "(ii)", &a1, &a2)) return NULL; \
return Py##handler(CL_##name(a1, a2)); \
}
--- 893,897 ----
{ \
int a1, a2; \
! if (!PyArg_ParseTuple(args, "ii", &a1, &a2)) return NULL; \
return Py##handler(CL_##name(a1, a2)); \
}
***************
*** 927,954 ****
static PyMethodDef cl_methods[] = {
! {"CompressImage", cl_CompressImage, METH_OLDARGS},
! {"DecompressImage", cl_DecompressImage, METH_OLDARGS},
! {"GetAlgorithmName", cl_GetAlgorithmName, METH_OLDARGS},
! {"OpenCompressor", cl_OpenCompressor, METH_OLDARGS},
! {"OpenDecompressor", cl_OpenDecompressor, METH_OLDARGS},
! {"QueryAlgorithms", cl_QueryAlgorithms, METH_OLDARGS},
! {"QueryMaxHeaderSize", cl_QueryMaxHeaderSize, METH_OLDARGS},
! {"QueryScheme", cl_QueryScheme, METH_OLDARGS},
! {"QuerySchemeFromName", cl_QuerySchemeFromName, METH_OLDARGS},
! {"SetDefault", cl_SetDefault, METH_OLDARGS},
! {"SetMax", cl_SetMax, METH_OLDARGS},
! {"SetMin", cl_SetMin, METH_OLDARGS},
! {"BytesPerSample", cl_BytesPerSample, METH_OLDARGS},
! {"BytesPerPixel", cl_BytesPerPixel, METH_OLDARGS},
! {"AudioFormatName", cl_AudioFormatName, METH_OLDARGS},
! {"VideoFormatName", cl_VideoFormatName, METH_OLDARGS},
! {"AlgorithmNumber", cl_AlgorithmNumber, METH_OLDARGS},
! {"AlgorithmType", cl_AlgorithmType, METH_OLDARGS},
! {"Algorithm", cl_Algorithm, METH_OLDARGS},
! {"ParamNumber", cl_ParamNumber, METH_OLDARGS},
! {"ParamType", cl_ParamType, METH_OLDARGS},
! {"ParamID", cl_ParamID, METH_OLDARGS},
#ifdef CLDEBUG
! {"cvt_type", cvt_type, METH_OLDARGS},
#endif
{NULL, NULL} /* Sentinel */
--- 927,954 ----
static PyMethodDef cl_methods[] = {
! {"CompressImage", cl_CompressImage, METH_VARARGS},
! {"DecompressImage", cl_DecompressImage, METH_VARARGS},
! {"GetAlgorithmName", cl_GetAlgorithmName, METH_VARARGS},
! {"OpenCompressor", cl_OpenCompressor, METH_VARARGS},
! {"OpenDecompressor", cl_OpenDecompressor, METH_VARARGS},
! {"QueryAlgorithms", cl_QueryAlgorithms, METH_VARARGS},
! {"QueryMaxHeaderSize", cl_QueryMaxHeaderSize, METH_VARARGS},
! {"QueryScheme", cl_QueryScheme, METH_VARARGS},
! {"QuerySchemeFromName", cl_QuerySchemeFromName, METH_VARARGS},
! {"SetDefault", cl_SetDefault, METH_VARARGS},
! {"SetMax", cl_SetMax, METH_VARARGS},
! {"SetMin", cl_SetMin, METH_VARARGS},
! {"BytesPerSample", cl_BytesPerSample, METH_VARARGS},
! {"BytesPerPixel", cl_BytesPerPixel, METH_VARARGS},
! {"AudioFormatName", cl_AudioFormatName, METH_VARARGS},
! {"VideoFormatName", cl_VideoFormatName, METH_VARARGS},
! {"AlgorithmNumber", cl_AlgorithmNumber, METH_VARARGS},
! {"AlgorithmType", cl_AlgorithmType, METH_VARARGS},
! {"Algorithm", cl_Algorithm, METH_VARARGS},
! {"ParamNumber", cl_ParamNumber, METH_VARARGS},
! {"ParamType", cl_ParamType, METH_VARARGS},
! {"ParamID", cl_ParamID, METH_VARARGS},
#ifdef CLDEBUG
! {"cvt_type", cvt_type, METH_VARARGS},
#endif
{NULL, NULL} /* Sentinel */