8000 bpo-46670: Remove unused macros in the Python directory (GH-31192) · python/cpython@7d8b69e · GitHub
[go: up one dir, main page]

Skip to content

Commit 7d8b69e

Browse files
authored
bpo-46670: Remove unused macros in the Python directory (GH-31192)
1 parent 7603491 commit 7d8b69e

File tree

4 files changed

+2
-29
lines changed

4 files changed

+2
-29
lines changed

Python/ast_opt.c

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -660,15 +660,6 @@ static int astfold_pattern(pattern_ty node_, PyArena *ctx_, _PyASTOptimizeState
660660
} \
661661
}
662662

663-
#define CALL_INT_SEQ(FUNC, TYPE, ARG) { \
664-
int i; \
665-
asdl_int_seq *seq = (ARG); /* avoid variable capture */ \
666-
for (i = 0; i < asdl_seq_LEN(seq); i++) { \
667-
TYPE elt = (TYPE)asdl_seq_GET(seq, i); \
668-
if (!FUNC(elt, ctx_, state)) \
669-
return 0; \
670-
} \
671-
}
672663

673664
static int
674665
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
10851076
#undef CALL
10861077
#undef CALL_OPT
10871078
#undef CALL_SEQ
1088-
#undef CALL_INT_SEQ
10891079

10901080
/* See comments in symtable.c. */
10911081
#define COMPILER_STACK_FRAME_SCALE 3

Python/compile.c

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@
3737

3838

3939
#define DEFAULT_BLOCK_SIZE 16
40-
#define DEFAULT_BLOCKS 8
4140
#define DEFAULT_CODE_SIZE 128
4241
#define DEFAULT_LNOTAB_SIZE 16
4342
#define DEFAULT_CNOTAB_SIZE 32
@@ -1472,13 +1471,6 @@ compiler_addop_j_noline(struct compiler *c, int opcode, basicblock *b)
14721471
Py_DECREF(__new_const); \
14731472
}
14741473

1475-
#define ADDOP_O(C, OP, O, TYPE) { \
1476-
assert(!HAS_CONST(OP)); /* use ADDOP_LOAD_CONST */ \
1477-
if (!compiler_addop_o((C), (OP), (C)->u->u_ ## TYPE, (O))) \
1478-
return 0; \
1479-
}
1480-
1481-
/* Same as ADDOP_O, but steals a reference. */
14821474
#define ADDOP_N(C, OP, O, TYPE) { \
14831475
assert(!HAS_CONST(OP)); /* use ADDOP_LOAD_CONST_NEW */ \
14841476
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)
15521544
} \
15531545
}
15541546

1555-
#define VISIT_SLICE(C, V, CTX) {\
1556-
if (!compiler_visit_slice((C), (V), (CTX))) \
1557-
return 0; \
1558-
}
1559-
15601547
#define VISIT_SEQ(C, TYPE, SEQ) { \
15611548
int _i; \
15621549
asdl_ ## TYPE ## _seq *seq = (SEQ); /* avoid variable capture */ \

Python/import.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,6 @@
2424
extern "C" {
2525
#endif
2626

27-
#define CACHEDIR "__pycache__"
28-
2927
/* Forward references */
3028
static PyObject *import_add_module(PyThreadState *tstate, PyObject *name);
3129

Python/thread.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,9 @@
4545

4646
#ifdef Py_DEBUG
4747
static int thread_debug = 0;
48-
#define dprintf(args) (void)((thread_debug & 1) && printf args)
49-
#define d2printf(args) ((thread_debug & 8) && printf args)
48+
# define dprintf(args) (void)((thread_debug & 1) && printf args)
5049
#else
51-
#define dprintf(args)
52-
#define d2printf(args)
50+
# define dprintf(args)
5351
#endif
5452

5553
static int initialized;

0 commit comments

Comments
 (0)
0