[Python-checkins] CVS: python/dist/src/Modules structmodule.c,2.53,2.54 stropmodule.c,2.86,2.87

Neal Norwitz nnorwitz@users.sourceforge.net
2002年4月02日 10:18:00 -0800


Update of /cvsroot/python/python/dist/src/Modules
In directory usw-pr-cvs1:/tmp/cvs-serv28376
Modified Files:
	structmodule.c stropmodule.c 
Log Message:
Get rid of more PyArg_Parse & METH_OLDARGS.
 PyArg_Parse( "s" ) -> PyString_AsString
 PyArg_Parse( "t#" ) -> PyString_AsStringAndSize
Index: structmodule.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Modules/structmodule.c,v
retrieving revision 2.53
retrieving revision 2.54
diff -C2 -d -r2.53 -r2.54
*** structmodule.c	14 Feb 2002 07:16:30 -0000	2.53
--- structmodule.c	2 Apr 2002 18:17:55 -0000	2.54
***************
*** 1274,1278 ****
 	}
 	format = PyTuple_GetItem(args, 0);
! 	if (!PyArg_Parse(format, "s", &fmt))
 		return NULL;
 	f = whichtable(&fmt);
--- 1274,1279 ----
 	}
 	format = PyTuple_GetItem(args, 0);
! 	fmt = PyString_AsString(format);
! 	if (!fmt)
 		return NULL;
 	f = whichtable(&fmt);
Index: stropmodule.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Modules/stropmodule.c,v
retrieving revision 2.86
retrieving revision 2.87
diff -C2 -d -r2.86 -r2.87
*** stropmodule.c	1 Apr 2002 14:53:37 -0000	2.86
--- stropmodule.c	2 Apr 2002 18:17:57 -0000	2.87
***************
*** 377,381 ****
 
 
! 	if (!PyArg_Parse(args, "t#", &s, &len))
 		return NULL;
 
--- 377,381 ----
 
 
! 	if (PyString_AsStringAndSize(args, &s, &len))
 		return NULL;
 
***************
*** 458,462 ****
 
 	WARN;
! 	if (!PyArg_Parse(args, "t#", &s, &n))
 		return NULL;
 	new = PyString_FromStringAndSize(NULL, n);
--- 458,462 ----
 
 	WARN;
! 	if (PyString_AsStringAndSize(args, &s, &n))
 		return NULL;
 	new = PyString_FromStringAndSize(NULL, n);
***************
*** 497,501 ****
 
 	WARN;
! 	if (!PyArg_Parse(args, "t#", &s, &n))
 		return NULL;
 	new = PyString_FromStringAndSize(NULL, n);
--- 497,501 ----
 
 	WARN;
! 	if (PyString_AsStringAndSize(args, &s, &n))
 		return NULL;
 	new = PyString_FromStringAndSize(NULL, n);
***************
*** 537,541 ****
 
 	WARN;
! 	if (!PyArg_Parse(args, "t#", &s, &n))
 		return NULL;
 	new = PyString_FromStringAndSize(NULL, n);
--- 537,541 ----
 
 	WARN;
! 	if (PyString_AsStringAndSize(args, &s, &n))
 		return NULL;
 	new = PyString_FromStringAndSize(NULL, n);
***************
*** 703,707 ****
 
 	WARN;
! 	if (!PyArg_Parse(args, "t#", &s, &n))
 		return NULL;
 	new = PyString_FromStringAndSize(NULL, n);
--- 703,707 ----
 
 	WARN;
! 	if (PyString_AsStringAndSize(args, &s, &n))
 		return NULL;
 	new = PyString_FromStringAndSize(NULL, n);
***************
*** 1191,1195 ****
 	{"atoi",	strop_atoi,	 METH_VARARGS, atoi__doc__},
 	{"atol",	strop_atol,	 METH_VARARGS, atol__doc__},
! 	{"capitalize",	strop_capitalize, METH_OLDARGS, capitalize__doc__},
 	{"count",	strop_count,	 METH_VARARGS, count__doc__},
 	{"expandtabs",	strop_expandtabs, METH_VARARGS, expandtabs__doc__},
--- 1191,1195 ----
 	{"atoi",	strop_atoi,	 METH_VARARGS, atoi__doc__},
 	{"atol",	strop_atol,	 METH_VARARGS, atol__doc__},
! 	{"capitalize",	strop_capitalize, METH_O, capitalize__doc__},
 	{"count",	strop_count,	 METH_VARARGS, count__doc__},
 	{"expandtabs",	strop_expandtabs, METH_VARARGS, expandtabs__doc__},
***************
*** 1197,1212 ****
 	{"join",	strop_joinfields, METH_VARARGS, joinfields__doc__},
 	{"joinfields",	strop_joinfields, METH_VARARGS, joinfields__doc__},
! 	{"lstrip",	strop_lstrip,	 METH_OLDARGS, lstrip__doc__},
! 	{"lower",	strop_lower,	 METH_OLDARGS, lower__doc__},
 	{"maketrans",	strop_maketrans, METH_VARARGS, maketrans__doc__},
 	{"replace",	strop_replace,	 METH_VARARGS, replace__doc__},
 	{"rfind",	strop_rfind,	 METH_VARARGS, rfind__doc__},
! 	{"rstrip",	strop_rstrip,	 METH_OLDARGS, rstrip__doc__},
 	{"split",	strop_splitfields, METH_VARARGS, splitfields__doc__},
 	{"splitfields",	strop_splitfields, METH_VARARGS, splitfields__doc__},
! 	{"strip",	strop_strip,	 METH_OLDARGS, strip__doc__},
! 	{"swapcase",	strop_swapcase, METH_OLDARGS, swapcase__doc__},
 	{"translate",	strop_translate, METH_VARARGS, translate__doc__},
! 	{"upper",	strop_upper,	 METH_OLDARGS, upper__doc__},
 	{NULL,		NULL}	/* sentinel */
 };
--- 1197,1212 ----
 	{"join",	strop_joinfields, METH_VARARGS, joinfields__doc__},
 	{"joinfields",	strop_joinfields, METH_VARARGS, joinfields__doc__},
! 	{"lstrip",	strop_lstrip,	 METH_O, lstrip__doc__},
! 	{"lower",	strop_lower,	 METH_O, lower__doc__},
 	{"maketrans",	strop_maketrans, METH_VARARGS, maketrans__doc__},
 	{"replace",	strop_replace,	 METH_VARARGS, replace__doc__},
 	{"rfind",	strop_rfind,	 METH_VARARGS, rfind__doc__},
! 	{"rstrip",	strop_rstrip,	 METH_O, rstrip__doc__},
 	{"split",	strop_splitfields, METH_VARARGS, splitfields__doc__},
 	{"splitfields",	strop_splitfields, METH_VARARGS, splitfields__doc__},
! 	{"strip",	strop_strip,	 METH_O, strip__doc__},
! 	{"swapcase",	strop_swapcase, METH_O, swapcase__doc__},
 	{"translate",	strop_translate, METH_VARARGS, translate__doc__},
! 	{"upper",	strop_upper,	 METH_O, upper__doc__},
 	{NULL,		NULL}	/* sentinel */
 };

AltStyle によって変換されたページ (->オリジナル) /