Skip to content

bpo-46670: Remove unused macros in the Modules directory #31194

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Feb 7, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions Modules/_ctypes/stgdict.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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;
Expand Down
2 changes: 0 additions & 2 deletions Modules/_ssl.c
Original file line number Diff line number Diff line change
Expand Up @@ -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); }


Expand Down
2 changes: 0 additions & 2 deletions Modules/_struct.c
Original file line number Diff line number Diff line change
Expand Up @@ -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},
Expand Down
2 changes: 0 additions & 2 deletions Modules/_testcapimodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 0 additions & 4 deletions Modules/_tkinter.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 ****/

Expand Down
2 changes: 0 additions & 2 deletions Modules/pwdmodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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);
Expand Down