[Python-checkins] CVS: python/dist/src/Modules timingmodule.c,2.9,2.10 fmmodule.c,1.19,1.20 clmodule.c,2.26,2.27

Neal Norwitz nnorwitz@users.sourceforge.net
Sun, 31 Mar 2002 06:57:26 -0800


Update of /cvsroot/python/python/dist/src/Modules
In directory usw-pr-cvs1:/tmp/cvs-serv18584

Modified Files:
	timingmodule.c fmmodule.c clmodule.c 
Log Message:
Convert from using METH_OLDARGS to METH_NOARGS.
These should be safe.


Index: timingmodule.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Modules/timingmodule.c,v
retrieving revision 2.9
retrieving revision 2.10
diff -C2 -d -r2.9 -r2.10
*** timingmodule.c	17 Jan 2002 23:15:58 -0000	2.9
--- timingmodule.c	31 Mar 2002 14:57:24 -0000	2.10
***************
*** 9,17 ****
  
  static PyObject *
! start_timing(PyObject *self, PyObject *args)
  {
- 	if (!PyArg_Parse(args, ""))
- 		return NULL;
- 
  	Py_INCREF(Py_None);
  	BEGINTIMING;
--- 9,14 ----
  
  static PyObject *
! start_timing(PyObject *self)
  {
  	Py_INCREF(Py_None);
  	BEGINTIMING;
***************
*** 20,28 ****
  
  static PyObject *
! finish_timing(PyObject *self, PyObject *args)
  {
- 	if (!PyArg_Parse(args, ""))
- 		return NULL;
- 
  	ENDTIMING    
  	Py_INCREF(Py_None);
--- 17,22 ----
  
  static PyObject *
! finish_timing(PyObject *self)
  {
  	ENDTIMING    
  	Py_INCREF(Py_None);
***************
*** 31,69 ****
  
  static PyObject *
! seconds(PyObject *self, PyObject *args)
  {
- 	if (!PyArg_Parse(args, ""))
- 		return NULL;
- 
  	return PyInt_FromLong(TIMINGS);
- 
  }
  
  static PyObject *
! milli(PyObject *self, PyObject *args)
  {
- 	if (!PyArg_Parse(args, ""))
- 		return NULL;
- 
  	return PyInt_FromLong(TIMINGMS);
- 
  }
  static PyObject *
! micro(PyObject *self, PyObject *args)
  {
- 	if (!PyArg_Parse(args, ""))
- 		return NULL;
- 
  	return PyInt_FromLong(TIMINGUS);
- 
  }
  
  
  static PyMethodDef timing_methods[] = {
! 	{"start",   start_timing, METH_OLDARGS},
! 	{"finish",  finish_timing, METH_OLDARGS},
! 	{"seconds", seconds, METH_OLDARGS},
! 	{"milli",   milli, METH_OLDARGS},
! 	{"micro",   micro, METH_OLDARGS},
  	{NULL,      NULL}
  };
--- 25,52 ----
  
  static PyObject *
! seconds(PyObject *self)
  {
  	return PyInt_FromLong(TIMINGS);
  }
  
  static PyObject *
! milli(PyObject *self)
  {
  	return PyInt_FromLong(TIMINGMS);
  }
+ 
  static PyObject *
! micro(PyObject *self)
  {
  	return PyInt_FromLong(TIMINGUS);
  }
  
  
  static PyMethodDef timing_methods[] = {
! 	{"start",   (PyCFunction)start_timing, METH_NOARGS},
! 	{"finish",  (PyCFunction)finish_timing, METH_NOARGS},
! 	{"seconds", (PyCFunction)seconds, METH_NOARGS},
! 	{"milli",   (PyCFunction)milli, METH_NOARGS},
! 	{"micro",   (PyCFunction)micro, METH_NOARGS},
  	{NULL,      NULL}
  };

Index: fmmodule.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Modules/fmmodule.c,v
retrieving revision 1.19
retrieving revision 1.20
diff -C2 -d -r1.19 -r1.20
*** fmmodule.c	17 Jan 2002 23:15:58 -0000	1.19
--- fmmodule.c	31 Mar 2002 14:57:24 -0000	1.20
***************
*** 50,57 ****
  
  static PyObject *
! fh_setfont(fhobject *self, PyObject *args)
  {
- 	if (!PyArg_NoArgs(args))
- 		return NULL;
  	fmsetfont(self->fh_fh);
  	Py_INCREF(Py_None);
--- 50,55 ----
  
  static PyObject *
! fh_setfont(fhobject *self)
  {
  	fmsetfont(self->fh_fh);
  	Py_INCREF(Py_None);
***************
*** 60,69 ****
  
  static PyObject *
! fh_getfontname(fhobject *self, PyObject *args)
  {
  	char fontname[256];
  	int len;
- 	if (!PyArg_NoArgs(args))
- 		return NULL;
  	len = fmgetfontname(self->fh_fh, sizeof fontname, fontname);
  	if (len < 0) {
--- 58,65 ----
  
  static PyObject *
! fh_getfontname(fhobject *self)
  {
  	char fontname[256];
  	int len;
  	len = fmgetfontname(self->fh_fh, sizeof fontname, fontname);
  	if (len < 0) {
***************
*** 75,84 ****
  
  static PyObject *
! fh_getcomment(fhobject *self, PyObject *args)
  {
  	char comment[256];
  	int len;
- 	if (!PyArg_NoArgs(args))
- 		return NULL;
  	len = fmgetcomment(self->fh_fh, sizeof comment, comment);
  	if (len < 0) {
--- 71,78 ----
  
  static PyObject *
! fh_getcomment(fhobject *self)
  {
  	char comment[256];
  	int len;
  	len = fmgetcomment(self->fh_fh, sizeof comment, comment);
  	if (len < 0) {
***************
*** 90,98 ****
  
  static PyObject *
! fh_getfontinfo(fhobject *self, PyObject *args)
  {
  	fmfontinfo info;
- 	if (!PyArg_NoArgs(args))
- 		return NULL;
  	if (fmgetfontinfo(self->fh_fh, &info) < 0) {
  		PyErr_SetString(PyExc_RuntimeError, "error in fmgetfontinfo");
--- 84,90 ----
  
  static PyObject *
! fh_getfontinfo(fhobject *self)
  {
  	fmfontinfo info;
  	if (fmgetfontinfo(self->fh_fh, &info) < 0) {
  		PyErr_SetString(PyExc_RuntimeError, "error in fmgetfontinfo");
***************
*** 127,135 ****
  
  static PyMethodDef fh_methods[] = {
! 	{"scalefont",	(PyCFunction)fh_scalefont, METH_OLDARGS},
! 	{"setfont",	(PyCFunction)fh_setfont, METH_OLDARGS},
! 	{"getfontname",	(PyCFunction)fh_getfontname, METH_OLDARGS},
! 	{"getcomment",	(PyCFunction)fh_getcomment, METH_OLDARGS},
! 	{"getfontinfo",	(PyCFunction)fh_getfontinfo, METH_OLDARGS},
  #if 0
  	{"getwholemetrics",	(PyCFunction)fh_getwholemetrics, METH_OLDARGS},
--- 119,127 ----
  
  static PyMethodDef fh_methods[] = {
! 	{"scalefont",	(PyCFunction)fh_scalefont,   METH_OLDARGS},
! 	{"setfont",	(PyCFunction)fh_setfont,     METH_NOARGS},
! 	{"getfontname",	(PyCFunction)fh_getfontname, METH_NOARGS},
! 	{"getcomment",	(PyCFunction)fh_getcomment,  METH_NOARGS},
! 	{"getfontinfo",	(PyCFunction)fh_getfontinfo, METH_NOARGS},
  #if 0
  	{"getwholemetrics",	(PyCFunction)fh_getwholemetrics, METH_OLDARGS},
***************
*** 171,178 ****
  
  static PyObject *
! fm_init(PyObject *self, PyObject *args)
  {
- 	if (!PyArg_NoArgs(args))
- 		return NULL;
  	fminit();
  	Py_INCREF(Py_None);
--- 163,168 ----
  
  static PyObject *
! fm_init(PyObject *self)
  {
  	fminit();
  	Py_INCREF(Py_None);
***************
*** 225,233 ****
  
  static PyObject *
! fm_enumerate(PyObject *self, PyObject *args)
  {
  	PyObject *res;
- 	if (!PyArg_NoArgs(args))
- 		return NULL;
  	fontlist = PyList_New(0);
  	if (fontlist == NULL)
--- 215,221 ----
  
  static PyObject *
! fm_enumerate(PyObject *self)
  {
  	PyObject *res;
  	fontlist = PyList_New(0);
  	if (fontlist == NULL)
***************
*** 251,268 ****
  
  static PyObject *
! fm_fontpath(PyObject *self, PyObject *args)
  {
- 	if (!PyArg_NoArgs(args))
- 		return NULL;
  	return PyString_FromString(fmfontpath());
  }
  
  static PyMethodDef fm_methods[] = {
! 	{"init",	fm_init, METH_OLDARGS},
! 	{"findfont",	fm_findfont, METH_OLDARGS},
! 	{"enumerate",	fm_enumerate, METH_OLDARGS},
! 	{"prstr",	fm_prstr, METH_OLDARGS},
! 	{"setpath",	fm_setpath, METH_OLDARGS},
! 	{"fontpath",	fm_fontpath, METH_OLDARGS},
  	{NULL,		NULL}		/* sentinel */
  };
--- 239,254 ----
  
  static PyObject *
! fm_fontpath(PyObject *self)
  {
  	return PyString_FromString(fmfontpath());
  }
  
  static PyMethodDef fm_methods[] = {
! 	{"init",	fm_init,      METH_NOARGS},
! 	{"findfont",	fm_findfont,  METH_OLDARGS},
! 	{"enumerate",	fm_enumerate, METH_NOARGS},
! 	{"prstr",	fm_prstr,     METH_OLDARGS},
! 	{"setpath",	fm_setpath,   METH_OLDARGS},
! 	{"fontpath",	fm_fontpath,  METH_NOARGS},
  	{NULL,		NULL}		/* sentinel */
  };

Index: clmodule.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Modules/clmodule.c,v
retrieving revision 2.26
retrieving revision 2.27
diff -C2 -d -r2.26 -r2.27
*** clmodule.c	17 Jan 2002 23:15:58 -0000	2.26
--- clmodule.c	31 Mar 2002 14:57:24 -0000	2.27
***************
*** 184,194 ****
  
  static PyObject *
! doClose(clobject *self, PyObject *args, int (*close_func)(CL_Handle))
  {
  	CheckCompressor(self);
  
- 	if (!PyArg_NoArgs(args))
- 		return NULL;
- 
  	error_handler_called = 0;
  	if ((*close_func)(self->ob_compressorHdl) == FAILURE ||
--- 184,191 ----
  
  static PyObject *
! doClose(clobject *self, int (*close_func)(CL_Handle))
  {
  	CheckCompressor(self);
  
  	error_handler_called = 0;
  	if ((*close_func)(self->ob_compressorHdl) == FAILURE ||
***************
*** 210,222 ****
  
  static PyObject *
! clm_CloseCompressor(PyObject *self, PyObject *args)
  {
! 	return doClose(SELF, args, clCloseCompressor);
  }
  
  static PyObject *
! clm_CloseDecompressor(PyObject *self, PyObject *args)
  {
! 	return doClose(SELF, args, clCloseDecompressor);
  }
  
--- 207,219 ----
  
  static PyObject *
! clm_CloseCompressor(PyObject *self)
  {
! 	return doClose(SELF, clCloseCompressor);
  }
  
  static PyObject *
! clm_CloseDecompressor(PyObject *self)
  {
! 	return doClose(SELF, clCloseDecompressor);
  }
  
***************
*** 480,484 ****
  
  static PyObject *
! clm_QueryParams(PyObject *self, PyObject *args)
  {
  	int bufferlength;
--- 477,481 ----
  
  static PyObject *
! clm_QueryParams(PyObject *self)
  {
  	int bufferlength;
***************
*** 489,495 ****
  	CheckCompressor(SELF);
  
- 	if (!PyArg_NoArgs(args))
- 		return NULL;
- 
  	error_handler_called = 0;
  	bufferlength = clQueryParams(SELF->ob_compressorHdl, 0, 0);
--- 486,489 ----
***************
*** 575,585 ****
  
  static PyObject *
! clm_QuerySchemeFromHandle(PyObject *self, PyObject *args)
  {
  	CheckCompressor(SELF);
- 
- 	if (!PyArg_NoArgs(args))
- 		return NULL;
- 
  	return PyInt_FromLong(clQuerySchemeFromHandle(SELF->ob_compressorHdl));
  }
--- 569,575 ----
  
  static PyObject *
! clm_QuerySchemeFromHandle(PyObject *self)
  {
  	CheckCompressor(SELF);
  	return PyInt_FromLong(clQuerySchemeFromHandle(SELF->ob_compressorHdl));
  }
***************
*** 601,606 ****
  
  static PyMethodDef compressor_methods[] = {
! 	{"close",		clm_CloseCompressor, METH_OLDARGS}, /* alias */
! 	{"CloseCompressor",	clm_CloseCompressor, METH_OLDARGS},
  	{"Compress",		clm_Compress, METH_OLDARGS},
  	{"GetDefault",		clm_GetDefault, METH_OLDARGS},
--- 591,596 ----
  
  static PyMethodDef compressor_methods[] = {
! 	{"close",		clm_CloseCompressor, METH_NOARGS}, /* alias */
! 	{"CloseCompressor",	clm_CloseCompressor, METH_NOARGS},
  	{"Compress",		clm_Compress, METH_OLDARGS},
  	{"GetDefault",		clm_GetDefault, METH_OLDARGS},
***************
*** 610,615 ****
  	{"GetParamID",		clm_GetParamID, METH_OLDARGS},
  	{"GetParams",		clm_GetParams, METH_OLDARGS},
! 	{"QueryParams",		clm_QueryParams, METH_OLDARGS},
! 	{"QuerySchemeFromHandle",clm_QuerySchemeFromHandle, METH_OLDARGS},
  	{"SetParam",		clm_SetParam, METH_OLDARGS},
  	{"SetParams",		clm_SetParams, METH_OLDARGS},
--- 600,605 ----
  	{"GetParamID",		clm_GetParamID, METH_OLDARGS},
  	{"GetParams",		clm_GetParams, METH_OLDARGS},
! 	{"QueryParams",		clm_QueryParams, METH_NOARGS},
! 	{"QuerySchemeFromHandle",clm_QuerySchemeFromHandle, METH_NOARGS},
  	{"SetParam",		clm_SetParam, METH_OLDARGS},
  	{"SetParams",		clm_SetParams, METH_OLDARGS},
***************
*** 618,623 ****
  
  static PyMethodDef decompressor_methods[] = {
! 	{"close",		clm_CloseDecompressor, METH_OLDARGS},	/* alias */
! 	{"CloseDecompressor",	clm_CloseDecompressor, METH_OLDARGS},
  	{"Decompress",		clm_Decompress, METH_OLDARGS},
  	{"GetDefault",		clm_GetDefault, METH_OLDARGS},
--- 608,613 ----
  
  static PyMethodDef decompressor_methods[] = {
! 	{"close",		clm_CloseDecompressor, METH_NOARGS},	/* alias */
! 	{"CloseDecompressor",	clm_CloseDecompressor, METH_NOARGS},
  	{"Decompress",		clm_Decompress, METH_OLDARGS},
  	{"GetDefault",		clm_GetDefault, METH_OLDARGS},
***************
*** 628,633 ****
  	{"GetParams",		clm_GetParams, METH_OLDARGS},
  	{"ReadHeader",		clm_ReadHeader, METH_OLDARGS},
! 	{"QueryParams",		clm_QueryParams, METH_OLDARGS},
! 	{"QuerySchemeFromHandle",clm_QuerySchemeFromHandle, METH_OLDARGS},
  	{"SetParam",		clm_SetParam, METH_OLDARGS},
  	{"SetParams",		clm_SetParams, METH_OLDARGS},
--- 618,623 ----
  	{"GetParams",		clm_GetParams, METH_OLDARGS},
  	{"ReadHeader",		clm_ReadHeader, METH_OLDARGS},
! 	{"QueryParams",		clm_QueryParams, METH_NOARGS},
! 	{"QuerySchemeFromHandle",clm_QuerySchemeFromHandle, METH_NOARGS},
  	{"SetParam",		clm_SetParam, METH_OLDARGS},
  	{"SetParams",		clm_SetParams, METH_OLDARGS},