From 760349198dbd8771629753e096a885c1aa28a1ca Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Mon, 7 Feb 2022 16:21:41 +0100 Subject: [PATCH] bpo-46670: Remove unused macros in the Objects directory (GH-31193) --- Objects/dictobject.c | 1 - Objects/memoryobject.c | 8 -------- Objects/obmalloc.c | 1 - Objects/unicodectype.c | 2 -- 4 files changed, 12 deletions(-) diff --git a/Objects/dictobject.c b/Objects/dictobject.c index 0ad0f0b59c8..2c8ec79ded7 100644 --- a/Objects/dictobject.c +++ b/Objects/dictobject.c @@ -292,7 +292,6 @@ _PyDict_DebugMallocStats(FILE *out) } #define DK_MASK(dk) (DK_SIZE(dk)-1) -#define IS_POWER_OF_2(x) (((x) & (x-1)) == 0) static void free_keys_object(PyDictKeysObject *keys); diff --git a/Objects/memoryobject.c b/Objects/memoryobject.c index dfcb31e5b33..45fe8985c2a 100644 --- a/Objects/memoryobject.c +++ b/Objects/memoryobject.c @@ -67,14 +67,6 @@ class memoryview "PyMemoryViewObject *" "&PyMemoryView_Type" */ -#define CHECK_MBUF_RELEASED(mbuf) \ - if (((_PyManagedBufferObject *)mbuf)->flags&_Py_MANAGED_BUFFER_RELEASED) { \ - PyErr_SetString(PyExc_ValueError, \ - "operation forbidden on released memoryview object"); \ - return NULL; \ - } - - static inline _PyManagedBufferObject * mbuf_alloc(void) { diff --git a/Objects/obmalloc.c b/Objects/obmalloc.c index bad4dc09639..560e1c59a9c 100644 --- a/Objects/obmalloc.c +++ b/Objects/obmalloc.c @@ -900,7 +900,6 @@ static int running_on_valgrind = -1; * currently targets. */ #define SYSTEM_PAGE_SIZE (4 * 1024) -#define SYSTEM_PAGE_SIZE_MASK (SYSTEM_PAGE_SIZE - 1) /* * Maximum amount of memory managed by the allocator for small requests. diff --git a/Objects/unicodectype.c b/Objects/unicodectype.c index d8c95c8b44c..aa5c5b2a4ad 100644 --- a/Objects/unicodectype.c +++ b/Objects/unicodectype.c @@ -14,8 +14,6 @@ #define DECIMAL_MASK 0x02 #define DIGIT_MASK 0x04 #define LOWER_MASK 0x08 -#define LINEBREAK_MASK 0x10 -#define SPACE_MASK 0x20 #define TITLE_MASK 0x40 #define UPPER_MASK 0x80 #define XID_START_MASK 0x100