8000 py: Change uint to mp_uint_t in runtime.h, stackctrl.h, binary.h. · sparkfun/circuitpython@4abff75 · GitHub
[go: up one dir, main page]

Skip to content

Commit 4abff75

Browse files
committed
py: Change uint to mp_uint_t in runtime.h, stackctrl.h, binary.h.
Part of code cleanup, working towards resolving issue adafruit#50.
1 parent 4d91723 commit 4abff75

21 files changed

+62
-63
lines changed

py/argcheck.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
#include "obj.h"
3535
#include "runtime.h"
3636

37-
void mp_arg_check_num(uint n_args, uint n_kw, uint n_args_min, uint n_args_max, bool takes_kw) {
37+
void mp_arg_check_num(mp_uint_t n_args, mp_uint_t n_kw, mp_uint_t n_args_min, mp_uint_t n_args_max, bool takes_kw) {
3838
// TODO maybe take the function name as an argument so we can print nicer error messages
3939

4040
if (n_kw && !takes_kw) {
@@ -60,9 +60,9 @@ void mp_arg_check_num(uint n_args, uint n_kw, uint n_args_min, uint n_args_max,
6060
}
6161
}
6262

63-
void mp_arg_parse_all(uint n_pos, const mp_obj_t *pos, mp_map_t *kws, uint n_allowed, const mp_arg_t *allowed, mp_arg_val_t *out_vals) {
64-
uint pos_found = 0, kws_found = 0;
65-
for (uint i = 0; i < n_allowed; i++) {
63+
void mp_arg_parse_all(mp_uint_t n_pos, const mp_obj_t *pos, mp_map_t *kws, mp_uint_t n_allowed, const mp_arg_t *allowed, mp_arg_val_t *out_vals) {
64+
mp_uint_t pos_found = 0, kws_found = 0;
65+
for (mp_uint_t i = 0; i < n_allowed; i++) {
6666
mp_obj_t given_arg;
6767
if (i < n_pos) {
6868
if (allowed[i].flags & MP_ARG_KW_ONLY) {
@@ -104,7 +104,7 @@ void mp_arg_parse_all(uint n_pos, const mp_obj_t *pos, mp_map_t *kws, uint n_all
104104
}
105105
}
106106

107-
void mp_arg_parse_all_kw_array(uint n_pos, uint n_kw, const mp_obj_t *args, uint n_allowed, const mp_arg_t *allowed, mp_arg_val_t *out_vals) {
107+
void mp_arg_parse_all_kw_array(mp_uint_t n_pos, mp_uint_t n_kw, const mp_obj_t *args, mp_uint_t n_allowed, const mp_arg_t *allowed, mp_arg_val_t *out_vals) {
108108
mp_map_t kw_args;
109109
mp_map_init_fixed_table(&kw_args, n_kw, args + n_pos);
110110
mp_arg_parse_all(n_pos, args, &kw_args, n_allowed, allowed, out_vals);

py/binary.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
#define alignof(type) offsetof(struct { char c; type t; }, t)
4343
#endif
4444

45-
int mp_binary_get_size(char struct_type, char val_type, uint *palign) {
45+
int mp_binary_get_size(char struct_type, char val_type, mp_uint_t *palign) {
4646
int size = 0;
4747
int align = 1;
4848
switch (struct_type) {
@@ -134,7 +134,7 @@ mp_obj_t mp_binary_get_val_array(char typecode, void *p, int index) {
134134
return MP_OBJ_NEW_SMALL_INT(val);
135135
}
136136

137-
mp_int_t mp_binary_get_int(uint size, bool is_signed, bool big_endian, byte *p) {
137+
mp_int_t mp_binary_get_int(mp_uint_t size, bool is_signed, bool big_endian, byte *p) {
138138
int delta;
139139
if (!big_endian) {
140140
delta = -1;
@@ -159,7 +159,7 @@ mp_int_t mp_binary_get_int(uint size, bool is_signed, bool big_endian, byte *p)
159159
#define is_signed(typecode) (typecode > 'Z')
160160
mp_obj_t mp_binary_get_val(char struct_type, char val_type, byte **ptr) {
161161
byte *p = *ptr;
162-
uint align;
162+
mp_uint_t align;
163163

164164
int size = mp_binary_get_size(struct_type, val_type, &align);
165165
if (struct_type == '@') {
@@ -186,7 +186,7 @@ mp_obj_t mp_binary_get_val(char struct_type, char val_type, byte **ptr) {
186186
}
187187
}
188188

189-
void mp_binary_set_int(uint val_sz, bool big_endian, byte *p, byte *val_ptr) {
189+
void mp_binary_set_int(mp_uint_t val_sz, bool big_endian, byte *p, byte *val_ptr) {
190190
int in_delta, out_delta;
191191
if (big_endian) {
192192
in_delta = -1;
@@ -205,7 +205,7 @@ void mp_binary_set_int(uint val_sz, bool big_endian, byte *p, byte *val_ptr) {
205205

206206
void mp_binary_set_val(char struct_type, char val_type, mp_obj_t val_in, byte **ptr) {
207207
byte *p = *ptr;
208-
uint align;
208+
mp_uint_t align;
209209

210210
int size = mp_binary_get_size(struct_type, val_type, &align);
211211
if (struct_type == '@') {

py/binary.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,11 @@
2828
// (underlyingly they're same).
2929
#define BYTEARRAY_TYPECODE 0
3030

31-
int mp_binary_get_size(char struct_type, char val_type, uint *palign);
31+
int mp_binary_get_size(char struct_type, char val_type, mp_uint_t *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);
3434
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-
mp_int_t mp_binary_get_int(uint size, bool is_signed, bool big_endian, byte *p);
38-
void mp_binary_set_int(uint val_sz, bool big_endian, byte *p, byte *val_ptr);
37+
mp_int_t mp_binary_get_int(mp_uint_t size, bool is_signed, bool big_endian, byte *p);
38+
void mp_binary_set_int(mp_uint_t val_sz, bool big_endian, byte *p, byte *val_ptr);

py/builtin.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -401,7 +401,7 @@ STATIC mp_obj_t mp_builtin_print(mp_uint_t n_args, const mp_obj_t *args, mp_map_
401401
#if MICROPY_PY_IO
402402
mp_stream_write(stream_obj, sep_data, sep_len);
403403
#else
404-
printf("%.*s", sep_len, sep_data);
404+
printf("%.*s", (int)sep_len, sep_data);
405405
#endif
406406
}
407407
#if MICROPY_PY_IO
@@ -413,7 +413,7 @@ STATIC mp_obj_t mp_builtin_print(mp_uint_t n_args, const mp_obj_t *args, mp_map_
413413
#if MICROPY_PY_IO
414414
mp_stream_write(stream_obj, end_data, end_len);
415415
#else
416-
printf("%.*s", end_len, end_data);
416+
printf("%.*s", (int)end_len, end_data);
417417
#endif
418418
return mp_const_none;
419419
}

py/builtin.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,8 @@
2424
* THE SOFTWARE.
2525
*/
2626

27-
mp_obj_t mp_builtin___import__(uint n_args, mp_obj_t *args);
28-
mp_obj_t mp_builtin_open(uint n_args, const mp_obj_t *args);
29-
mp_obj_t mp_builtin_len(mp_obj_t o);
27+
mp_obj_t mp_builtin___import__(mp_uint_t n_args, mp_obj_t *args);
28+
mp_obj_t mp_builtin_open(mp_uint_t n_args, const mp_obj_t *args);
3029

3130
MP_DECLARE_CONST_FUN_OBJ(mp_builtin___build_class___obj);
3231
MP_DECLARE_CONST_FUN_OBJ(mp_builtin___import___obj);

py/builtinimport.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ STATIC void do_load(mp_obj_t module_obj, vstr_t *file) {
165165
mp_globals_set(old_globals);
166166
}
167167

168-
mp_obj_t mp_builtin___import__(uint n_args, mp_obj_t *args) {
168+
mp_obj_t mp_builtin___import__(mp_uint_t n_args, mp_obj_t *args) {
169169
#if DEBUG_PRINT
170170
printf("__import__:\n");
171171
for (int i = 0; i < n_args; i++) {

py/modstruct.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ STATIC mp_obj_t struct_calcsize(mp_obj_t fmt_in) {
101101
char fmt_type = get_fmt_type(&fmt);
102102
mp_uint_t size;
103103
for (size = 0; *fmt; fmt++) {
104-
uint align = 1;
104+
mp_uint_t align = 1;
105105
mp_uint_t cnt = 1;
106106
if (unichar_isdigit(*fmt)) {
107107
cnt = get_fmt_num(&fmt);

py/nativeglue.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ mp_obj_t mp_convert_native_to_obj(mp_uint_t val, mp_uint_t type) {
7171

7272
// wrapper that accepts n_args and n_kw in one argument
7373
// (native emitter can only pass at most 3 arguments to a function)
74-
mp_obj_t mp_native_call_function_n_kw(mp_obj_t fun_in, uint n_args_kw, const mp_obj_t *args) {
74+
mp_obj_t mp_native_call_function_n_kw(mp_obj_t fun_in, mp_uint_t n_args_kw, const mp_obj_t *args) {
7575
return mp_call_function_n_kw(fun_in, n_args_kw & 0xff, (n_args_kw >> 8) & 0xff, args);
7676
}
7777

py/objarray.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ typedef struct _mp_obj_array_t {
5050
} mp_obj_array_t;
5151

5252
STATIC mp_obj_t array_iterator_new(mp_obj_t array_in);
53-
STATIC mp_obj_array_t *array_new(char typecode, uint n);
53+
STATIC mp_obj_array_t *array_new(char typecode, mp_uint_t n);
5454
STATIC mp_obj_t array_append(mp_obj_t self_in, mp_obj_t arg);
5555
STATIC mp_int_t array_get_buffer(mp_obj_t o_in, mp_buffer_info_t *bufinfo, mp_uint_t flags);
5656

@@ -263,7 +263,7 @@ const mp_obj_type_t mp_type_bytearray = {
263263
.locals_dict = (mp_obj_t)&array_locals_dict,
264264
};
265265

266-
STATIC mp_obj_array_t *array_new(char typecode, uint n) {
266+
STATIC mp_obj_array_t *array_new(char typecode, mp_uint_t n) {
267267
int typecode_size = mp_binary_get_size('@', typecode, NULL);
268268
if (typecode_size <= 0) {
269269
nlr_raise(mp_obj_new_exception_msg(&mp_type_ValueError, "bad typecode"));
@@ -281,7 +281,7 @@ mp_uint_t mp_obj_array_len(mp_obj_t self_in) {
281281
return ((mp_obj_array_t *)self_in)->len;
282282
}
283283

284-
mp_obj_t mp_obj_new_bytearray(uint n, void *items) {
284+
mp_obj_t mp_obj_new_bytearray(mp_uint_t n, void *items) {
285285
mp_obj_array_t *o = array_new(BYTEARRAY_TYPECODE, n);
286286
memcpy(o->items, items, n);
287287
return o;

py/objarray.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,4 @@
2424
* THE SOFTWARE.
2525
*/
2626

27-
mp_obj_t mp_obj_new_bytearray(uint n, void *items);
27+
mp_obj_t mp_obj_new_bytearray(mp_uint_t n, void *items);

py/objint.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ mp_obj_t mp_obj_int_binary_op(mp_uint_t op, mp_obj_t lhs_in, mp_obj_t rhs_in) {
235235
}
236236

237237
// This is called only with strings whose value doesn't fit in SMALL_INT
238-
mp_obj_t mp_obj_new_int_from_str_len(const char **str, uint len, bool neg, uint base) {
238+
mp_obj_t mp_obj_new_int_from_str_len(const char **str, mp_uint_t len, bool neg, mp_uint_t base) {
239239
nlr_raise(mp_obj_new_exception_msg(&mp_type_OverflowError, "long int not supported in this build"));
240240
return mp_const_none;
241241
}

py/objstr.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -351,7 +351,7 @@ mp_obj_t mp_obj_str_binary_op(mp_uint_t op, mp_obj_t lhs_in, mp_obj_t rhs_in) {
351351

352352
#if !MICROPY_PY_BUILTINS_STR_UNICODE
353353
// objstrunicode defines own version
354-
const byte *str_index_to_ptr(const mp_obj_type_t *type, const byte *self_data, uint self_len,
354+
const byte *str_index_to_ptr(const mp_obj_type_t *type, const byte *self_data, mp_uint_t self_len,
355355
mp_obj_t index, bool is_slice) {
356356
mp_uint_t index_val = mp_get_index(type, self_len, index, is_slice);
357357
return self_data + index_val;
@@ -1763,7 +1763,7 @@ mp_obj_t mp_obj_str_builder_end_with_len(mp_obj_t o_in, mp_uint_t len) {
17631763
return o;
17641764
}
17651765

1766-
mp_obj_t mp_obj_new_str_of_type(const mp_obj_type_t *type, const byte* data, uint len) {
1766+
mp_obj_t mp_obj_new_str_of_type(const mp_obj_type_t *type, const byte* data, mp_uint_t len) {
17671767
mp_obj_str_t *o = m_new_obj(mp_obj_str_t);
17681768
o->base.type = type;
17691769
o->len = len;

py/objstr.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,12 +51,12 @@ typedef struct _mp_obj_str_t {
5151
else { str_len = ((mp_obj_str_t*)str_obj_in)->len; str_data = ((mp_obj_str_t*)str_obj_in)->data; }
5252

5353
mp_obj_t mp_obj_str_format(mp_uint_t n_args, const mp_obj_t *args);
54-
mp_obj_t mp_obj_new_str_of_type(const mp_obj_type_t *type, const byte* data, uint len);
54+
mp_obj_t mp_obj_new_str_of_type(const mp_obj_type_t *type, const byte* data, mp_uint_t len);
5555

5656
mp_obj_t mp_obj_str_binary_op(mp_uint_t op, mp_obj_t lhs_in, mp_obj_t rhs_in);
5757
mp_int_t mp_obj_str_get_buffer(mp_obj_t self_in, mp_buffer_info_t *bufinfo, mp_uint_t flags);
5858

59-
const byte *str_index_to_ptr(const mp_obj_type_t *type, const byte *self_data, uint self_len,
59+
const byte *str_index_to_ptr(const mp_obj_type_t *type, const byte *self_data, mp_uint_t self_len,
6060
mp_obj_t index, bool is_slice);
6161

6262
MP_DECLARE_CONST_FUN_OBJ(str_encode_obj);

py/objstrunicode.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ STATIC mp_obj_t str_make_new(mp_obj_t type_in, mp_uint_t n_args, mp_uint_t n_kw,
154154

155155
// Convert an index into a pointer to its lead byte. Out of bounds indexing will raise IndexError or
156156
// be capped to the first/last character of the string, depending on is_slice.
157-
const byte *str_index_to_ptr(const mp_obj_type_t *type, const byte *self_data, uint self_len,
157+
const byte *str_index_to_ptr(const mp_obj_type_t *type, const byte *self_data, mp_uint_t self_len,
158158
mp_obj_t index, bool is_slice) {
159159
mp_int_t i;
160160
// Copied from mp_get_index; I don't want bounds checking, just give me

py/runtime.c

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ void mp_delete_global(qstr qstr) {
188188
mp_obj_dict_delete(dict_globals, MP_OBJ_NEW_QSTR(qstr));
189189
}
190190

191-
mp_obj_t mp_unary_op(int op, mp_obj_t arg) {
191+
mp_obj_t mp_unary_op(mp_uint_t op, mp_obj_t arg) {
192192
DEBUG_OP_printf("unary %d %p\n", op, arg);
193193

194194
if (MP_OBJ_IS_SMALL_INT(arg)) {
@@ -224,7 +224,7 @@ mp_obj_t mp_unary_op(int op, mp_obj_t arg) {
224224
}
225225
}
226226

227-
mp_obj_t mp_binary_op(int op, mp_obj_t lhs, mp_obj_t rhs) {
227+
mp_obj_t mp_binary_op(mp_uint_t op, mp_obj_t lhs, mp_obj_t rhs) {
228228
DEBUG_OP_printf("binary %d %p %p\n", op, lhs, rhs);
229229

230230
// TODO correctly distinguish inplace operators for mutable objects
@@ -518,7 +518,7 @@ mp_obj_t mp_call_function_2(mp_obj_t fun, mp_obj_t arg1, mp_obj_t arg2) {
518518
}
519519

520520
// args contains, eg: arg0 arg1 key0 value0 key1 value1
521-
mp_obj_t mp_call_function_n_kw(mp_obj_t fun_in, uint n_args, uint n_kw, const mp_obj_t *args) {
521+
mp_obj_t mp_call_function_n_kw(mp_obj_t fun_in, mp_uint_t n_args, mp_uint_t n_kw, const mp_obj_t *args) {
522522
// TODO improve this: fun object can specify its type and we parse here the arguments,
523523
// passing to the function arrays of fixed and keyword arguments
524524

@@ -537,13 +537,13 @@ mp_obj_t mp_call_function_n_kw(mp_obj_t fun_in, uint n_args, uint n_kw, const mp
537537

538538
// args contains: fun self/NULL arg(0) ... arg(n_args-2) arg(n_args-1) kw_key(0) kw_val(0) ... kw_key(n_kw-1) kw_val(n_kw-1)
539539
// if n_args==0 and n_kw==0 then there are only fun and self/NULL
540-
mp_obj_t mp_call_method_n_kw(uint n_args, uint n_kw, const mp_obj_t *args) {
540+
mp_obj_t mp_call_method_n_kw(mp_uint_t n_args, mp_uint_t n_kw, const mp_obj_t *args) {
541541
DEBUG_OP_printf("call method (fun=%p, self=%p, n_args=%u, n_kw=%u, args=%p)\n", args[0], args[1], n_args, n_kw, args);
542542
int adjust = (args[1] == NULL) ? 0 : 1;
543543
return mp_call_function_n_kw(args[0], n_args + adjust, n_kw, args + 2 - adjust);
544544
}
545545

546-
mp_obj_t mp_call_method_n_kw_var(bool have_self, uint n_args_n_kw, const mp_obj_t *args) {
546+
mp_obj_t mp_call_method_n_kw_var(bool have_self, mp_uint_t n_args_n_kw, const mp_obj_t *args) {
547547
mp_obj_t fun = *args++;
548548
mp_obj_t self = MP_OBJ_NULL;
549549
if (have_self) {
@@ -688,7 +688,7 @@ mp_obj_t mp_call_method_n_kw_var(bool have_self, uint n_args_n_kw, const mp_obj_
688688
}
689689

690690
// unpacked items are stored in reverse order into the array pointed to by items
691-
void mp_unpack_sequence(mp_obj_t seq_in, uint num, mp_obj_t *items) {
691+
void mp_unpack_sequence(mp_obj_t seq_in, mp_uint_t num, mp_obj_t *items) {
692692
mp_uint_t seq_len;
693693
if (MP_OBJ_IS_TYPE(seq_in, &mp_type_tuple) || MP_OBJ_IS_TYPE(seq_in, &mp_type_list)) {
694694
mp_obj_t *seq_items;
@@ -702,7 +702,7 @@ void mp_unpack_sequence(mp_obj_t seq_in, uint num, mp_obj_t *items) {
702702
} else if (seq_len > num) {
703703
goto too_long;
704704
}
705-
for (uint i = 0; i < num; i++) {
705+
for (mp_uint_t i = 0; i < num; i++) {
706706
items[i] = seq_items[num - 1 - i];
707707
}
708708
} else {
@@ -728,9 +728,9 @@ void mp_unpack_sequence(mp_obj_t seq_in, uint num, mp_obj_t *items) {
728728
}
729729

730730
// unpacked items are stored in reverse order into the array pointed to by items
731-
void mp_unpack_ex(mp_obj_t seq_in, uint num_in, mp_obj_t *items) {
732-
uint num_left = num_in & 0xff;
733-
uint num_right = (num_in >> 8) & 0xff;
731+
void mp_unpack_ex(mp_obj_t seq_in, mp_uint_t num_in, mp_obj_t *items) {
732+
mp_uint_t num_left = num_in & 0xff;
733+
mp_uint_t num_right = (num_in >> 8) & 0xff;
734734
DEBUG_OP_printf("unpack ex %d %d\n", num_left, num_right);
735735
mp_uint_t seq_len;
736736
if (MP_OBJ_IS_TYPE(seq_in, &mp_type_tuple) || MP_OBJ_IS_TYPE(seq_in, &mp_type_list)) {
@@ -748,11 +748,11 @@ void mp_unpack_ex(mp_obj_t seq_in, uint num_in, mp_obj_t *items) {
748748
if (seq_len < num_left + num_right) {
749749
goto too_short;
750750
}
751-
for (uint i = 0; i < num_right; i++) {
751+
for (mp_uint_t i = 0; i < num_right; i++) {
752752
items[i] = seq_items[seq_len - 1 - i];
753753
}
754754
items[num_right] = mp_obj_new_list(seq_len - num_left - num_right, seq_items + num_left);
755-
for (uint i = 0; i < num_left; i++) {
755+
for (mp_uint_t i = 0; i < num_left; i++) {
756756
items[num_right + 1 + i] = seq_items[num_left - 1 - i];
757757
}
758758
} else {
@@ -780,7 +780,7 @@ void mp_unpack_ex(mp_obj_t seq_in, uint num_in, mp_obj_t *items) {
780780
goto too_short;
781781
}
782782
items[num_right] = rest;
783-
for (uint i = 0; i < num_right; i++) {
783+
for (mp_uint_t i = 0; i < num_right; i++) {
784784
items[num_right - 1 - i] = rest_items[rest_len - num_right + i];
785785
}
786786
mp_obj_list_set_len(rest, rest_len - num_right);

py/runtime.h

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,9 @@ typedef struct _mp_arg_t {
5454
void mp_init(void);
5555
void mp_deinit(void);
5656

57-
void mp_arg_check_num(uint n_args, uint n_kw, uint n_args_min, uint n_args_max, bool takes_kw);
58-
void mp_arg_parse_all(uint n_pos, const mp_obj_t *pos, mp_map_t *kws, uint n_allowed, const mp_arg_t *allowed, mp_arg_val_t *out_vals);
59-
void mp_arg_parse_all_kw_array(uint n_pos, uint n_kw, const mp_obj_t *args, uint n_allowed, const mp_arg_t *allowed, mp_arg_val_t *out_vals);
57+
void mp_arg_check_num(mp_uint_t n_args, mp_uint_t n_kw, mp_uint_t n_args_min, mp_uint_t n_args_max, bool takes_kw);
58+
void mp_arg_parse_all(mp_uint_t n_pos, const mp_obj_t *pos, mp_map_t *kws, mp_uint_t n_allowed, const mp_arg_t *allowed, mp_arg_val_t *out_vals);
59+
void mp_arg_parse_all_kw_array(mp_uint_t n_pos, mp_uint_t n_kw, const mp_obj_t *args, mp_uint_t n_allowed, const mp_arg_t *allowed, mp_arg_val_t *out_vals);
6060
NORETURN void mp_arg_error_unimpl_kw(void);
6161

6262
mp_obj_dict_t *mp_locals_get(void);
@@ -72,8 +72,8 @@ void mp_store_global(qstr qstr, mp_obj_t obj);
7272
void mp_delete_name(qstr qstr);
7373
void mp_delete_global(qstr qstr);
7474

75-
mp_obj_t mp_unary_op(int op, mp_obj_t arg);
76-
mp_obj_t mp_binary_op(int op, mp_obj_t lhs, mp_obj_t rhs);
75+
mp_obj_t mp_unary_op(mp_uint_t op, mp_obj_t arg);
76+
mp_obj_t mp_binary_op(mp_uint_t op, mp_obj_t lhs, mp_obj_t rhs);
7777

7878
mp_obj_t mp_load_const_int(qstr qstr);
7979
mp_obj_t mp_load_const_dec(qstr qstr);
@@ -83,12 +83,12 @@ mp_obj_t mp_load_const_bytes(qstr qstr);
8383
mp_obj_t mp_call_function_0(mp_obj_t fun);
8484
mp_obj_t mp_call_function_1(mp_obj_t fun, mp_obj_t arg);
8585
mp_obj_t mp_call_function_2(mp_obj_t fun, mp_obj_t arg1, mp_obj_t arg2);
86-
mp_obj_t mp_call_function_n_kw(mp_obj_t fun, uint n_args, uint n_kw, const mp_obj_t *args);
87-
mp_obj_t mp_call_method_n_kw(uint n_args, uint n_kw, const mp_obj_t *args);
88-
mp_obj_t mp_call_method_n_kw_var(bool have_self, uint n_args_n_kw, const mp_obj_t *args);
86+
mp_obj_t mp_call_function_n_kw(mp_obj_t fun, mp_uint_t n_args, mp_uint_t n_kw, const mp_obj_t *args);
87+
mp_obj_t mp_call_method_n_kw(mp_uint_t n_args, mp_uint_t n_kw, const mp_obj_t *args);
88+
mp_obj_t mp_call_method_n_kw_var(bool have_self, mp_uint_t n_args_n_kw, const mp_obj_t *args);
8989

90-
void mp_unpack_sequence(mp_obj_t seq, uint num, mp_obj_t *items);
91-
void mp_unpack_ex(mp_obj_t seq, uint num, mp_obj_t *items);
90+
void mp_unpack_sequence(mp_obj_t seq, mp_uint_t num, mp_obj_t *items);
91+
void mp_unpack_ex(mp_obj_t seq, mp_uint_t num, mp_obj_t *items);
9292
mp_obj_t mp_store_map(mp_obj_t map, mp_obj_t key, mp_obj_t value);
9393
mp_obj_t mp_load_attr(mp_obj_t base, qstr attr);
9494
void mp_load_method(mp_obj_t base, qstr attr, mp_obj_t *dest);
@@ -113,7 +113,7 @@ NORETURN void mp_not_implemented(const char *msg);
113113
// helper functions for native/viper code
114114
mp_uint_t mp_convert_obj_to_native(mp_obj_t obj, mp_uint_t type);
115115
mp_obj_t mp_convert_native_to_obj(mp_uint_t val, mp_uint_t type);
116-
mp_obj_t mp_native_call_function_n_kw(mp_obj_t fun_in, uint n_args_kw, const mp_obj_t *args);
116+
mp_obj_t mp_native_call_function_n_kw(mp_obj_t fun_in, mp_uint_t n_args_kw, const mp_obj_t *args);
117117
NORETURN void mp_native_raise(mp_obj_t o);
118118

119119
extern struct _mp_obj_list_t mp_sys_path_obj;

py/scope.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
#include "emitglue.h"
3838
#include "scope.h"
3939

40-
scope_t *scope_new(scope_kind_t kind, mp_parse_node_t pn, qstr source_file, uint emit_options) {
40+
scope_t *scope_new(scope_kind_t kind, mp_parse_node_t pn, qstr source_file, mp_uint_t emit_options) {
4141
scope_t *scope = m_new0(scope_t, 1);
4242
scope->kind = kind;
4343
scope->pn = pn;

py/scope.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ typedef struct _scope_t {
6969
id_info_t *id_info;
7070
} scope_t;
7171

72-
scope_t *scope_new(scope_kind_t kind, mp_parse_node_t pn, qstr source_file, uint emit_options);
72+
scope_t *scope_new(scope_kind_t kind, mp_parse_node_t pn, qstr source_file, mp_uint_t emit_options);
7373
void scope_free(scope_t *scope);
7474
id_info_t *scope_find_or_add_id(scope_t *scope, qstr qstr, bool *added);
7575
id_info_t *scope_find(scope_t *scope, qstr qstr);

0 commit comments

Comments
 (0)
0