Skip to content

Commit 40f3c02

Browse files
committed
Rename machine_(u)int_t to mp_(u)int_t.
See discussion in issue micropython#50.
1 parent 065aba5 commit 40f3c02

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

99 files changed

+598
-604
lines changed

bare-arm/mpconfigport.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@
3737
#define UINT_FMT "%lu"
3838
#define INT_FMT "%ld"
3939

40-
typedef int32_t machine_int_t; // must be pointer size
41-
typedef uint32_t machine_uint_t; // must be pointer size
40+
typedef int32_t mp_int_t; // must be pointer size
41+
typedef uint32_t mp_uint_t; // must be pointer size
4242
typedef void *machine_ptr_t; // must be of pointer size
4343
typedef const void *machine_const_ptr_t; // must be of pointer size
4444

py/asmthumb.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ uint asm_thumb_get_code_size(asm_thumb_t *as) {
133133

134134
void *asm_thumb_get_code(asm_thumb_t *as) {
135135
// need to set low bit to indicate that it's thumb code
136-
return (void *)(((machine_uint_t)as->code_base) | 1);
136+
return (void *)(((mp_uint_t)as->code_base) | 1);
137137
}
138138

139139
/*
@@ -378,7 +378,7 @@ void asm_thumb_bcc_n(asm_thumb_t *as, int cond, uint label) {
378378
}
379379
}
380380

381-
void asm_thumb_mov_reg_i32(asm_thumb_t *as, uint reg_dest, machine_uint_t i32) {
381+
void asm_thumb_mov_reg_i32(asm_thumb_t *as, uint reg_dest, mp_uint_t i32) {
382382
// movw, movt does it in 8 bytes
383383
// ldr [pc, #], dw does it in 6 bytes, but we might not reach to end of code for dw
384384

@@ -499,7 +499,7 @@ void asm_thumb_bl_ind(asm_thumb_t *as, void *fun_ptr, uint fun_id, uint reg_temp
499499
if (0) {
500500
// load ptr to function into register using immediate, then branch
501501
// not relocatable
502-
asm_thumb_mov_reg_i32(as, reg_temp, (machine_uint_t)fun_ptr);
502+
asm_thumb_mov_reg_i32(as, reg_temp, (mp_uint_t)fun_ptr);
503503
asm_thumb_op16(as, OP_BLX(reg_temp));
504504
} else if (1) {
505505
asm_thumb_op16(as, OP_FORMAT_9_10(ASM_THUMB_FORMAT_9_LDR | ASM_THUMB_FORMAT_9_WORD_TRANSFER, reg_temp, REG_R7, fun_id));

py/asmthumb.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ void asm_thumb_ite_ge(asm_thumb_t *as);
185185
void asm_thumb_b_n(asm_thumb_t *as, uint label);
186186
void asm_thumb_bcc_n(asm_thumb_t *as, int cond, uint label);
187187

188-
void asm_thumb_mov_reg_i32(asm_thumb_t *as, uint reg_dest, machine_uint_t i32_src); // convenience
188+
void asm_thumb_mov_reg_i32(asm_thumb_t *as, uint reg_dest, mp_uint_t i32_src); // convenience
189189
void asm_thumb_mov_reg_i32_optimised(asm_thumb_t *as, uint reg_dest, int i32_src); // convenience
190190
void asm_thumb_mov_reg_i32_aligned(asm_thumb_t *as, uint reg_dest, int i32); // convenience
191191
void asm_thumb_mov_local_reg(asm_thumb_t *as, int local_num_dest, uint rlo_src); // convenience

py/bc.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,6 @@ void mp_bytecode_print(const void *descr, const byte *code, int len);
5555
void mp_bytecode_print2(const byte *code, int len);
5656

5757
// Helper macros to access pointer with least significant bit holding a flag
58-
#define MP_TAGPTR_PTR(x) ((void*)((machine_uint_t)(x) & ~((machine_uint_t)1)))
59-
#define MP_TAGPTR_TAG(x) ((machine_uint_t)(x) & 1)
60-
#define MP_TAGPTR_MAKE(ptr, tag) ((void*)((machine_uint_t)(ptr) | tag))
58+
#define MP_TAGPTR_PTR(x) ((void*)((mp_uint_t)(x) & ~((mp_uint_t)1)))
59+
#define MP_TAGPTR_TAG(x) ((mp_uint_t)(x) & 1)
60+
#define MP_TAGPTR_MAKE(ptr, tag) ((void*)((mp_uint_t)(ptr) | tag))

py/binary.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ int mp_binary_get_size(char struct_type, char val_type, uint *palign) {
8888
}
8989

9090
mp_obj_t mp_binary_get_val_array(char typecode, void *p, int index) {
91-
machine_int_t val = 0;
91+
mp_int_t val = 0;
9292
switch (typecode) {
9393
case 'b':
9494
val = ((int8_t*)p)[index];
@@ -125,7 +125,7 @@ mp_obj_t mp_binary_get_val_array(char typecode, void *p, int index) {
125125
return MP_OBJ_NEW_SMALL_INT(val);
126126
}
127127

128-
machine_int_t mp_binary_get_int(uint size, bool is_signed, bool big_endian, byte *p) {
128+
mp_int_t mp_binary_get_int(uint size, bool is_signed, bool big_endian, byte *p) {
129129
int delta;
130130
if (!big_endian) {
131131
delta = -1;
@@ -134,7 +134,7 @@ machine_int_t mp_binary_get_int(uint size, bool is_signed, bool big_endian, byte
134134
delta = 1;
135135
}
136136

137-
machine_int_t val = 0;
137+
mp_int_t val = 0;
138138
if (is_signed && *p & 0x80) {
139139
val = -1;
140140
}
@@ -155,7 +155,7 @@ mp_obj_t mp_binary_get_val(char struct_type, char val_type, byte **ptr) {
155155
int size = mp_binary_get_size(struct_type, val_type, &align);
156156
if (struct_type == '@') {
157157
// Make pointer aligned
158-
p = (byte*)(((machine_uint_t)p + align - 1) & ~((machine_uint_t)align - 1));
158+
p = (byte*)(((mp_uint_t)p + align - 1) & ~((mp_uint_t)align - 1));
159159
#if MP_ENDIANNESS_LITTLE
160160
struct_type = '<';
161161
#else
@@ -164,7 +164,7 @@ mp_obj_t mp_binary_get_val(char struct_type, char val_type, byte **ptr) {
164164
}
165165
*ptr = p + size;
166166

167-
machine_int_t val = mp_binary_get_int(size, is_signed(val_type), (struct_type == '>'), p);
167+
mp_int_t val = mp_binary_get_int(size, is_signed(val_type), (struct_type == '>'), p);
168168

169169
if (val_type == 'O') {
170170
return (mp_obj_t)val;
@@ -184,7 +184,7 @@ void mp_binary_set_val(char struct_type, char val_type, mp_obj_t val_in, byte **
184184
int size = mp_binary_get_size(struct_type, val_type, &align);
185185
if (struct_type == '@') {
186186
// Make pointer aligned
187-
p = (byte*)(((machine_uint_t)p + align - 1) & ~((machine_uint_t)align - 1));
187+
p = (byte*)(((mp_uint_t)p + align - 1) & ~((mp_uint_t)align - 1));
188188
#if MP_ENDIANNESS_LITTLE
189189
struct_type = '<';
190190
#else
@@ -196,7 +196,7 @@ void mp_binary_set_val(char struct_type, char val_type, mp_obj_t val_in, byte **
196196
#if MP_ENDIANNESS_BIG
197197
#error Not implemented
198198
#endif
199-
machine_int_t val;
199+
mp_int_t val;
200200
byte *in = (byte*)&val;
201201
switch (val_type) {
202202
case 'O':
@@ -239,7 +239,7 @@ void mp_binary_set_val_array(char typecode, void *p, int index, mp_obj_t val_in)
239239
}
240240
}
241241

242-
void mp_binary_set_val_array_from_int(char typecode, void *p, int index, machine_int_t val) {
242+
void mp_binary_set_val_array_from_int(char typecode, void *p, int index, mp_int_t val) {
243243
switch (typecode) {
244244
case 'b':
245245
((int8_t*)p)[index] = val;

py/binary.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
int mp_binary_get_size(char struct_type, char val_type, uint *palign);
3232
mp_obj_t mp_binary_get_val_array(char typecode, void *p, int index);
3333
void mp_binary_set_val_array(char typecode, void *p, int index, mp_obj_t val_in);
34-
void mp_binary_set_val_array_from_int(char typecode, void *p, int index, machine_int_t val);
34+
void mp_binary_set_val_array_from_int(char typecode, void *p, int index, mp_int_t val);
3535
mp_obj_t mp_binary_get_val(char struct_type, char val_type, byte **ptr);
3636
void mp_binary_set_val(char struct_type, char val_type, mp_obj_t val_in, byte **ptr);
37-
machine_int_t mp_binary_get_int(uint size, bool is_signed, bool big_endian, byte *p);
37+
mp_int_t mp_binary_get_int(uint size, bool is_signed, bool big_endian, byte *p);

py/builtin.c

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ MP_DEFINE_CONST_FUN_OBJ_1(mp_builtin___repl_print___obj, mp_builtin___repl_print
9999

100100
mp_obj_t mp_builtin_abs(mp_obj_t o_in) {
101101
if (MP_OBJ_IS_SMALL_INT(o_in)) {
102-
mp_small_int_t val = MP_OBJ_SMALL_INT_VALUE(o_in);
102+
mp_int_t val = MP_OBJ_SMALL_INT_VALUE(o_in);
103103
if (val < 0) {
104104
val = -val;
105105
}
@@ -173,7 +173,7 @@ MP_DEFINE_CONST_FUN_OBJ_1(mp_builtin_callable_obj, mp_builtin_callable);
173173

174174
STATIC mp_obj_t mp_builtin_chr(mp_obj_t o_in) {
175175
#if MICROPY_PY_BUILTINS_STR_UNICODE
176-
machine_int_t c = mp_obj_get_int(o_in);
176+
mp_int_t c = mp_obj_get_int(o_in);
177177
char str[4];
178178
int len = 0;
179179
if (c < 0x80) {
@@ -198,7 +198,7 @@ STATIC mp_obj_t mp_builtin_chr(mp_obj_t o_in) {
198198
}
199199
return mp_obj_new_str(str, len, true);
200200
#else
201-
machine_int_t ord = mp_obj_get_int(o_in);
201+
mp_int_t ord = mp_obj_get_int(o_in);
202202
if (0 <= ord && ord <= 0x10ffff) {
203203
char str[1] = {ord};
204204
return mp_obj_new_str(str, 1, true);
@@ -250,8 +250,8 @@ MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(mp_builtin_dir_obj, 0, 1, mp_builtin_dir);
250250

251251
STATIC mp_obj_t mp_builtin_divmod(mp_obj_t o1_in, mp_obj_t o2_in) {
252252
if (MP_OBJ_IS_SMALL_INT(o1_in) && MP_OBJ_IS_SMALL_INT(o2_in)) {
253-
mp_small_int_t i1 = MP_OBJ_SMALL_INT_VALUE(o1_in);
254-
mp_small_int_t i2 = MP_OBJ_SMALL_INT_VALUE(o2_in);
253+
mp_int_t i1 = MP_OBJ_SMALL_INT_VALUE(o1_in);
254+
mp_int_t i2 = MP_OBJ_SMALL_INT_VALUE(o2_in);
255255
mp_obj_t args[2];
256256
args[0] = MP_OBJ_NEW_SMALL_INT(i1 / i2);
257257
args[1] = MP_OBJ_NEW_SMALL_INT(i1 % i2);
@@ -372,11 +372,11 @@ STATIC mp_obj_t mp_builtin_ord(mp_obj_t o_in) {
372372
uint len;
373373
const char *str = mp_obj_str_get_data(o_in, &len);
374374
#if MICROPY_PY_BUILTINS_STR_UNICODE
375-
machine_uint_t charlen = unichar_charlen(str, len);
375+
mp_uint_t charlen = unichar_charlen(str, len);
376376
if (charlen == 1) {
377377
if (MP_OBJ_IS_STR(o_in) && UTF8_IS_NONASCII(*str)) {
378-
machine_int_t ord = *str++ & 0x7F;
379-
for (machine_int_t mask = 0x40; ord & mask; mask >>= 1) {
378+
mp_int_t ord = *str++ & 0x7F;
379+
for (mp_int_t mask = 0x40; ord & mask; mask >>= 1) {
380380
ord &= ~mask;
381381
}
382382
while (UTF8_IS_CONT(*str)) {
@@ -478,7 +478,7 @@ STATIC mp_obj_t mp_builtin_sorted(uint n_args, const mp_obj_t *args, mp_map_t *k
478478
MP_DEFINE_CONST_FUN_OBJ_KW(mp_builtin_sorted_obj, 1, mp_builtin_sorted);
479479

480480
STATIC mp_obj_t mp_builtin_id(mp_obj_t o_in) {
481-
return mp_obj_new_int((machine_int_t)o_in);
481+
return mp_obj_new_int((mp_int_t)o_in);
482482
}
483483

484484
MP_DEFINE_CONST_FUN_OBJ_1(mp_builtin_id_obj, mp_builtin_id);

py/compile.c

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ typedef struct _compiler_t {
9595
STATIC void compile_syntax_error(compiler_t *comp, mp_parse_node_t pn, const char *msg) {
9696
// TODO store the error message to a variable in compiler_t instead of printing it
9797
if (MP_PARSE_NODE_IS_STRUCT(pn)) {
98-
printf(" File \"%s\", line " UINT_FMT "\n", qstr_str(comp->source_file), (machine_uint_t)((mp_parse_node_struct_t*)pn)->source_line);
98+
printf(" File \"%s\", line " UINT_FMT "\n", qstr_str(comp->source_file), (mp_uint_t)((mp_parse_node_struct_t*)pn)->source_line);
9999
} else {
100100
printf(" File \"%s\"\n", qstr_str(comp->source_file));
101101
}
@@ -158,7 +158,7 @@ STATIC mp_parse_node_t fold_constants(compiler_t *comp, mp_parse_node_t pn, mp_m
158158
compile_syntax_error(comp, (mp_parse_node_t)pns, "constant must be an integer");
159159
break;
160160
}
161-
machine_int_t value = MP_PARSE_NODE_LEAF_SMALL_INT(pn_value);
161+
mp_int_t value = MP_PARSE_NODE_LEAF_SMALL_INT(pn_value);
162162

163163
// store the value in the table of dynamic constants
164164
mp_map_elem_t *elem = mp_map_lookup(consts, MP_OBJ_NEW_QSTR(id_qstr), MP_MAP_LOOKUP_ADD_IF_NOT_FOUND);
@@ -200,25 +200,25 @@ STATIC mp_parse_node_t fold_constants(compiler_t *comp, mp_parse_node_t pn, mp_m
200200
case PN_expr:
201201
if (n == 2 && MP_PARSE_NODE_IS_SMALL_INT(pns->nodes[0]) && MP_PARSE_NODE_IS_SMALL_INT(pns->nodes[1])) {
202202
// int | int
203-
machine_int_t arg0 = MP_PARSE_NODE_LEAF_SMALL_INT(pns->nodes[0]);
204-
machine_int_t arg1 = MP_PARSE_NODE_LEAF_SMALL_INT(pns->nodes[1]);
203+
mp_int_t arg0 = MP_PARSE_NODE_LEAF_SMALL_INT(pns->nodes[0]);
204+
mp_int_t arg1 = MP_PARSE_NODE_LEAF_SMALL_INT(pns->nodes[1]);
205205
pn = mp_parse_node_new_leaf(MP_PARSE_NODE_SMALL_INT, arg0 | arg1);
206206
}
207207
break;
208208

209209
case PN_and_expr:
210210
if (n == 2 && MP_PARSE_NODE_IS_SMALL_INT(pns->nodes[0]) && MP_PARSE_NODE_IS_SMALL_INT(pns->nodes[1])) {
211211
// int & int
212-
machine_int_t arg0 = MP_PARSE_NODE_LEAF_SMALL_INT(pns->nodes[0]);
213-
machine_int_t arg1 = MP_PARSE_NODE_LEAF_SMALL_INT(pns->nodes[1]);
212+
mp_int_t arg0 = MP_PARSE_NODE_LEAF_SMALL_INT(pns->nodes[0]);
213+
mp_int_t arg1 = MP_PARSE_NODE_LEAF_SMALL_INT(pns->nodes[1]);
214214
pn = mp_parse_node_new_leaf(MP_PARSE_NODE_SMALL_INT, arg0 & arg1);
215215
}
216216
break;
217217

218218
case PN_shift_expr:
219219
if (n == 3 && MP_PARSE_NODE_IS_SMALL_INT(pns->nodes[0]) && MP_PARSE_NODE_IS_SMALL_INT(pns->nodes[2])) {
220-
machine_int_t arg0 = MP_PARSE_NODE_LEAF_SMALL_INT(pns->nodes[0]);
221-
machine_int_t arg1 = MP_PARSE_NODE_LEAF_SMALL_INT(pns->nodes[2]);
220+
mp_int_t arg0 = MP_PARSE_NODE_LEAF_SMALL_INT(pns->nodes[0]);
221+
mp_int_t arg1 = MP_PARSE_NODE_LEAF_SMALL_INT(pns->nodes[2]);
222222
if (MP_PARSE_NODE_IS_TOKEN_KIND(pns->nodes[1], MP_TOKEN_OP_DBL_LESS)) {
223223
// int << int
224224
if (!(arg1 >= BITS_PER_WORD || arg0 > (MP_SMALL_INT_MAX >> arg1) || arg0 < (MP_SMALL_INT_MIN >> arg1))) {
@@ -235,10 +235,10 @@ STATIC mp_parse_node_t fold_constants(compiler_t *comp, mp_parse_node_t pn, mp_m
235235
break;
236236

237237
case PN_arith_expr:
238-
// overflow checking here relies on SMALL_INT being strictly smaller than machine_int_t
238+
// overflow checking here relies on SMALL_INT being strictly smaller than mp_int_t
239239
if (n == 3 && MP_PARSE_NODE_IS_SMALL_INT(pns->nodes[0]) && MP_PARSE_NODE_IS_SMALL_INT(pns->nodes[2])) {
240-
machine_int_t arg0 = MP_PARSE_NODE_LEAF_SMALL_INT(pns->nodes[0]);
241-
machine_int_t arg1 = MP_PARSE_NODE_LEAF_SMALL_INT(pns->nodes[2]);
240+
mp_int_t arg0 = MP_PARSE_NODE_LEAF_SMALL_INT(pns->nodes[0]);
241+
mp_int_t arg1 = MP_PARSE_NODE_LEAF_SMALL_INT(pns->nodes[2]);
242242
if (MP_PARSE_NODE_IS_TOKEN_KIND(pns->nodes[1], MP_TOKEN_OP_PLUS)) {
243243
// int + int
244244
arg0 += arg1;
@@ -258,8 +258,8 @@ STATIC mp_parse_node_t fold_constants(compiler_t *comp, mp_parse_node_t pn, mp_m
258258

259259
case PN_term:
260260
if (n == 3 && MP_PARSE_NODE_IS_SMALL_INT(pns->nodes[0]) && MP_PARSE_NODE_IS_SMALL_INT(pns->nodes[2])) {
261-
machine_int_t arg0 = MP_PARSE_NODE_LEAF_SMALL_INT(pns->nodes[0]);
262-
machine_int_t arg1 = MP_PARSE_NODE_LEAF_SMALL_INT(pns->nodes[2]);
261+
mp_int_t arg0 = MP_PARSE_NODE_LEAF_SMALL_INT(pns->nodes[0]);
262+
mp_int_t arg1 = MP_PARSE_NODE_LEAF_SMALL_INT(pns->nodes[2]);
263263
if (MP_PARSE_NODE_IS_TOKEN_KIND(pns->nodes[1], MP_TOKEN_OP_STAR)) {
264264
// int * int
265265
if (!mp_small_int_mul_overflow(arg0, arg1)) {
@@ -288,7 +288,7 @@ STATIC mp_parse_node_t fold_constants(compiler_t *comp, mp_parse_node_t pn, mp_m
288288

289289
case PN_factor_2:
290290
if (MP_PARSE_NODE_IS_SMALL_INT(pns->nodes[1])) {
291-
machine_int_t arg = MP_PARSE_NODE_LEAF_SMALL_INT(pns->nodes[1]);
291+
mp_int_t arg = MP_PARSE_NODE_LEAF_SMALL_INT(pns->nodes[1]);
292292
if (MP_PARSE_NODE_IS_TOKEN_KIND(pns->nodes[0], MP_TOKEN_OP_PLUS)) {
293293
// +int
294294
pn = mp_parse_node_new_leaf(MP_PARSE_NODE_SMALL_INT, arg);
@@ -336,7 +336,7 @@ STATIC mp_parse_node_t fold_constants(compiler_t *comp, mp_parse_node_t pn, mp_m
336336
mp_obj_t dest[2];
337337
mp_load_method_maybe(elem->value, q_attr, dest);
338338
if (MP_OBJ_IS_SMALL_INT(dest[0]) && dest[1] == NULL) {
339-
machine_int_t val = MP_OBJ_SMALL_INT_VALUE(dest[0]);
339+
mp_int_t val = MP_OBJ_SMALL_INT_VALUE(dest[0]);
340340
if (MP_SMALL_INT_FITS(val)) {
341341
pn = mp_parse_node_new_leaf(MP_PARSE_NODE_SMALL_INT, val);
342342
}
@@ -482,7 +482,7 @@ STATIC void cpython_c_print_quoted_str(vstr_t *vstr, const char *str, uint len,
482482
STATIC void cpython_c_tuple_emit_const(compiler_t *comp, mp_parse_node_t pn, vstr_t *vstr) {
483483
if (MP_PARSE_NODE_IS_STRUCT_KIND(pn, PN_string)) {
484484
mp_parse_node_struct_t *pns = (mp_parse_node_struct_t*)pn;
485-
cpython_c_print_quoted_str(vstr, (const char*)pns->nodes[0], (machine_uint_t)pns->nodes[1], false);
485+
cpython_c_print_quoted_str(vstr, (const char*)pns->nodes[0], (mp_uint_t)pns->nodes[1], false);
486486
return;
487487
}
488488

@@ -2528,7 +2528,7 @@ void compile_atom_string(compiler_t *comp, mp_parse_node_struct_t *pns) {
25282528
mp_parse_node_struct_t *pns_string = (mp_parse_node_struct_t*)pns->nodes[i];
25292529
assert(MP_PARSE_NODE_STRUCT_KIND(pns_string) == PN_string);
25302530
pn_kind = MP_PARSE_NODE_STRING;
2531-
n_bytes += (machine_uint_t)pns_string->nodes[1];
2531+
n_bytes += (mp_uint_t)pns_string->nodes[1];
25322532
}
25332533
if (i == 0) {
25342534
string_kind = pn_kind;
@@ -2549,8 +2549,8 @@ void compile_atom_string(compiler_t *comp, mp_parse_node_struct_t *pns) {
25492549
s_dest += s_len;
25502550
} else {
25512551
mp_parse_node_struct_t *pns_string = (mp_parse_node_struct_t*)pns->nodes[i];
2552-
memcpy(s_dest, (const char*)pns_string->nodes[0], (machine_uint_t)pns_string->nodes[1]);
2553-
s_dest += (machine_uint_t)pns_string->nodes[1];
2552+
memcpy(s_dest, (const char*)pns_string->nodes[0], (mp_uint_t)pns_string->nodes[1]);
2553+
s_dest += (mp_uint_t)pns_string->nodes[1];
25542554
}
25552555
}
25562556
qstr q = qstr_build_end(q_ptr);
@@ -2858,10 +2858,10 @@ void compile_node(compiler_t *comp, mp_parse_node_t pn) {
28582858
if (MP_PARSE_NODE_IS_NULL(pn)) {
28592859
// pass
28602860
} else if (MP_PARSE_NODE_IS_SMALL_INT(pn)) {
2861-
machine_int_t arg = MP_PARSE_NODE_LEAF_SMALL_INT(pn);
2861+
mp_int_t arg = MP_PARSE_NODE_LEAF_SMALL_INT(pn);
28622862
EMIT_ARG(load_const_small_int, arg);
28632863
} else if (MP_PARSE_NODE_IS_LEAF(pn)) {
2864-
machine_uint_t arg = MP_PARSE_NODE_LEAF_ARG(pn);
2864+
mp_uint_t arg = MP_PARSE_NODE_LEAF_ARG(pn);
28652865
switch (MP_PARSE_NODE_LEAF_KIND(pn)) {
28662866
case MP_PARSE_NODE_ID: EMIT_ARG(load_id, arg); break;
28672867
case MP_PARSE_NODE_INTEGER: EMIT_ARG(load_const_int, arg); break;
@@ -2883,7 +2883,7 @@ void compile_node(compiler_t *comp, mp_parse_node_t pn) {
28832883
mp_parse_node_struct_t *pns = (mp_parse_node_struct_t*)pn;
28842884
EMIT_ARG(set_line_number, pns->source_line);
28852885
if (MP_PARSE_NODE_STRUCT_KIND(pns) == PN_string) {
2886-
EMIT_ARG(load_const_str, qstr_from_strn((const char*)pns->nodes[0], (machine_uint_t)pns->nodes[1]), false);
2886+
EMIT_ARG(load_const_str, qstr_from_strn((const char*)pns->nodes[0], (mp_uint_t)pns->nodes[1]), false);
28872887
} else {
28882888
compile_function_t f = compile_function[MP_PARSE_NODE_STRUCT_KIND(pns)];
28892889
if (f == NULL) {
@@ -3337,7 +3337,7 @@ STATIC void compile_scope_inline_asm(compiler_t *comp, scope_t *scope, pass_kind
33373337
return;
33383338
}
33393339
if (pass > MP_PASS_SCOPE) {
3340-
machine_int_t bytesize = MP_PARSE_NODE_LEAF_SMALL_INT(pn_arg[0]);
3340+
mp_int_t bytesize = MP_PARSE_NODE_LEAF_SMALL_INT(pn_arg[0]);
33413341
for (uint i = 1; i < n_args; i++) {
33423342
if (!MP_PARSE_NODE_IS_SMALL_INT(pn_arg[i])) {
33433343
compile_syntax_error(comp, nodes[i], "inline assembler 'data' requires integer arguments");

py/emit.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ typedef struct _emit_method_table_t {
6565
void (*import_from)(emit_t *emit, qstr qstr);
6666
void (*import_star)(emit_t *emit);
6767
void (*load_const_tok)(emit_t *emit, mp_token_kind_t tok);
68-
void (*load_const_small_int)(emit_t *emit, machine_int_t arg);
68+
void (*load_const_small_int)(emit_t *emit, mp_int_t arg);
6969
void (*load_const_int)(emit_t *emit, qstr qstr);
7070
void (*load_const_dec)(emit_t *emit, qstr qstr);
7171
void (*load_const_str)(emit_t *emit, qstr qstr, bool bytes);

0 commit comments

Comments
 (0)