Patch #477750: Use METH_ constants in Modules. · pythoncapi/cpython@43b936d · GitHub
Skip to content

Commit 43b936d

Browse files
committed
Patch #477750: Use METH_ constants in Modules.
1 parent c0e1671 commit 43b936d

27 files changed

Lines changed: 449 additions & 449 deletions

Modules/_codecsmodule.c

Lines changed: 29 additions & 29 deletions

Modules/_tkinter.c

Lines changed: 40 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1763,40 +1763,40 @@ Tkapp_InterpAddr(PyObject *self, PyObject *args)
17631763

17641764
static PyMethodDef Tkapp_methods[] =
17651765
{
1766-
{"call", Tkapp_Call, 0},
1767-
{"globalcall", Tkapp_GlobalCall, 0},
1768-
{"eval", Tkapp_Eval, 1},
1769-
{"globaleval", Tkapp_GlobalEval, 1},
1770-
{"evalfile", Tkapp_EvalFile, 1},
1771-
{"record", Tkapp_Record, 1},
1772-
{"adderrorinfo", Tkapp_AddErrorInfo, 1},
1773-
{"setvar", Tkapp_SetVar, 1},
1774-
{"globalsetvar", Tkapp_GlobalSetVar, 1},
1775-
{"getvar", Tkapp_GetVar, 1},
1776-
{"globalgetvar", Tkapp_GlobalGetVar, 1},
1777-
{"unsetvar", Tkapp_UnsetVar, 1},
1778-
{"globalunsetvar", Tkapp_GlobalUnsetVar, 1},
1779-
{"getint", Tkapp_GetInt, 1},
1780-
{"getdouble", Tkapp_GetDouble, 1},
1781-
{"getboolean", Tkapp_GetBoolean, 1},
1782-
{"exprstring", Tkapp_ExprString, 1},
1783-
{"exprlong", Tkapp_ExprLong, 1},
1784-
{"exprdouble", Tkapp_ExprDouble, 1},
1785-
{"exprboolean", Tkapp_ExprBoolean, 1},
1786-
{"splitlist", Tkapp_SplitList, 1},
1787-
{"split", Tkapp_Split, 1},
1788-
{"merge", Tkapp_Merge, 0},
1789-
{"createcommand", Tkapp_CreateCommand, 1},
1790-
{"deletecommand", Tkapp_DeleteCommand, 1},
1766+
{"call", Tkapp_Call, METH_OLDARGS},
1767+
{"globalcall", Tkapp_GlobalCall, METH_OLDARGS},
1768+
{"eval", Tkapp_Eval, METH_VARARGS},
1769+
{"globaleval", Tkapp_GlobalEval, METH_VARARGS},
1770+
{"evalfile", Tkapp_EvalFile, METH_VARARGS},
1771+
{"record", Tkapp_Record, METH_VARARGS},
1772+
{"adderrorinfo", Tkapp_AddErrorInfo, METH_VARARGS},
1773+
{"setvar", Tkapp_SetVar, METH_VARARGS},
1774+
{"globalsetvar", Tkapp_GlobalSetVar, METH_VARARGS},
1775+
{"getvar", Tkapp_GetVar, METH_VARARGS},
1776+
{"globalgetvar", Tkapp_GlobalGetVar, METH_VARARGS},
1777+
{"unsetvar", Tkapp_UnsetVar, METH_VARARGS},
1778+
{"globalunsetvar", Tkapp_GlobalUnsetVar, METH_VARARGS},
1779+
{"getint", Tkapp_GetInt, METH_VARARGS},
1780+
{"getdouble", Tkapp_GetDouble, METH_VARARGS},
1781+
{"getboolean", Tkapp_GetBoolean, METH_VARARGS},
1782+
{"exprstring", Tkapp_ExprString, METH_VARARGS},
1783+
{"exprlong", Tkapp_ExprLong, METH_VARARGS},
1784+
{"exprdouble", Tkapp_ExprDouble, METH_VARARGS},
1785+
{"exprboolean", Tkapp_ExprBoolean, METH_VARARGS},
1786+
{"splitlist", Tkapp_SplitList, METH_VARARGS},
1787+
{"split", Tkapp_Split, METH_VARARGS},
1788+
{"merge", Tkapp_Merge, METH_OLDARGS},
1789+
{"createcommand", Tkapp_CreateCommand, METH_VARARGS},
1790+
{"deletecommand", Tkapp_DeleteCommand, METH_VARARGS},
17911791
#ifdef HAVE_CREATEFILEHANDLER
1792-
{"createfilehandler", Tkapp_CreateFileHandler, 1},
1793-
{"deletefilehandler", Tkapp_DeleteFileHandler, 1},
1792+
{"createfilehandler", Tkapp_CreateFileHandler, METH_VARARGS},
1793+
{"deletefilehandler", Tkapp_DeleteFileHandler, METH_VARARGS},
17941794
#endif
1795-
{"createtimerhandler", Tkapp_CreateTimerHandler, 1},
1796-
{"mainloop", Tkapp_MainLoop, 1},
1797-
{"dooneevent", Tkapp_DoOneEvent, 1},
1798-
{"quit", Tkapp_Quit, 1},
1799-
{"interpaddr", Tkapp_InterpAddr, 1},
1795+
{"createtimerhandler", Tkapp_CreateTimerHandler, METH_VARARGS},
1796+
{"mainloop", Tkapp_MainLoop, METH_VARARGS},
1797+
{"dooneevent", Tkapp_DoOneEvent, METH_VARARGS},
1798+
{"quit", Tkapp_Quit, METH_VARARGS},
1799+
{"interpaddr", Tkapp_InterpAddr, METH_VARARGS},
18001800
{NULL, NULL}
18011801
};
18021802

@@ -1978,16 +1978,16 @@ Tkinter_Create(PyObject *self, PyObject *args)
19781978

19791979
static PyMethodDef moduleMethods[] =
19801980
{
1981-
{"_flatten", Tkinter_Flatten, 1},
1982-
{"create", Tkinter_Create, 1},
1981+
{"_flatten", Tkinter_Flatten, METH_VARARGS},
1982+
{"create", Tkinter_Create, METH_VARARGS},
19831983
#ifdef HAVE_CREATEFILEHANDLER
1984-
{"createfilehandler", Tkapp_CreateFileHandler, 1},
1985-
{"deletefilehandler", Tkapp_DeleteFileHandler, 1},
1984+
{"createfilehandler", Tkapp_CreateFileHandler, METH_VARARGS},
1985+
{"deletefilehandler", Tkapp_DeleteFileHandler, METH_VARARGS},
19861986
#endif
1987-
{"createtimerhandler", Tkapp_CreateTimerHandler, 1},
1988-
{"mainloop", Tkapp_MainLoop, 1},
1989-
{"dooneevent", Tkapp_DoOneEvent, 1},
1990-
{"quit", Tkapp_Quit, 1},
1987+
{"createtimerhandler", Tkapp_CreateTimerHandler, METH_VARARGS},
1988+
{"mainloop", Tkapp_MainLoop, METH_VARARGS},
1989+
{"dooneevent", Tkapp_DoOneEvent, METH_VARARGS},
1990+
{"quit", Tkapp_Quit, METH_VARARGS},
19911991
{NULL, NULL}
19921992
};
19931993

Modules/audioop.c

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1343,29 +1343,29 @@ audioop_adpcm2lin(PyObject *self, PyObject *args)
13431343
}
13441344

13451345
static PyMethodDef audioop_methods[] = {
1346-
{ "max", audioop_max },
1347-
{ "minmax", audioop_minmax },
1348-
{ "avg", audioop_avg },
1349-
{ "maxpp", audioop_maxpp },
1350-
{ "avgpp", audioop_avgpp },
1351-
{ "rms", audioop_rms },
1352-
{ "findfit", audioop_findfit },
1353-
{ "findmax", audioop_findmax },
1354-
{ "findfactor", audioop_findfactor },
1355-
{ "cross", audioop_cross },
1356-
{ "mul", audioop_mul },
1357-
{ "add", audioop_add },
1358-
{ "bias", audioop_bias },
1359-
{ "ulaw2lin", audioop_ulaw2lin },
1360-
{ "lin2ulaw", audioop_lin2ulaw },
1361-
{ "lin2lin", audioop_lin2lin },
1362-
{ "adpcm2lin", audioop_adpcm2lin },
1363-
{ "lin2adpcm", audioop_lin2adpcm },
1364-
{ "tomono", audioop_tomono },
1365-
{ "tostereo", audioop_tostereo },
1366-
{ "getsample", audioop_getsample },
1367-
{ "reverse", audioop_reverse },
1368-
{ "ratecv", audioop_ratecv, 1 },
1346+
{ "max", audioop_max, METH_OLDARGS },
1347+
{ "minmax", audioop_minmax, METH_OLDARGS },
1348+
{ "avg", audioop_avg, METH_OLDARGS },
1349+
{ "maxpp", audioop_maxpp, METH_OLDARGS },
1350+
{ "avgpp", audioop_avgpp, METH_OLDARGS },
1351+
{ "rms", audioop_rms, METH_OLDARGS },
1352+
{ "findfit", audioop_findfit, METH_OLDARGS },
1353+
{ "findmax", audioop_findmax, METH_OLDARGS },
1354+
{ "findfactor", audioop_findfactor, METH_OLDARGS },
1355+
{ "cross", audioop_cross, METH_OLDARGS },
1356+
{ "mul", audioop_mul, METH_OLDARGS },
1357+
{ "add", audioop_add, METH_OLDARGS },
1358+
{ "bias", audioop_bias, METH_OLDARGS },
1359+
{ "ulaw2lin", audioop_ulaw2lin, METH_OLDARGS },
1360+
{ "lin2ulaw", audioop_lin2ulaw, METH_OLDARGS },
1361+
{ "lin2lin", audioop_lin2lin, METH_OLDARGS },
1362+
{ "adpcm2lin", audioop_adpcm2lin, METH_OLDARGS },
1363+
{ "lin2adpcm", audioop_lin2adpcm, METH_OLDARGS },
1364+
{ "tomono", audioop_tomono, METH_OLDARGS },
1365+
{ "tostereo", audioop_tostereo, METH_OLDARGS },
1366+
{ "getsample", audioop_getsample, METH_OLDARGS },
1367+
{ "reverse", audioop_reverse, METH_OLDARGS },
1368+
{ "ratecv", audioop_ratecv, METH_VARARGS },
13691369
{ 0, 0 }
13701370
};
13711371

Modules/bsddbmodule.c

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -652,15 +652,15 @@ bsddb_sync(bsddbobject *dp, PyObject *args)
652652
return PyInt_FromLong(status = 0);
653653
}
654654
static PyMethodDef bsddb_methods[] = {
655-
{"close", (PyCFunction)bsddb_close},
656-
{"keys", (PyCFunction)bsddb_keys},
657-
{"has_key", (PyCFunction)bsddb_has_key},
658-
{"set_location", (PyCFunction)bsddb_set_location},
659-
{"next", (PyCFunction)bsddb_next},
660-
{"previous", (PyCFunction)bsddb_previous},
661-
{"first", (PyCFunction)bsddb_first},
662-
{"last", (PyCFunction)bsddb_last},
663-
{"sync", (PyCFunction)bsddb_sync},
655+
{"close", (PyCFunction)bsddb_close, METH_OLDARGS},
656+
{"keys", (PyCFunction)bsddb_keys, METH_OLDARGS},
657+
{"has_key", (PyCFunction)bsddb_has_key, METH_OLDARGS},
658+
{"set_location", (PyCFunction)bsddb_set_location, METH_OLDARGS},
659+
{"next", (PyCFunction)bsddb_next, METH_OLDARGS},
660+
{"previous", (PyCFunction)bsddb_previous, METH_OLDARGS},
661+
{"first", (PyCFunction)bsddb_first, METH_OLDARGS},
662+
{"last", (PyCFunction)bsddb_last, METH_OLDARGS},
663+
{"sync", (PyCFunction)bsddb_sync, METH_OLDARGS},
664664
{NULL, NULL} /* sentinel */
665665
};
666666

@@ -849,9 +849,9 @@ bsdrnopen(PyObject *self, PyObject *args)
849849
}
850850

851851
static PyMethodDef bsddbmodule_methods[] = {
852-
{"hashopen", (PyCFunction)bsdhashopen, 1},
853-
{"btopen", (PyCFunction)bsdbtopen, 1},
854-
{"rnopen", (PyCFunction)bsdrnopen, 1},
852+
{"hashopen", (PyCFunction)bsdhashopen, METH_VARARGS},
853+
{"btopen", (PyCFunction)bsdbtopen, METH_VARARGS},
854+
{"rnopen", (PyCFunction)bsdrnopen, METH_VARARGS},
855855
{0, 0},
856856
};
857857

Modules/cdmodule.c

Lines changed: 27 additions & 27 deletions

0 commit comments

Comments
 (0)