]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-46670: Remove unused macros in the Python directory (GH-31192)
authorVictor Stinner <vstinner@python.org>
Mon, 7 Feb 2022 15:21:52 +0000 (16:21 +0100)
committerGitHub <noreply@github.com>
Mon, 7 Feb 2022 15:21:52 +0000 (16:21 +0100)
Python/ast_opt.c
Python/compile.c
Python/import.c
Python/thread.c

index 2821e69a35521ed1d49befae3ccfa18a58b075b7..967e75d5771c5598acde1974eb4d55e0c72042e2 100644 (file)
@@ -660,15 +660,6 @@ static int astfold_pattern(pattern_ty node_, PyArena *ctx_, _PyASTOptimizeState
     } \
 }
 
-#define CALL_INT_SEQ(FUNC, TYPE, ARG) { \
-    int i; \
-    asdl_int_seq *seq = (ARG); /* avoid variable capture */ \
-    for (i = 0; i < asdl_seq_LEN(seq); i++) { \
-        TYPE elt = (TYPE)asdl_seq_GET(seq, i); \
-        if (!FUNC(elt, ctx_, state)) \
-            return 0; \
-    } \
-}
 
 static int
 astfold_body(asdl_stmt_seq *stmts, PyArena *ctx_, _PyASTOptimizeState *state)
@@ -1085,7 +1076,6 @@ astfold_match_case(match_case_ty node_, PyArena *ctx_, _PyASTOptimizeState *stat
 #undef CALL
 #undef CALL_OPT
 #undef CALL_SEQ
-#undef CALL_INT_SEQ
 
 /* See comments in symtable.c. */
 #define COMPILER_STACK_FRAME_SCALE 3
index cecd6a5c42660e7950f4ced35ec6bda17f53704e..3f33f306bc5713a1b469b32a05b0d26bde8b51f3 100644 (file)
@@ -37,7 +37,6 @@
 
 
 #define DEFAULT_BLOCK_SIZE 16
-#define DEFAULT_BLOCKS 8
 #define DEFAULT_CODE_SIZE 128
 #define DEFAULT_LNOTAB_SIZE 16
 #define DEFAULT_CNOTAB_SIZE 32
@@ -1472,13 +1471,6 @@ compiler_addop_j_noline(struct compiler *c, int opcode, basicblock *b)
     Py_DECREF(__new_const); \
 }
 
-#define ADDOP_O(C, OP, O, TYPE) { \
-    assert(!HAS_CONST(OP)); /* use ADDOP_LOAD_CONST */ \
-    if (!compiler_addop_o((C), (OP), (C)->u->u_ ## TYPE, (O))) \
-        return 0; \
-}
-
-/* Same as ADDOP_O, but steals a reference. */
 #define ADDOP_N(C, OP, O, TYPE) { \
     assert(!HAS_CONST(OP)); /* use ADDOP_LOAD_CONST_NEW */ \
     if (!compiler_addop_o((C), (OP), (C)->u->u_ ## TYPE, (O))) { \
@@ -1552,11 +1544,6 @@ compiler_addop_j_noline(struct compiler *c, int opcode, basicblock *b)
     } \
 }
 
-#define VISIT_SLICE(C, V, CTX) {\
-    if (!compiler_visit_slice((C), (V), (CTX))) \
-        return 0; \
-}
-
 #define VISIT_SEQ(C, TYPE, SEQ) { \
     int _i; \
     asdl_ ## TYPE ## _seq *seq = (SEQ); /* avoid variable capture */ \
index be60c431f7ef8fd3962578755f73eae4341f7b9a..332db6919f1c2b471b02daaa9f1d14bea51faafa 100644 (file)
@@ -24,8 +24,6 @@
 extern "C" {
 #endif
 
-#define CACHEDIR "__pycache__"
-
 /* Forward references */
 static PyObject *import_add_module(PyThreadState *tstate, PyObject *name);
 
index c6b16251a05b6954abe4c93cd0aee06c5c31d5b1..e80e8a906bc8e094c2a28f28412bd6a4ade62508 100644 (file)
 
 #ifdef Py_DEBUG
 static int thread_debug = 0;
-#define dprintf(args)   (void)((thread_debug & 1) && printf args)
-#define d2printf(args)  ((thread_debug & 8) && printf args)
+#  define dprintf(args)   (void)((thread_debug & 1) && printf args)
 #else
-#define dprintf(args)
-#define d2printf(args)
+#  define dprintf(args)
 #endif
 
 static int initialized;