Skip to content

Commit 7862062

Browse files
committed
Rename variables
* Rename a_linetable member to a_linetable_writer * Rename a_linetable_obj member to a_linetable * Rename a_linetable variable to linetable
1 parent ae3aba9 commit 7862062

1 file changed

Lines changed: 18 additions & 18 deletions

File tree

Python/assemble.c

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,8 @@ struct assembler {
5454
int a_except_table_off; /* offset into exception table */
5555
/* Location Info */
5656
int a_lineno; /* lineno of last emitted instruction */
57-
PyBytesWriter *a_linetable; /* bytes writer containing location info */
58-
PyObject *a_linetable_obj; /* bytes object containing location info */
57+
PyBytesWriter *a_linetable_writer; /* writer containing location info */
58+
PyObject *a_linetable; /* bytes object containing location info */
5959
int a_location_off; /* offset of last written location info frame */
6060
};
6161

@@ -68,8 +68,8 @@ assemble_init(struct assembler *a, int firstlineno)
6868
if (a->a_bytecode == NULL) {
6969
goto error;
7070
}
71-
a->a_linetable = PyBytesWriter_Create(DEFAULT_CNOTAB_SIZE);
72-
if (a->a_linetable == NULL) {
71+
a->a_linetable_writer = PyBytesWriter_Create(DEFAULT_CNOTAB_SIZE);
72+
if (a->a_linetable_writer == NULL) {
7373
goto error;
7474
}
7575
a->a_except_table = PyBytes_FromStringAndSize(NULL, DEFAULT_LNOTAB_SIZE);
@@ -79,7 +79,7 @@ assemble_init(struct assembler *a, int firstlineno)
7979
return SUCCESS;
8080
error:
8181
Py_CLEAR(a->a_bytecode);
82-
PyBytesWriter_Discard(a->a_linetable);
82+
PyBytesWriter_Discard(a->a_linetable_writer);
8383
Py_CLEAR(a->a_except_table);
8484
return ERROR;
8585
}
@@ -88,8 +88,8 @@ static void
8888
assemble_free(struct assembler *a)
8989
{
9090
Py_XDECREF(a->a_bytecode);
91-
PyBytesWriter_Discard(a->a_linetable);
92-
Py_XDECREF(a->a_linetable_obj);
91+
PyBytesWriter_Discard(a->a_linetable_writer);
92+
Py_XDECREF(a->a_linetable);
9393
Py_XDECREF(a->a_except_table);
9494
}
9595

@@ -194,17 +194,17 @@ assemble_exception_table(struct assembler *a, instr_sequence *instrs)
194194
static void
195195
write_location_byte(struct assembler* a, int val)
196196
{
197-
uint8_t *a_linetable = PyBytesWriter_GetData(a->a_linetable);
198-
a_linetable[a->a_location_off] = val & 255;
197+
uint8_t *linetable = PyBytesWriter_GetData(a->a_linetable_writer);
198+
linetable[a->a_location_off] = val & 255;
199199
a->a_location_off++;
200200
}
201201

202202

203203
static uint8_t *
204204
location_pointer(struct assembler* a)
205205
{
206-
uint8_t *a_linetable = PyBytesWriter_GetData(a->a_linetable);
207-
return a_linetable + a->a_location_off;
206+
uint8_t *linetable = PyBytesWriter_GetData(a->a_linetable_writer);
207+
return linetable + a->a_location_off;
208208
}
209209

210210
static void
@@ -285,10 +285,10 @@ write_location_info_no_column(struct assembler* a, int length, int line_delta)
285285
static int
286286
write_location_info_entry(struct assembler* a, location loc, int isize)
287287
{
288-
Py_ssize_t len = PyBytesWriter_GetSize(a->a_linetable);
288+
Py_ssize_t len = PyBytesWriter_GetSize(a->a_linetable_writer);
289289
if (a->a_location_off + THEORETICAL_MAX_ENTRY_SIZE >= len) {
290290
assert(len > THEORETICAL_MAX_ENTRY_SIZE);
291-
RETURN_IF_ERROR(PyBytesWriter_Resize(a->a_linetable, len * 2));
291+
RETURN_IF_ERROR(PyBytesWriter_Resize(a->a_linetable_writer, len * 2));
292292
}
293293
if (loc.lineno == NO_LOCATION.lineno) {
294294
write_location_info_none(a, isize);
@@ -447,13 +447,13 @@ assemble_emit(struct assembler *a, instr_sequence *instrs,
447447
RETURN_IF_ERROR(_PyBytes_Resize(&a->a_except_table, a->a_except_table_off));
448448
RETURN_IF_ERROR(_PyCompile_ConstCacheMergeOne(const_cache, &a->a_except_table));
449449

450-
a->a_linetable_obj = PyBytesWriter_FinishWithSize(a->a_linetable,
450+
a->a_linetable = PyBytesWriter_FinishWithSize(a->a_linetable_writer,
451451
a->a_location_off);
452-
a->a_linetable = NULL;
453-
if (a->a_linetable_obj == NULL) {
452+
a->a_linetable_writer = NULL;
453+
if (a->a_linetable == NULL) {
454454
return ERROR;
455455
}
456-
RETURN_IF_ERROR(_PyCompile_ConstCacheMergeOne(const_cache, &a->a_linetable_obj));
456+
RETURN_IF_ERROR(_PyCompile_ConstCacheMergeOne(const_cache, &a->a_linetable));
457457

458458
RETURN_IF_ERROR(_PyBytes_Resize(&a->a_bytecode, a->a_offset * sizeof(_Py_CODEUNIT)));
459459
RETURN_IF_ERROR(_PyCompile_ConstCacheMergeOne(const_cache, &a->a_bytecode));
@@ -634,7 +634,7 @@ makecode(_PyCompile_CodeUnitMetadata *umd, struct assembler *a, PyObject *const_
634634

635635
.code = a->a_bytecode,
636636
.firstlineno = umd->u_firstlineno,
637-
.linetable = a->a_linetable_obj,
637+
.linetable = a->a_linetable,
638638

639639
.consts = consts,
640640
.names = names,

0 commit comments

Comments
 (0)