Skip to content

Commit 08ce1c4

Browse files
committed
Make various things be METH_NOARGS
1 parent 7cf89e1 commit 08ce1c4

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

docs/basics.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -484,7 +484,7 @@ Global data access
484484
The source language of this translation unit, as a string
485485
(e.g. "GNU C")
486486
487-
.. py:function:: gcc.get_global_namespace(name)
487+
.. py:function:: gcc.get_global_namespace()
488488
489489
C++ only: locate the :py:class:`gcc.NamespaceDecl` for the global
490490
namespace (a.k.a. "::")

gcc-python.c

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -426,36 +426,36 @@ static PyMethodDef GccMethods[] = {
426426
/* Options: */
427427
{"get_option_list",
428428
PyGcc_get_option_list,
429-
METH_VARARGS,
429+
METH_NOARGS,
430430
"Get all command-line options, as a list of gcc.Option instances"},
431431

432432
{"get_option_dict",
433433
PyGcc_get_option_dict,
434-
METH_VARARGS,
434+
METH_NOARGS,
435435
("Get all command-line options, as a dict from command-line text strings "
436436
"to gcc.Option instances")},
437437

438-
{"get_parameters", PyGcc_get_parameters, METH_VARARGS,
438+
{"get_parameters", PyGcc_get_parameters, METH_NOARGS,
439439
"Get all tunable GCC parameters. Returns a dictionary, mapping from"
440440
"option name -> gcc.Parameter instance"},
441441

442-
{"get_variables", PyGcc_get_variables, METH_VARARGS,
442+
{"get_variables", PyGcc_get_variables, METH_NOARGS,
443443
"Get all variables in this compilation unit as a list of gcc.Variable"},
444444

445445
{"maybe_get_identifier", PyGcc_maybe_get_identifier, METH_VARARGS,
446446
"Get the gcc.IdentifierNode with this name, if it exists, otherwise None"},
447447

448-
{"get_translation_units", PyGcc_get_translation_units, METH_VARARGS,
448+
{"get_translation_units", PyGcc_get_translation_units, METH_NOARGS,
449449
"Get a list of all gcc.TranslationUnitDecl"},
450450

451-
{"get_global_namespace", PyGcc_get_global_namespace, METH_VARARGS,
451+
{"get_global_namespace", PyGcc_get_global_namespace, METH_NOARGS,
452452
"C++: get the global namespace (aka '::') as a gcc.NamespaceDecl"},
453453

454454
/* Version handling: */
455-
{"get_plugin_gcc_version", PyGcc_get_plugin_gcc_version, METH_VARARGS,
455+
{"get_plugin_gcc_version", PyGcc_get_plugin_gcc_version, METH_NOARGS,
456456
"Get the gcc.Version that this plugin was compiled with"},
457457

458-
{"get_gcc_version", PyGcc_get_gcc_version, METH_VARARGS,
458+
{"get_gcc_version", PyGcc_get_gcc_version, METH_NOARGS,
459459
"Get the gcc.Version for this version of GCC"},
460460

461461
{"get_callgraph_nodes", PyGcc_get_callgraph_nodes, METH_VARARGS,
@@ -475,10 +475,10 @@ static PyMethodDef GccMethods[] = {
475475
"Determine whether or not we're being invoked during link-time optimization"},
476476

477477
/* Garbage collection */
478-
{"_force_garbage_collection", PyGcc__force_garbage_collection, METH_VARARGS,
478+
{"_force_garbage_collection", PyGcc__force_garbage_collection, METH_NOARGS,
479479
"Forcibly trigger a single run of GCC's garbage collector"},
480480

481-
{"_gc_selftest", PyGcc__gc_selftest, METH_VARARGS,
481+
{"_gc_selftest", PyGcc__gc_selftest, METH_NOARGS,
482482
"Run a garbage-collection selftest"},
483483

484484
/* Sentinel: */

0 commit comments

Comments
 (0)