Skip to content

Commit 62c2fac

Browse files
committed
Do not pollute name block_ty, prefix with _Py_
1 parent 6ab080c commit 62c2fac

2 files changed

Lines changed: 6 additions & 6 deletions

File tree

Include/symtable.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ extern "C" {
55
#endif
66

77
typedef enum _block_type { FunctionBlock, ClassBlock, ModuleBlock }
8-
block_ty;
8+
_Py_block_ty;
99

1010
struct _symtable_entry;
1111

@@ -29,7 +29,7 @@ typedef struct _symtable_entry {
2929
PyObject *ste_name; /* string: name of block */
3030
PyObject *ste_varnames; /* list of variable names */
3131
PyObject *ste_children; /* list of child ids */
32-
block_ty ste_type; /* module, class, or function */
32+
_Py_block_ty ste_type; /* module, class, or function */
3333
int ste_unoptimized; /* false if namespace is optimized */
3434
int ste_nested : 1; /* true if block is nested */
3535
int ste_free : 1; /* true if block has free variables */
@@ -49,7 +49,7 @@ PyAPI_DATA(PyTypeObject) PySTEntry_Type;
4949
#define PySTEntry_Check(op) ((op)->ob_type == &PySTEntry_Type)
5050

5151
PyAPI_FUNC(PySTEntryObject *) \
52-
PySTEntry_New(struct symtable *, identifier, block_ty, void *, int);
52+
PySTEntry_New(struct symtable *, identifier, _Py_block_ty, void *, int);
5353
PyAPI_FUNC(int) PyST_GetScope(PySTEntryObject *, PyObject *);
5454

5555
PyAPI_FUNC(struct symtable *) PySymtable_Build(mod_ty, const char *,

Python/symtable.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"name '%.400s' is used prior to global declaration"
1313

1414
PySTEntryObject *
15-
PySTEntry_New(struct symtable *st, identifier name, block_ty block,
15+
PySTEntry_New(struct symtable *st, identifier name, _Py_block_ty block,
1616
void *key, int lineno)
1717
{
1818
PySTEntryObject *ste = NULL;
@@ -153,7 +153,7 @@ PyTypeObject PySTEntry_Type = {
153153
static int symtable_analyze(struct symtable *st);
154154
static int symtable_warn(struct symtable *st, char *msg);
155155
static int symtable_enter_block(struct symtable *st, identifier name,
156-
block_ty block, void *ast, int lineno);
156+
_Py_block_ty block, void *ast, int lineno);
157157
static int symtable_exit_block(struct symtable *st, void *ast);
158158
static int symtable_visit_stmt(struct symtable *st, stmt_ty s);
159159
static int symtable_visit_expr(struct symtable *st, expr_ty s);
@@ -711,7 +711,7 @@ symtable_exit_block(struct symtable *st, void *ast)
711711
}
712712

713713
static int
714-
symtable_enter_block(struct symtable *st, identifier name, block_ty block,
714+
symtable_enter_block(struct symtable *st, identifier name, _Py_block_ty block,
715715
void *ast, int lineno)
716716
{
717717
PySTEntryObject *prev = NULL;

0 commit comments

Comments
 (0)