mirror of
				https://github.com/python/cpython.git
				synced 2025-11-04 07:31:38 +00:00 
			
		
		
		
	Use METH_OLDARGS instead of numeric constant 0 in method def. tables
This commit is contained in:
		
							parent
							
								
									767bf49b6b
								
							
						
					
					
						commit
						a1abb728bc
					
				
					 9 changed files with 78 additions and 55 deletions
				
			
		| 
						 | 
					@ -31,7 +31,7 @@ the same alphabet as the salt.";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
static PyMethodDef crypt_methods[] = {
 | 
					static PyMethodDef crypt_methods[] = {
 | 
				
			||||||
	{"crypt",	crypt_crypt, 0, crypt_crypt__doc__},
 | 
						{"crypt",	crypt_crypt, METH_OLDARGS, crypt_crypt__doc__},
 | 
				
			||||||
	{NULL,		NULL}		/* sentinel */
 | 
						{NULL,		NULL}		/* sentinel */
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -126,9 +126,12 @@ Return a copy (``clone'') of the md5 object.";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
static PyMethodDef md5_methods[] = {
 | 
					static PyMethodDef md5_methods[] = {
 | 
				
			||||||
	{"update",		(PyCFunction)md5_update, 0, update_doc},
 | 
						{"update",		(PyCFunction)md5_update, 
 | 
				
			||||||
	{"digest",		(PyCFunction)md5_digest, 0, digest_doc},
 | 
						 METH_OLDARGS, update_doc},
 | 
				
			||||||
	{"copy",		(PyCFunction)md5_copy, 0, copy_doc},
 | 
						{"digest",		(PyCFunction)md5_digest, 
 | 
				
			||||||
 | 
						 METH_OLDARGS, digest_doc},
 | 
				
			||||||
 | 
						{"copy",		(PyCFunction)md5_copy, 
 | 
				
			||||||
 | 
						 METH_OLDARGS, copy_doc},
 | 
				
			||||||
	{NULL,			NULL}		/* sentinel */
 | 
						{NULL,			NULL}		/* sentinel */
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -128,10 +128,10 @@ pwd_getpwall(PyObject *self, PyObject *args)
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
static PyMethodDef pwd_methods[] = {
 | 
					static PyMethodDef pwd_methods[] = {
 | 
				
			||||||
	{"getpwuid",	pwd_getpwuid, 0, pwd_getpwuid__doc__},
 | 
						{"getpwuid",	pwd_getpwuid, METH_OLDARGS, pwd_getpwuid__doc__},
 | 
				
			||||||
	{"getpwnam",	pwd_getpwnam, 0, pwd_getpwnam__doc__},
 | 
						{"getpwnam",	pwd_getpwnam, METH_OLDARGS, pwd_getpwnam__doc__},
 | 
				
			||||||
#ifdef HAVE_GETPWENT
 | 
					#ifdef HAVE_GETPWENT
 | 
				
			||||||
	{"getpwall",	pwd_getpwall, 0, pwd_getpwall__doc__},
 | 
						{"getpwall",	pwd_getpwall, METH_OLDARGS, pwd_getpwall__doc__},
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
	{NULL,		NULL}		/* sentinel */
 | 
						{NULL,		NULL}		/* sentinel */
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -324,7 +324,8 @@ Insert text into the command line.\
 | 
				
			||||||
static struct PyMethodDef readline_methods[] =
 | 
					static struct PyMethodDef readline_methods[] =
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	{"parse_and_bind", parse_and_bind, METH_VARARGS, doc_parse_and_bind},
 | 
						{"parse_and_bind", parse_and_bind, METH_VARARGS, doc_parse_and_bind},
 | 
				
			||||||
	{"get_line_buffer", get_line_buffer, 0, doc_get_line_buffer},
 | 
						{"get_line_buffer", get_line_buffer, 
 | 
				
			||||||
 | 
						 METH_OLDARGS, doc_get_line_buffer},
 | 
				
			||||||
	{"insert_text", insert_text, METH_VARARGS, doc_insert_text},
 | 
						{"insert_text", insert_text, METH_VARARGS, doc_insert_text},
 | 
				
			||||||
	{"read_init_file", read_init_file, METH_VARARGS, doc_read_init_file},
 | 
						{"read_init_file", read_init_file, METH_VARARGS, doc_read_init_file},
 | 
				
			||||||
	{"read_history_file", read_history_file, 
 | 
						{"read_history_file", read_history_file, 
 | 
				
			||||||
| 
						 | 
					@ -336,13 +337,13 @@ static struct PyMethodDef readline_methods[] =
 | 
				
			||||||
 	{"get_history_length", get_history_length, 
 | 
					 	{"get_history_length", get_history_length, 
 | 
				
			||||||
	 METH_VARARGS, get_history_length_doc},
 | 
						 METH_VARARGS, get_history_length_doc},
 | 
				
			||||||
	{"set_completer", set_completer, METH_VARARGS, doc_set_completer},
 | 
						{"set_completer", set_completer, METH_VARARGS, doc_set_completer},
 | 
				
			||||||
	{"get_begidx", get_begidx, 0, doc_get_begidx},
 | 
						{"get_begidx", get_begidx, METH_OLDARGS, doc_get_begidx},
 | 
				
			||||||
	{"get_endidx", get_endidx, 0, doc_get_endidx},
 | 
						{"get_endidx", get_endidx, METH_OLDARGS, doc_get_endidx},
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	{"set_completer_delims", set_completer_delims, METH_VARARGS,
 | 
						{"set_completer_delims", set_completer_delims, 
 | 
				
			||||||
		doc_set_completer_delims},
 | 
						 METH_VARARGS, doc_set_completer_delims},
 | 
				
			||||||
	{"get_completer_delims", get_completer_delims, 0,
 | 
						{"get_completer_delims", get_completer_delims, 
 | 
				
			||||||
		doc_get_completer_delims},
 | 
						 METH_OLDARGS, doc_get_completer_delims},
 | 
				
			||||||
	{0, 0}
 | 
						{0, 0}
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -280,15 +280,15 @@ anything else -- the callable Python object used as a handler\n\
 | 
				
			||||||
/* List of functions defined in the module */
 | 
					/* List of functions defined in the module */
 | 
				
			||||||
static PyMethodDef signal_methods[] = {
 | 
					static PyMethodDef signal_methods[] = {
 | 
				
			||||||
#ifdef HAVE_ALARM
 | 
					#ifdef HAVE_ALARM
 | 
				
			||||||
	{"alarm",	        signal_alarm, 0, alarm_doc},
 | 
						{"alarm",	        signal_alarm, METH_OLDARGS, alarm_doc},
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
	{"signal",	        signal_signal, 0, signal_doc},
 | 
						{"signal",	        signal_signal, METH_OLDARGS, signal_doc},
 | 
				
			||||||
	{"getsignal",	        signal_getsignal, 0, getsignal_doc},
 | 
						{"getsignal",	        signal_getsignal, METH_OLDARGS, getsignal_doc},
 | 
				
			||||||
#ifdef HAVE_PAUSE
 | 
					#ifdef HAVE_PAUSE
 | 
				
			||||||
	{"pause",	        signal_pause, 0, pause_doc},
 | 
						{"pause",	        signal_pause, METH_OLDARGS, pause_doc},
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
	{"default_int_handler", signal_default_int_handler, 0,
 | 
						{"default_int_handler", signal_default_int_handler, 
 | 
				
			||||||
				default_int_handler_doc},
 | 
						 METH_OLDARGS, default_int_handler_doc},
 | 
				
			||||||
	{NULL,			NULL}		/* sentinel */
 | 
						{NULL,			NULL}		/* sentinel */
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1160,7 +1160,8 @@ strop_methods[] = {
 | 
				
			||||||
	 METH_VARARGS, atoi__doc__},
 | 
						 METH_VARARGS, atoi__doc__},
 | 
				
			||||||
	{"atol",	strop_atol, 
 | 
						{"atol",	strop_atol, 
 | 
				
			||||||
	 METH_VARARGS, atol__doc__},
 | 
						 METH_VARARGS, atol__doc__},
 | 
				
			||||||
	{"capitalize",	strop_capitalize, 0, capitalize__doc__},
 | 
						{"capitalize",	strop_capitalize, 
 | 
				
			||||||
 | 
						 METH_OLDARGS, capitalize__doc__},
 | 
				
			||||||
	{"count",	strop_count, 
 | 
						{"count",	strop_count, 
 | 
				
			||||||
	 METH_VARARGS, count__doc__},
 | 
						 METH_VARARGS, count__doc__},
 | 
				
			||||||
	{"expandtabs",	strop_expandtabs, 
 | 
						{"expandtabs",	strop_expandtabs, 
 | 
				
			||||||
| 
						 | 
					@ -1171,24 +1172,30 @@ strop_methods[] = {
 | 
				
			||||||
	 METH_VARARGS, joinfields__doc__},
 | 
						 METH_VARARGS, joinfields__doc__},
 | 
				
			||||||
	{"joinfields",	strop_joinfields, 
 | 
						{"joinfields",	strop_joinfields, 
 | 
				
			||||||
	 METH_VARARGS, joinfields__doc__},
 | 
						 METH_VARARGS, joinfields__doc__},
 | 
				
			||||||
	{"lstrip",	strop_lstrip, 0, lstrip__doc__},
 | 
						{"lstrip",	strop_lstrip, 
 | 
				
			||||||
	{"lower",	strop_lower, 0, lower__doc__},
 | 
						 METH_OLDARGS, lstrip__doc__},
 | 
				
			||||||
 | 
						{"lower",	strop_lower, 
 | 
				
			||||||
 | 
						 METH_OLDARGS, lower__doc__},
 | 
				
			||||||
	{"maketrans",	strop_maketrans, 
 | 
						{"maketrans",	strop_maketrans, 
 | 
				
			||||||
	 METH_VARARGS, maketrans__doc__},
 | 
						 METH_VARARGS, maketrans__doc__},
 | 
				
			||||||
	{"replace",	strop_replace, 
 | 
						{"replace",	strop_replace, 
 | 
				
			||||||
	 METH_VARARGS, replace__doc__},
 | 
						 METH_VARARGS, replace__doc__},
 | 
				
			||||||
	{"rfind",	strop_rfind, 
 | 
						{"rfind",	strop_rfind, 
 | 
				
			||||||
	 METH_VARARGS, rfind__doc__},
 | 
						 METH_VARARGS, rfind__doc__},
 | 
				
			||||||
	{"rstrip",	strop_rstrip, 0, rstrip__doc__},
 | 
						{"rstrip",	strop_rstrip, 
 | 
				
			||||||
 | 
						 METH_OLDARGS, rstrip__doc__},
 | 
				
			||||||
	{"split",	strop_splitfields, 
 | 
						{"split",	strop_splitfields, 
 | 
				
			||||||
	 METH_VARARGS, splitfields__doc__},
 | 
						 METH_VARARGS, splitfields__doc__},
 | 
				
			||||||
	{"splitfields",	strop_splitfields, 
 | 
						{"splitfields",	strop_splitfields, 
 | 
				
			||||||
	 METH_VARARGS, splitfields__doc__},
 | 
						 METH_VARARGS, splitfields__doc__},
 | 
				
			||||||
	{"strip",	strop_strip, 0, strip__doc__},
 | 
						{"strip",	strop_strip, 
 | 
				
			||||||
	{"swapcase",	strop_swapcase, 0, swapcase__doc__},
 | 
						 METH_OLDARGS, strip__doc__},
 | 
				
			||||||
 | 
						{"swapcase",	strop_swapcase, 
 | 
				
			||||||
 | 
						 METH_OLDARGS, swapcase__doc__},
 | 
				
			||||||
	{"translate",	strop_translate, 
 | 
						{"translate",	strop_translate, 
 | 
				
			||||||
	 METH_VARARGS, translate__doc__},
 | 
						 METH_VARARGS, translate__doc__},
 | 
				
			||||||
	{"upper",	strop_upper, 0, upper__doc__},
 | 
						{"upper",	strop_upper, 
 | 
				
			||||||
 | 
						 METH_OLDARGS, upper__doc__},
 | 
				
			||||||
	{NULL,		NULL}	/* sentinel */
 | 
						{NULL,		NULL}	/* sentinel */
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -278,12 +278,18 @@ termios_tcflow(PyObject *self, PyObject *args)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
static PyMethodDef termios_methods[] =
 | 
					static PyMethodDef termios_methods[] =
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	{"tcgetattr", termios_tcgetattr, 0, termios_tcgetattr__doc__},
 | 
						{"tcgetattr", termios_tcgetattr, 
 | 
				
			||||||
	{"tcsetattr", termios_tcsetattr, 0, termios_tcsetattr__doc__},
 | 
						 METH_OLDARGS, termios_tcgetattr__doc__},
 | 
				
			||||||
	{"tcsendbreak", termios_tcsendbreak, 0, termios_tcsendbreak__doc__},
 | 
						{"tcsetattr", termios_tcsetattr, 
 | 
				
			||||||
	{"tcdrain", termios_tcdrain, 0, termios_tcdrain__doc__},
 | 
						 METH_OLDARGS, termios_tcsetattr__doc__},
 | 
				
			||||||
	{"tcflush", termios_tcflush, 0, termios_tcflush__doc__},
 | 
						{"tcsendbreak", termios_tcsendbreak, 
 | 
				
			||||||
	{"tcflow", termios_tcflow, 0, termios_tcflow__doc__},
 | 
						 METH_OLDARGS, termios_tcsendbreak__doc__},
 | 
				
			||||||
 | 
						{"tcdrain", termios_tcdrain, 
 | 
				
			||||||
 | 
						 METH_OLDARGS, termios_tcdrain__doc__},
 | 
				
			||||||
 | 
						{"tcflush", termios_tcflush, 
 | 
				
			||||||
 | 
						 METH_OLDARGS, termios_tcflush__doc__},
 | 
				
			||||||
 | 
						{"tcflow", termios_tcflow, 
 | 
				
			||||||
 | 
						 METH_OLDARGS, termios_tcflow__doc__},
 | 
				
			||||||
	{NULL, NULL}
 | 
						{NULL, NULL}
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -141,12 +141,18 @@ static char locked_doc[] =
 | 
				
			||||||
Return whether the lock is in the locked state.";
 | 
					Return whether the lock is in the locked state.";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
static PyMethodDef lock_methods[] = {
 | 
					static PyMethodDef lock_methods[] = {
 | 
				
			||||||
	{"acquire_lock", (PyCFunction)lock_PyThread_acquire_lock, 0, acquire_doc},
 | 
						{"acquire_lock", (PyCFunction)lock_PyThread_acquire_lock, 
 | 
				
			||||||
	{"acquire",      (PyCFunction)lock_PyThread_acquire_lock, 0, acquire_doc},
 | 
						 METH_OLDARGS, acquire_doc},
 | 
				
			||||||
	{"release_lock", (PyCFunction)lock_PyThread_release_lock, 0, release_doc},
 | 
						{"acquire",      (PyCFunction)lock_PyThread_acquire_lock, 
 | 
				
			||||||
	{"release",      (PyCFunction)lock_PyThread_release_lock, 0, release_doc},
 | 
						 METH_OLDARGS, acquire_doc},
 | 
				
			||||||
	{"locked_lock",  (PyCFunction)lock_locked_lock,  0, locked_doc},
 | 
						{"release_lock", (PyCFunction)lock_PyThread_release_lock, 
 | 
				
			||||||
	{"locked",       (PyCFunction)lock_locked_lock,  0, locked_doc},
 | 
						 METH_OLDARGS, release_doc},
 | 
				
			||||||
 | 
						{"release",      (PyCFunction)lock_PyThread_release_lock, 
 | 
				
			||||||
 | 
						 METH_OLDARGS, release_doc},
 | 
				
			||||||
 | 
						{"locked_lock",  (PyCFunction)lock_locked_lock,  
 | 
				
			||||||
 | 
						 METH_OLDARGS, locked_doc},
 | 
				
			||||||
 | 
						{"locked",       (PyCFunction)lock_locked_lock,  
 | 
				
			||||||
 | 
						 METH_OLDARGS, locked_doc},
 | 
				
			||||||
	{NULL,           NULL}		/* sentinel */
 | 
						{NULL,           NULL}		/* sentinel */
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -343,16 +349,16 @@ static PyMethodDef thread_methods[] = {
 | 
				
			||||||
	{"start_new",		(PyCFunction)thread_PyThread_start_new_thread, 
 | 
						{"start_new",		(PyCFunction)thread_PyThread_start_new_thread, 
 | 
				
			||||||
	                        METH_VARARGS,
 | 
						                        METH_VARARGS,
 | 
				
			||||||
				start_new_doc},
 | 
									start_new_doc},
 | 
				
			||||||
	{"allocate_lock",	(PyCFunction)thread_PyThread_allocate_lock, 0,
 | 
						{"allocate_lock",	(PyCFunction)thread_PyThread_allocate_lock, 
 | 
				
			||||||
				allocate_doc},
 | 
						 METH_OLDARGS, allocate_doc},
 | 
				
			||||||
	{"allocate",		(PyCFunction)thread_PyThread_allocate_lock, 0,
 | 
						{"allocate",		(PyCFunction)thread_PyThread_allocate_lock, 
 | 
				
			||||||
				allocate_doc},
 | 
						 METH_OLDARGS, allocate_doc},
 | 
				
			||||||
	{"exit_thread",		(PyCFunction)thread_PyThread_exit_thread, 0,
 | 
						{"exit_thread",		(PyCFunction)thread_PyThread_exit_thread, 
 | 
				
			||||||
				exit_doc},
 | 
						 METH_OLDARGS, exit_doc},
 | 
				
			||||||
	{"exit",		(PyCFunction)thread_PyThread_exit_thread, 0,
 | 
						{"exit",		(PyCFunction)thread_PyThread_exit_thread, 
 | 
				
			||||||
				exit_doc},
 | 
						 METH_OLDARGS, exit_doc},
 | 
				
			||||||
	{"get_ident",		(PyCFunction)thread_get_ident, 0,
 | 
						{"get_ident",		(PyCFunction)thread_get_ident, 
 | 
				
			||||||
				get_ident_doc},
 | 
						 METH_OLDARGS, get_ident_doc},
 | 
				
			||||||
#ifndef NO_EXIT_PROG
 | 
					#ifndef NO_EXIT_PROG
 | 
				
			||||||
	{"exit_prog",		(PyCFunction)thread_PyThread_exit_prog},
 | 
						{"exit_prog",		(PyCFunction)thread_PyThread_exit_prog},
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -491,15 +491,15 @@ Convert a time tuple in local time to seconds since the Epoch.";
 | 
				
			||||||
#endif /* HAVE_MKTIME */
 | 
					#endif /* HAVE_MKTIME */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
static PyMethodDef time_methods[] = {
 | 
					static PyMethodDef time_methods[] = {
 | 
				
			||||||
	{"time",	time_time, 0, time_doc},
 | 
						{"time",	time_time, METH_OLDARGS, time_doc},
 | 
				
			||||||
#ifdef HAVE_CLOCK
 | 
					#ifdef HAVE_CLOCK
 | 
				
			||||||
	{"clock",	time_clock, 0, clock_doc},
 | 
						{"clock",	time_clock, METH_OLDARGS, clock_doc},
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
	{"sleep",	time_sleep, 0, sleep_doc},
 | 
						{"sleep",	time_sleep, METH_OLDARGS, sleep_doc},
 | 
				
			||||||
	{"gmtime",	time_gmtime, 0, gmtime_doc},
 | 
						{"gmtime",	time_gmtime, METH_OLDARGS, gmtime_doc},
 | 
				
			||||||
	{"localtime",	time_localtime, 0, localtime_doc},
 | 
						{"localtime",	time_localtime, METH_OLDARGS, localtime_doc},
 | 
				
			||||||
	{"asctime",	time_asctime, METH_VARARGS, asctime_doc},
 | 
						{"asctime",	time_asctime, METH_VARARGS, asctime_doc},
 | 
				
			||||||
	{"ctime",	time_ctime, 0, ctime_doc},
 | 
						{"ctime",	time_ctime, METH_OLDARGS, ctime_doc},
 | 
				
			||||||
#ifdef HAVE_MKTIME
 | 
					#ifdef HAVE_MKTIME
 | 
				
			||||||
	{"mktime",	time_mktime, METH_VARARGS, mktime_doc},
 | 
						{"mktime",	time_mktime, METH_VARARGS, mktime_doc},
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue