summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@python.org>2022-02-07 15:21:31 (GMT)
committerGitHub <noreply@github.com>2022-02-07 15:21:31 (GMT)
commit4f1d3f33dd8b37a151b73533f18b08b0500223e5 (patch)
treea20153bc057edf36f4abd2ba730ed2f9a1ebd779 /Modules
parentd3e53bc5321a9f08c7ed5b9383eefb2e03dfa6e2 (diff)
downloadcpython-4f1d3f33dd8b37a151b73533f18b08b0500223e5.zip
cpython-4f1d3f33dd8b37a151b73533f18b08b0500223e5.tar.gz
cpython-4f1d3f33dd8b37a151b73533f18b08b0500223e5.tar.bz2
bpo-46670: Remove unused macros in the Modules directory (GH-31194)
* bpo-46670: Remove unused macros in the Modules directory * Add again LINKAT_DIR_FD_CONVERTER: generated by Argument Clinic
Diffstat (limited to 'Modules')
-rw-r--r--Modules/_ctypes/stgdict.c2
-rw-r--r--Modules/_ssl.c2
-rw-r--r--Modules/_struct.c2
-rw-r--r--Modules/_testcapimodule.c2
-rw-r--r--Modules/_tkinter.c4
-rw-r--r--Modules/pwdmodule.c2
6 files changed, 0 insertions, 14 deletions
diff --git a/Modules/_ctypes/stgdict.c b/Modules/_ctypes/stgdict.c
index 6c1917b..3470cf1 100644
--- a/Modules/_ctypes/stgdict.c
+++ b/Modules/_ctypes/stgdict.c
@@ -504,7 +504,6 @@ PyCStructUnionType_update_stgdict(PyObject *type, PyObject *fields, int isStruct
if (stgdict->format == NULL)
return -1;
-#define realdict ((PyObject *)&stgdict->dict)
for (i = 0; i < len; ++i) {
PyObject *name = NULL, *desc = NULL;
PyObject *pair = PySequence_GetItem(fields, i);
@@ -635,7 +634,6 @@ PyCStructUnionType_update_stgdict(PyObject *type, PyObject *fields, int isStruct
Py_DECREF(pair);
Py_DECREF(prop);
}
-#undef realdict
if (isStruct && !isPacked) {
char *ptr = stgdict->format;
diff --git a/Modules/_ssl.c b/Modules/_ssl.c
index b2e241a..e17876e 100644
--- a/Modules/_ssl.c
+++ b/Modules/_ssl.c
@@ -40,8 +40,6 @@
#define PySSL_BEGIN_ALLOW_THREADS { \
PyThreadState *_save = NULL; \
PySSL_BEGIN_ALLOW_THREADS_S(_save);
-#define PySSL_BLOCK_THREADS PySSL_END_ALLOW_THREADS_S(_save);
-#define PySSL_UNBLOCK_THREADS PySSL_BEGIN_ALLOW_THREADS_S(_save);
#define PySSL_END_ALLOW_THREADS PySSL_END_ALLOW_THREADS_S(_save); }
diff --git a/Modules/_struct.c b/Modules/_struct.c
index 210dbdc..7d05ec5 100644
--- a/Modules/_struct.c
+++ b/Modules/_struct.c
@@ -2065,8 +2065,6 @@ static PyMemberDef s_members[] = {
{NULL} /* sentinel */
};
-#define OFF(x) offsetof(PyStructObject, x)
-
static PyGetSetDef s_getsetlist[] = {
{"format", (getter)s_get_format, (setter)NULL, "struct format string", NULL},
{"size", (getter)s_get_size, (setter)NULL, "struct size in bytes", NULL},
diff --git a/Modules/_testcapimodule.c b/Modules/_testcapimodule.c
index 7369f09..498a7c2 100644
--- a/Modules/_testcapimodule.c
+++ b/Modules/_testcapimodule.c
@@ -6060,8 +6060,6 @@ static PyMethodDef TestMethods[] = {
{NULL, NULL} /* sentinel */
};
-#define AddSym(d, n, f, v) {PyObject *o = f(v); PyDict_SetItemString(d, n, o); Py_DECREF(o);}
-
typedef struct {
char bool_member;
char byte_member;
diff --git a/Modules/_tkinter.c b/Modules/_tkinter.c
index f4d2716..cbef9ce 100644
--- a/Modules/_tkinter.c
+++ b/Modules/_tkinter.c
@@ -318,10 +318,6 @@ typedef struct {
#define Tkapp_Interp(v) (((TkappObject *) (v))->interp)
-#define DEBUG_REFCNT(v) (printf("DEBUG: id=%p, refcnt=%i\n", \
-(void *) v, Py_REFCNT(v)))
-
-
/**** Error Handling ****/
diff --git a/Modules/pwdmodule.c b/Modules/pwdmodule.c
index 14d3f9d..a757380 100644
--- a/Modules/pwdmodule.c
+++ b/Modules/pwdmodule.c
@@ -84,7 +84,6 @@ mkpwent(PyObject *module, struct passwd *p)
if (v == NULL)
return NULL;
-#define SETI(i,val) PyStructSequence_SET_ITEM(v, i, PyLong_FromLong((long) val))
#define SETS(i,val) sets(v, i, val)
SETS(setIndex++, p->pw_name);
@@ -104,7 +103,6 @@ mkpwent(PyObject *module, struct passwd *p)
SETS(setIndex++, p->pw_shell);
#undef SETS
-#undef SETI
if (PyErr_Occurred()) {
Py_XDECREF(v);