Skip to content

Commit 4f1d3f3

Browse files
authored
bpo-46670: Remove unused macros in the Modules directory (pythonGH-31194)
* bpo-46670: Remove unused macros in the Modules directory * Add again LINKAT_DIR_FD_CONVERTER: generated by Argument Clinic
1 parent d3e53bc commit 4f1d3f3

6 files changed

Lines changed: 0 additions & 14 deletions

File tree

Modules/_ctypes/stgdict.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -504,7 +504,6 @@ PyCStructUnionType_update_stgdict(PyObject *type, PyObject *fields, int isStruct
504504
if (stgdict->format == NULL)
505505
return -1;
506506

507-
#define realdict ((PyObject *)&stgdict->dict)
508507
for (i = 0; i < len; ++i) {
509508
PyObject *name = NULL, *desc = NULL;
510509
PyObject *pair = PySequence_GetItem(fields, i);
@@ -635,7 +634,6 @@ PyCStructUnionType_update_stgdict(PyObject *type, PyObject *fields, int isStruct
635634
Py_DECREF(pair);
636635
Py_DECREF(prop);
637636
}
638-
#undef realdict
639637

640638
if (isStruct && !isPacked) {
641639
char *ptr = stgdict->format;

Modules/_ssl.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,6 @@
4040
#define PySSL_BEGIN_ALLOW_THREADS { \
4141
PyThreadState *_save = NULL; \
4242
PySSL_BEGIN_ALLOW_THREADS_S(_save);
43-
#define PySSL_BLOCK_THREADS PySSL_END_ALLOW_THREADS_S(_save);
44-
#define PySSL_UNBLOCK_THREADS PySSL_BEGIN_ALLOW_THREADS_S(_save);
4543
#define PySSL_END_ALLOW_THREADS PySSL_END_ALLOW_THREADS_S(_save); }
4644

4745

Modules/_struct.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2065,8 +2065,6 @@ static PyMemberDef s_members[] = {
20652065
{NULL} /* sentinel */
20662066
};
20672067

2068-
#define OFF(x) offsetof(PyStructObject, x)
2069-
20702068
static PyGetSetDef s_getsetlist[] = {
20712069
{"format", (getter)s_get_format, (setter)NULL, "struct format string", NULL},
20722070
{"size", (getter)s_get_size, (setter)NULL, "struct size in bytes", NULL},

Modules/_testcapimodule.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6060,8 +6060,6 @@ static PyMethodDef TestMethods[] = {
60606060
{NULL, NULL} /* sentinel */
60616061
};
60626062

6063-
#define AddSym(d, n, f, v) {PyObject *o = f(v); PyDict_SetItemString(d, n, o); Py_DECREF(o);}
6064-
60656063
typedef struct {
60666064
char bool_member;
60676065
char byte_member;

Modules/_tkinter.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -318,10 +318,6 @@ typedef struct {
318318

319319
#define Tkapp_Interp(v) (((TkappObject *) (v))->interp)
320320

321-
#define DEBUG_REFCNT(v) (printf("DEBUG: id=%p, refcnt=%i\n", \
322-
(void *) v, Py_REFCNT(v)))
323-
324-
325321

326322
/**** Error Handling ****/
327323

Modules/pwdmodule.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,6 @@ mkpwent(PyObject *module, struct passwd *p)
8484
if (v == NULL)
8585
return NULL;
8686

87-
#define SETI(i,val) PyStructSequence_SET_ITEM(v, i, PyLong_FromLong((long) val))
8887
#define SETS(i,val) sets(v, i, val)
8988

9089
SETS(setIndex++, p->pw_name);
@@ -104,7 +103,6 @@ mkpwent(PyObject *module, struct passwd *p)
104103
SETS(setIndex++, p->pw_shell);
105104

106105
#undef SETS
107-
#undef SETI
108106

109107
if (PyErr_Occurred()) {
110108
Py_XDECREF(v);

0 commit comments

Comments
 (0)