diff options
Diffstat (limited to 'py')
-rw-r--r-- | py/obj.h | 22 | ||||
-rw-r--r-- | py/objarray.c | 8 | ||||
-rw-r--r-- | py/objbool.c | 6 | ||||
-rw-r--r-- | py/objboundmeth.c | 2 | ||||
-rw-r--r-- | py/objclosure.c | 2 | ||||
-rw-r--r-- | py/objcomplex.c | 8 | ||||
-rw-r--r-- | py/objdict.c | 8 | ||||
-rw-r--r-- | py/objenumerate.c | 2 | ||||
-rw-r--r-- | py/objexcept.c | 4 | ||||
-rw-r--r-- | py/objfilter.c | 2 | ||||
-rw-r--r-- | py/objfloat.c | 8 | ||||
-rw-r--r-- | py/objfun.c | 12 | ||||
-rw-r--r-- | py/objgenerator.c | 4 | ||||
-rw-r--r-- | py/objint.c | 12 | ||||
-rw-r--r-- | py/objint.h | 6 | ||||
-rw-r--r-- | py/objint_longlong.c | 4 | ||||
-rw-r--r-- | py/objint_mpz.c | 4 | ||||
-rw-r--r-- | py/objlist.c | 24 | ||||
-rw-r--r-- | py/objmap.c | 6 | ||||
-rw-r--r-- | py/objnamedtuple.c | 2 | ||||
-rw-r--r-- | py/objnone.c | 2 | ||||
-rw-r--r-- | py/objobject.c | 4 | ||||
-rw-r--r-- | py/objproperty.c | 2 | ||||
-rw-r--r-- | py/objrange.c | 4 | ||||
-rw-r--r-- | py/objreversed.c | 2 | ||||
-rw-r--r-- | py/objset.c | 14 | ||||
-rw-r--r-- | py/objstr.c | 46 | ||||
-rw-r--r-- | py/objstr.h | 4 | ||||
-rw-r--r-- | py/objstringio.c | 4 | ||||
-rw-r--r-- | py/objstrunicode.c | 4 | ||||
-rw-r--r-- | py/objtuple.c | 10 | ||||
-rw-r--r-- | py/objtuple.h | 4 | ||||
-rw-r--r-- | py/objtype.c | 22 | ||||
-rw-r--r-- | py/objzip.c | 2 |
34 files changed, 135 insertions, 135 deletions
@@ -180,8 +180,8 @@ typedef mp_obj_t (*mp_fun_0_t)(void); typedef mp_obj_t (*mp_fun_1_t)(mp_obj_t); typedef mp_obj_t (*mp_fun_2_t)(mp_obj_t, mp_obj_t); typedef mp_obj_t (*mp_fun_3_t)(mp_obj_t, mp_obj_t, mp_obj_t); -typedef mp_obj_t (*mp_fun_var_t)(uint n, const mp_obj_t *); -typedef mp_obj_t (*mp_fun_kw_t)(uint n, const mp_obj_t *, mp_map_t *); +typedef mp_obj_t (*mp_fun_var_t)(mp_uint_t n, const mp_obj_t *); +typedef mp_obj_t (*mp_fun_kw_t)(mp_uint_t n, const mp_obj_t *, mp_map_t *); typedef enum { PRINT_STR = 0, @@ -191,10 +191,10 @@ typedef enum { } mp_print_kind_t; typedef void (*mp_print_fun_t)(void (*print)(void *env, const char *fmt, ...), void *env, mp_obj_t o, mp_print_kind_t kind); -typedef mp_obj_t (*mp_make_new_fun_t)(mp_obj_t type_in, uint n_args, uint n_kw, const mp_obj_t *args); -typedef mp_obj_t (*mp_call_fun_t)(mp_obj_t fun, uint n_args, uint n_kw, const mp_obj_t *args); -typedef mp_obj_t (*mp_unary_op_fun_t)(int op, mp_obj_t); -typedef mp_obj_t (*mp_binary_op_fun_t)(int op, mp_obj_t, mp_obj_t); +typedef mp_obj_t (*mp_make_new_fun_t)(mp_obj_t type_in, mp_uint_t n_args, mp_uint_t n_kw, const mp_obj_t *args); +typedef mp_obj_t (*mp_call_fun_t)(mp_obj_t fun, mp_uint_t n_args, mp_uint_t n_kw, const mp_obj_t *args); +typedef mp_obj_t (*mp_unary_op_fun_t)(mp_uint_t op, mp_obj_t); +typedef mp_obj_t (*mp_binary_op_fun_t)(mp_uint_t op, mp_obj_t, mp_obj_t); typedef void (*mp_load_attr_fun_t)(mp_obj_t self_in, qstr attr, mp_obj_t *dest); // for fail, do nothing; for attr, dest[0] = value; for method, dest[0] = method, dest[1] = self typedef bool (*mp_store_attr_fun_t)(mp_obj_t self_in, qstr attr, mp_obj_t value); // return true if store succeeded; if value==MP_OBJ_NULL then delete typedef mp_obj_t (*mp_subscr_fun_t)(mp_obj_t self_in, mp_obj_t index, mp_obj_t value); @@ -458,7 +458,7 @@ void mp_obj_exception_clear_traceback(mp_obj_t self_in); void mp_obj_exception_add_traceback(mp_obj_t self_in, qstr file, mp_uint_t line, qstr block); void mp_obj_exception_get_traceback(mp_obj_t self_in, mp_uint_t *n, mp_uint_t **values); mp_obj_t mp_obj_exception_get_value(mp_obj_t self_in); -mp_obj_t mp_obj_exception_make_new(mp_obj_t type_in, uint n_args, uint n_kw, const mp_obj_t *args); +mp_obj_t mp_obj_exception_make_new(mp_obj_t type_in, mp_uint_t n_args, mp_uint_t n_kw, const mp_obj_t *args); mp_obj_t mp_alloc_emergency_exception_buf(mp_obj_t size_in); void mp_init_emergency_exception_buf(void); @@ -482,11 +482,11 @@ typedef struct _mp_obj_float_t { mp_float_t value; } mp_obj_float_t; mp_float_t mp_obj_float_get(mp_obj_t self_in); -mp_obj_t mp_obj_float_binary_op(int op, mp_float_t lhs_val, mp_obj_t rhs); // can return MP_OBJ_NULL if op not supported +mp_obj_t mp_obj_float_binary_op(mp_uint_t op, mp_float_t lhs_val, mp_obj_t rhs); // can return MP_OBJ_NULL if op not supported // complex void mp_obj_complex_get(mp_obj_t self_in, mp_float_t *real, mp_float_t *imag); -mp_obj_t mp_obj_complex_binary_op(int op, mp_float_t lhs_real, mp_float_t lhs_imag, mp_obj_t rhs_in); // can return MP_OBJ_NULL if op not supported +mp_obj_t mp_obj_complex_binary_op(mp_uint_t op, mp_float_t lhs_real, mp_float_t lhs_imag, mp_obj_t rhs_in); // can return MP_OBJ_NULL if op not supported #endif // tuple @@ -501,7 +501,7 @@ mp_obj_t mp_obj_list_append(mp_obj_t self_in, mp_obj_t arg); void mp_obj_list_get(mp_obj_t self_in, uint *len, mp_obj_t **items); void mp_obj_list_set_len(mp_obj_t self_in, uint len); void mp_obj_list_store(mp_obj_t self_in, mp_obj_t index, mp_obj_t value); -mp_obj_t mp_obj_list_sort(uint n_args, const mp_obj_t *args, mp_map_t *kwargs); +mp_obj_t mp_obj_list_sort(mp_uint_t n_args, const mp_obj_t *args, mp_map_t *kwargs); // dict typedef struct _mp_obj_dict_t { @@ -535,7 +535,7 @@ typedef struct _mp_obj_fun_builtin_t { // use this to make const objects that go void *fun; // must be a pointer to a callable function in ROM } mp_obj_fun_builtin_t; -mp_obj_t mp_obj_fun_binary_op(int op, mp_obj_t lhs_in, mp_obj_t rhs_in); +mp_obj_t mp_obj_fun_binary_op(mp_uint_t op, mp_obj_t lhs_in, mp_obj_t rhs_in); const char *mp_obj_fun_get_name(mp_const_obj_t fun); const char *mp_obj_code_get_name(const byte *code_info); diff --git a/py/objarray.c b/py/objarray.c index f84cb1e61b..4930b18322 100644 --- a/py/objarray.c +++ b/py/objarray.c @@ -104,7 +104,7 @@ STATIC mp_obj_t array_construct(char typecode, mp_obj_t initializer) { return array; } -STATIC mp_obj_t array_make_new(mp_obj_t type_in, uint n_args, uint n_kw, const mp_obj_t *args) { +STATIC mp_obj_t array_make_new(mp_obj_t type_in, mp_uint_t n_args, mp_uint_t n_kw, const mp_obj_t *args) { mp_arg_check_num(n_args, n_kw, 1, 2, false); // get typecode @@ -120,7 +120,7 @@ STATIC mp_obj_t array_make_new(mp_obj_t type_in, uint n_args, uint n_kw, const m } } -STATIC mp_obj_t bytearray_make_new(mp_obj_t type_in, uint n_args, uint n_kw, const mp_obj_t *args) { +STATIC mp_obj_t bytearray_make_new(mp_obj_t type_in, mp_uint_t n_args, mp_uint_t n_kw, const mp_obj_t *args) { mp_arg_check_num(n_args, n_kw, 0, 1, false); if (n_args == 0) { @@ -138,7 +138,7 @@ STATIC mp_obj_t bytearray_make_new(mp_obj_t type_in, uint n_args, uint n_kw, con } } -STATIC mp_obj_t array_unary_op(int op, mp_obj_t o_in) { +STATIC mp_obj_t array_unary_op(mp_uint_t op, mp_obj_t o_in) { mp_obj_array_t *o = o_in; switch (op) { case MP_UNARY_OP_BOOL: return MP_BOOL(o->len != 0); @@ -147,7 +147,7 @@ STATIC mp_obj_t array_unary_op(int op, mp_obj_t o_in) { } } -STATIC mp_obj_t array_binary_op(int op, mp_obj_t lhs_in, mp_obj_t rhs_in) { +STATIC mp_obj_t array_binary_op(mp_uint_t op, mp_obj_t lhs_in, mp_obj_t rhs_in) { switch (op) { case MP_BINARY_OP_EQUAL: { mp_buffer_info_t lhs_bufinfo; diff --git a/py/objbool.c b/py/objbool.c index 72535b2972..dbe84d92e2 100644 --- a/py/objbool.c +++ b/py/objbool.c @@ -48,7 +48,7 @@ STATIC void bool_print(void (*print)(void *env, const char *fmt, ...), void *env } } -STATIC mp_obj_t bool_make_new(mp_obj_t type_in, uint n_args, uint n_kw, const mp_obj_t *args) { +STATIC mp_obj_t bool_make_new(mp_obj_t type_in, mp_uint_t n_args, mp_uint_t n_kw, const mp_obj_t *args) { mp_arg_check_num(n_args, n_kw, 0, 1, false); switch (n_args) { @@ -60,7 +60,7 @@ STATIC mp_obj_t bool_make_new(mp_obj_t type_in, uint n_args, uint n_kw, const mp } } -STATIC mp_obj_t bool_unary_op(int op, mp_obj_t o_in) { +STATIC mp_obj_t bool_unary_op(mp_uint_t op, mp_obj_t o_in) { mp_int_t value = ((mp_obj_bool_t*)o_in)->value; switch (op) { case MP_UNARY_OP_BOOL: return o_in; @@ -72,7 +72,7 @@ STATIC mp_obj_t bool_unary_op(int op, mp_obj_t o_in) { } } -STATIC mp_obj_t bool_binary_op(int op, mp_obj_t lhs_in, mp_obj_t rhs_in) { +STATIC mp_obj_t bool_binary_op(mp_uint_t op, mp_obj_t lhs_in, mp_obj_t rhs_in) { if (MP_BINARY_OP_OR <= op && op <= MP_BINARY_OP_NOT_EQUAL) { return mp_binary_op(op, MP_OBJ_NEW_SMALL_INT(mp_obj_is_true(lhs_in)), rhs_in); } diff --git a/py/objboundmeth.c b/py/objboundmeth.c index 9bbd34e9dd..6040acee74 100644 --- a/py/objboundmeth.c +++ b/py/objboundmeth.c @@ -50,7 +50,7 @@ STATIC void bound_meth_print(void (*print)(void *env, const char *fmt, ...), voi } #endif -mp_obj_t bound_meth_call(mp_obj_t self_in, uint n_args, uint n_kw, const mp_obj_t *args) { +mp_obj_t bound_meth_call(mp_obj_t self_in, mp_uint_t n_args, mp_uint_t n_kw, const mp_obj_t *args) { mp_obj_bound_meth_t *self = self_in; // need to insert self->self before all other args and then call self->meth diff --git a/py/objclosure.c b/py/objclosure.c index 900d63b4c7..b5456b1730 100644 --- a/py/objclosure.c +++ b/py/objclosure.c @@ -41,7 +41,7 @@ typedef struct _mp_obj_closure_t { mp_obj_t closed[]; } mp_obj_closure_t; -mp_obj_t closure_call(mp_obj_t self_in, uint n_args, uint n_kw, const mp_obj_t *args) { +mp_obj_t closure_call(mp_obj_t self_in, mp_uint_t n_args, mp_uint_t n_kw, const mp_obj_t *args) { mp_obj_closure_t *self = self_in; // need to concatenate closed-over-vars and args diff --git a/py/objcomplex.c b/py/objcomplex.c index 0c58dee659..7876068c07 100644 --- a/py/objcomplex.c +++ b/py/objcomplex.c @@ -74,7 +74,7 @@ STATIC void complex_print(void (*print)(void *env, const char *fmt, ...), void * #endif } -STATIC mp_obj_t complex_make_new(mp_obj_t type_in, uint n_args, uint n_kw, const mp_obj_t *args) { +STATIC mp_obj_t complex_make_new(mp_obj_t type_in, mp_uint_t n_args, mp_uint_t n_kw, const mp_obj_t *args) { mp_arg_check_num(n_args, n_kw, 0, 2, false); switch (n_args) { @@ -117,7 +117,7 @@ STATIC mp_obj_t complex_make_new(mp_obj_t type_in, uint n_args, uint n_kw, const } } -STATIC mp_obj_t complex_unary_op(int op, mp_obj_t o_in) { +STATIC mp_obj_t complex_unary_op(mp_uint_t op, mp_obj_t o_in) { mp_obj_complex_t *o = o_in; switch (op) { case MP_UNARY_OP_BOOL: return MP_BOOL(o->real != 0 || o->imag != 0); @@ -127,7 +127,7 @@ STATIC mp_obj_t complex_unary_op(int op, mp_obj_t o_in) { } } -STATIC mp_obj_t complex_binary_op(int op, mp_obj_t lhs_in, mp_obj_t rhs_in) { +STATIC mp_obj_t complex_binary_op(mp_uint_t op, mp_obj_t lhs_in, mp_obj_t rhs_in) { mp_obj_complex_t *lhs = lhs_in; return mp_obj_complex_binary_op(op, lhs->real, lhs->imag, rhs_in); } @@ -166,7 +166,7 @@ void mp_obj_complex_get(mp_obj_t self_in, mp_float_t *real, mp_float_t *imag) { *imag = self->imag; } -mp_obj_t mp_obj_complex_binary_op(int op, mp_float_t lhs_real, mp_float_t lhs_imag, mp_obj_t rhs_in) { +mp_obj_t mp_obj_complex_binary_op(mp_uint_t op, mp_float_t lhs_real, mp_float_t lhs_imag, mp_obj_t rhs_in) { mp_float_t rhs_real, rhs_imag; mp_obj_get_complex(rhs_in, &rhs_real, &rhs_imag); // can be any type, this function will convert to float (if possible) switch (op) { diff --git a/py/objdict.c b/py/objdict.c index f09065b102..a755c17f72 100644 --- a/py/objdict.c +++ b/py/objdict.c @@ -60,7 +60,7 @@ STATIC void dict_print(void (*print)(void *env, const char *fmt, ...), void *env print(env, "}"); } -STATIC mp_obj_t dict_make_new(mp_obj_t type_in, uint n_args, uint n_kw, const mp_obj_t *args) { +STATIC mp_obj_t dict_make_new(mp_obj_t type_in, mp_uint_t n_args, mp_uint_t n_kw, const mp_obj_t *args) { mp_obj_t dict = mp_obj_new_dict(0); if (n_args > 0 || n_kw > 0) { mp_obj_t args2[2] = {dict, args[0]}; // args[0] is always valid, even if it's not a positional arg @@ -71,7 +71,7 @@ STATIC mp_obj_t dict_make_new(mp_obj_t type_in, uint n_args, uint n_kw, const mp return dict; } -STATIC mp_obj_t dict_unary_op(int op, mp_obj_t self_in) { +STATIC mp_obj_t dict_unary_op(mp_uint_t op, mp_obj_t self_in) { mp_obj_dict_t *self = self_in; switch (op) { case MP_UNARY_OP_BOOL: return MP_BOOL(self->map.used != 0); @@ -80,7 +80,7 @@ STATIC mp_obj_t dict_unary_op(int op, mp_obj_t self_in) { } } -STATIC mp_obj_t dict_binary_op(int op, mp_obj_t lhs_in, mp_obj_t rhs_in) { +STATIC mp_obj_t dict_binary_op(mp_uint_t op, mp_obj_t lhs_in, mp_obj_t rhs_in) { mp_obj_dict_t *o = lhs_in; switch (op) { case MP_BINARY_OP_IN: { @@ -472,7 +472,7 @@ STATIC void dict_view_print(void (*print)(void *env, const char *fmt, ...), void print(env, "])"); } -STATIC mp_obj_t dict_view_binary_op(int op, mp_obj_t lhs_in, mp_obj_t rhs_in) { +STATIC mp_obj_t dict_view_binary_op(mp_uint_t op, mp_obj_t lhs_in, mp_obj_t rhs_in) { // only supported for the 'keys' kind until sets and dicts are refactored mp_obj_dict_view_t *o = lhs_in; if (o->kind != MP_DICT_VIEW_KEYS) { diff --git a/py/objenumerate.c b/py/objenumerate.c index 1272ba7cb4..0d96712df6 100644 --- a/py/objenumerate.c +++ b/py/objenumerate.c @@ -47,7 +47,7 @@ STATIC const mp_arg_t enumerate_make_new_args[] = { }; #define ENUMERATE_MAKE_NEW_NUM_ARGS MP_ARRAY_SIZE(enumerate_make_new_args) -STATIC mp_obj_t enumerate_make_new(mp_obj_t type_in, uint n_args, uint n_kw, const mp_obj_t *args) { +STATIC mp_obj_t enumerate_make_new(mp_obj_t type_in, mp_uint_t n_args, mp_uint_t n_kw, const mp_obj_t *args) { #if MICROPY_CPYTHON_COMPAT // parse args mp_arg_val_t vals[ENUMERATE_MAKE_NEW_NUM_ARGS]; diff --git a/py/objexcept.c b/py/objexcept.c index cb01fd6e85..c1d0149d49 100644 --- a/py/objexcept.c +++ b/py/objexcept.c @@ -130,7 +130,7 @@ STATIC void mp_obj_exception_print(void (*print)(void *env, const char *fmt, ... mp_obj_tuple_print(print, env, o->args, kind); } -mp_obj_t mp_obj_exception_make_new(mp_obj_t type_in, uint n_args, uint n_kw, const mp_obj_t *args) { +mp_obj_t mp_obj_exception_make_new(mp_obj_t type_in, mp_uint_t n_args, mp_uint_t n_kw, const mp_obj_t *args) { mp_obj_type_t *type = type_in; if (n_kw != 0) { @@ -171,7 +171,7 @@ STATIC void exception_load_attr(mp_obj_t self_in, qstr attr, mp_obj_t *dest) { } } -STATIC mp_obj_t exc___init__(uint n_args, const mp_obj_t *args) { +STATIC mp_obj_t exc___init__(mp_uint_t n_args, const mp_obj_t *args) { mp_obj_exception_t *self = args[0]; mp_obj_t argst = mp_obj_new_tuple(n_args - 1, args + 1); self->args = argst; diff --git a/py/objfilter.c b/py/objfilter.c index e36f3ab36b..38af316740 100644 --- a/py/objfilter.c +++ b/py/objfilter.c @@ -40,7 +40,7 @@ typedef struct _mp_obj_filter_t { mp_obj_t iter; } mp_obj_filter_t; -STATIC mp_obj_t filter_make_new(mp_obj_t type_in, uint n_args, uint n_kw, const mp_obj_t *args) { +STATIC mp_obj_t filter_make_new(mp_obj_t type_in, mp_uint_t n_args, mp_uint_t n_kw, const mp_obj_t *args) { if (n_args != 2 || n_kw != 0) { nlr_raise(mp_obj_new_exception_msg(&mp_type_TypeError, "filter expected 2 arguments")); } diff --git a/py/objfloat.c b/py/objfloat.c index e3fefad8db..1c55106fd9 100644 --- a/py/objfloat.c +++ b/py/objfloat.c @@ -66,7 +66,7 @@ STATIC void float_print(void (*print)(void *env, const char *fmt, ...), void *en #endif } -STATIC mp_obj_t float_make_new(mp_obj_t type_in, uint n_args, uint n_kw, const mp_obj_t *args) { +STATIC mp_obj_t float_make_new(mp_obj_t type_in, mp_uint_t n_args, mp_uint_t n_kw, const mp_obj_t *args) { mp_arg_check_num(n_args, n_kw, 0, 1, false); switch (n_args) { @@ -90,7 +90,7 @@ STATIC mp_obj_t float_make_new(mp_obj_t type_in, uint n_args, uint n_kw, const m } } -STATIC mp_obj_t float_unary_op(int op, mp_obj_t o_in) { +STATIC mp_obj_t float_unary_op(mp_uint_t op, mp_obj_t o_in) { mp_obj_float_t *o = o_in; switch (op) { case MP_UNARY_OP_BOOL: return MP_BOOL(o->value != 0); @@ -100,7 +100,7 @@ STATIC mp_obj_t float_unary_op(int op, mp_obj_t o_in) { } } -STATIC mp_obj_t float_binary_op(int op, mp_obj_t lhs_in, mp_obj_t rhs_in) { +STATIC mp_obj_t float_binary_op(mp_uint_t op, mp_obj_t lhs_in, mp_obj_t rhs_in) { mp_obj_float_t *lhs = lhs_in; #if MICROPY_PY_BUILTINS_COMPLEX if (MP_OBJ_IS_TYPE(rhs_in, &mp_type_complex)) { @@ -134,7 +134,7 @@ mp_float_t mp_obj_float_get(mp_obj_t self_in) { return self->value; } -mp_obj_t mp_obj_float_binary_op(int op, mp_float_t lhs_val, mp_obj_t rhs_in) { +mp_obj_t mp_obj_float_binary_op(mp_uint_t op, mp_float_t lhs_val, mp_obj_t rhs_in) { mp_float_t rhs_val = mp_obj_get_float(rhs_in); // can be any type, this function will convert to float (if possible) switch (op) { case MP_BINARY_OP_ADD: diff --git a/py/objfun.c b/py/objfun.c index 64c43e3e52..2a86033dad 100644 --- a/py/objfun.c +++ b/py/objfun.c @@ -49,7 +49,7 @@ // This binary_op method is used for all function types, and is also // used to determine if an object is of generic function type. -mp_obj_t mp_obj_fun_binary_op(int op, mp_obj_t lhs_in, mp_obj_t rhs_in) { +mp_obj_t mp_obj_fun_binary_op(mp_uint_t op, mp_obj_t lhs_in, mp_obj_t rhs_in) { switch (op) { case MP_BINARY_OP_EQUAL: // These objects can be equal only if it's the same underlying structure, @@ -64,7 +64,7 @@ mp_obj_t mp_obj_fun_binary_op(int op, mp_obj_t lhs_in, mp_obj_t rhs_in) { // mp_obj_fun_builtin_t defined in obj.h -STATIC mp_obj_t fun_builtin_call(mp_obj_t self_in, uint n_args, uint n_kw, const mp_obj_t *args) { +STATIC mp_obj_t fun_builtin_call(mp_obj_t self_in, mp_uint_t n_args, mp_uint_t n_kw, const mp_obj_t *args) { assert(MP_OBJ_IS_TYPE(self_in, &mp_type_fun_builtin)); mp_obj_fun_builtin_t *self = self_in; @@ -348,7 +348,7 @@ continue2:; } -STATIC mp_obj_t fun_bc_call(mp_obj_t self_in, uint n_args, uint n_kw, const mp_obj_t *args) { +STATIC mp_obj_t fun_bc_call(mp_obj_t self_in, mp_uint_t n_args, mp_uint_t n_kw, const mp_obj_t *args) { MP_STACK_CHECK(); DEBUG_printf("Input n_args: %d, n_kw: %d\n", n_args, n_kw); @@ -510,7 +510,7 @@ typedef mp_obj_t (*native_fun_1_t)(mp_obj_t); typedef mp_obj_t (*native_fun_2_t)(mp_obj_t, mp_obj_t); typedef mp_obj_t (*native_fun_3_t)(mp_obj_t, mp_obj_t, mp_obj_t); -STATIC mp_obj_t fun_native_call(mp_obj_t self_in, uint n_args, uint n_kw, const mp_obj_t *args) { +STATIC mp_obj_t fun_native_call(mp_obj_t self_in, mp_uint_t n_args, mp_uint_t n_kw, const mp_obj_t *args) { mp_obj_fun_native_t *self = self_in; mp_arg_check_num(n_args, n_kw, self->n_args, self->n_args, false); @@ -571,7 +571,7 @@ typedef mp_uint_t (*viper_fun_1_t)(mp_uint_t); typedef mp_uint_t (*viper_fun_2_t)(mp_uint_t, mp_uint_t); typedef mp_uint_t (*viper_fun_3_t)(mp_uint_t, mp_uint_t, mp_uint_t); -STATIC mp_obj_t fun_viper_call(mp_obj_t self_in, uint n_args, uint n_kw, const mp_obj_t *args) { +STATIC mp_obj_t fun_viper_call(mp_obj_t self_in, mp_uint_t n_args, mp_uint_t n_kw, const mp_obj_t *args) { mp_obj_fun_viper_t *self = self_in; mp_arg_check_num(n_args, n_kw, self->n_args, self->n_args, false); @@ -682,7 +682,7 @@ STATIC mp_obj_t convert_val_from_inline_asm(mp_uint_t val) { return MP_OBJ_NEW_SMALL_INT(val); } -STATIC mp_obj_t fun_asm_call(mp_obj_t self_in, uint n_args, uint n_kw, const mp_obj_t *args) { +STATIC mp_obj_t fun_asm_call(mp_obj_t self_in, mp_uint_t n_args, mp_uint_t n_kw, const mp_obj_t *args) { mp_obj_fun_asm_t *self = self_in; mp_arg_check_num(n_args, n_kw, self->n_args, self->n_args, false); diff --git a/py/objgenerator.c b/py/objgenerator.c index 741ffc8a84..7c364a7b2a 100644 --- a/py/objgenerator.c +++ b/py/objgenerator.c @@ -52,7 +52,7 @@ typedef struct _mp_obj_gen_instance_t { mp_code_state code_state; } mp_obj_gen_instance_t; -STATIC mp_obj_t gen_wrap_call(mp_obj_t self_in, uint n_args, uint n_kw, const mp_obj_t *args) { +STATIC mp_obj_t gen_wrap_call(mp_obj_t self_in, mp_uint_t n_args, mp_uint_t n_kw, const mp_obj_t *args) { mp_obj_gen_wrap_t *self = self_in; mp_obj_fun_bc_t *self_fun = (mp_obj_fun_bc_t*)self->fun; assert(MP_OBJ_IS_TYPE(self_fun, &mp_type_fun_bc)); @@ -197,7 +197,7 @@ STATIC mp_obj_t gen_instance_send(mp_obj_t self_in, mp_obj_t send_value) { STATIC MP_DEFINE_CONST_FUN_OBJ_2(gen_instance_send_obj, gen_instance_send); STATIC mp_obj_t gen_instance_close(mp_obj_t self_in); -STATIC mp_obj_t gen_instance_throw(uint n_args, const mp_obj_t *args) { +STATIC mp_obj_t gen_instance_throw(mp_uint_t n_args, const mp_obj_t *args) { mp_obj_t exc = (n_args == 2) ? args[1] : args[2]; exc = mp_make_raise_obj(exc); diff --git a/py/objint.c b/py/objint.c index c190c1800b..b0c904bca9 100644 --- a/py/objint.c +++ b/py/objint.c @@ -47,7 +47,7 @@ #endif // This dispatcher function is expected to be independent of the implementation of long int -STATIC mp_obj_t mp_obj_int_make_new(mp_obj_t type_in, uint n_args, uint n_kw, const mp_obj_t *args) { +STATIC mp_obj_t mp_obj_int_make_new(mp_obj_t type_in, mp_uint_t n_args, mp_uint_t n_kw, const mp_obj_t *args) { mp_arg_check_num(n_args, n_kw, 0, 2, false); switch (n_args) { @@ -225,12 +225,12 @@ bool mp_obj_int_is_positive(mp_obj_t self_in) { } // This is called for operations on SMALL_INT that are not handled by mp_unary_op -mp_obj_t mp_obj_int_unary_op(int op, mp_obj_t o_in) { +mp_obj_t mp_obj_int_unary_op(mp_uint_t op, mp_obj_t o_in) { return MP_OBJ_NULL; // op not supported } // This is called for operations on SMALL_INT that are not handled by mp_binary_op -mp_obj_t mp_obj_int_binary_op(int op, mp_obj_t lhs_in, mp_obj_t rhs_in) { +mp_obj_t mp_obj_int_binary_op(mp_uint_t op, mp_obj_t lhs_in, mp_obj_t rhs_in) { return mp_obj_int_binary_op_extra_cases(op, lhs_in, rhs_in); } @@ -282,7 +282,7 @@ mp_float_t mp_obj_int_as_float(mp_obj_t self_in) { // This dispatcher function is expected to be independent of the implementation of long int // It handles the extra cases for integer-like arithmetic -mp_obj_t mp_obj_int_binary_op_extra_cases(int op, mp_obj_t lhs_in, mp_obj_t rhs_in) { +mp_obj_t mp_obj_int_binary_op_extra_cases(mp_uint_t op, mp_obj_t lhs_in, mp_obj_t rhs_in) { if (rhs_in == mp_const_false) { // false acts as 0 return mp_binary_op(op, lhs_in, MP_OBJ_NEW_SMALL_INT(0)); @@ -299,7 +299,7 @@ mp_obj_t mp_obj_int_binary_op_extra_cases(int op, mp_obj_t lhs_in, mp_obj_t rhs_ } // this is a classmethod -STATIC mp_obj_t int_from_bytes(uint n_args, const mp_obj_t *args) { +STATIC mp_obj_t int_from_bytes(mp_uint_t n_args, const mp_obj_t *args) { // TODO: Support long ints // TODO: Support byteorder param (assumes 'little' at the moment) // TODO: Support signed param (assumes signed=False at the moment) @@ -320,7 +320,7 @@ STATIC mp_obj_t int_from_bytes(uint n_args, const mp_obj_t *args) { STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(int_from_bytes_fun_obj, 2, 3, int_from_bytes); STATIC MP_DEFINE_CONST_CLASSMETHOD_OBJ(int_from_bytes_obj, (const mp_obj_t)&int_from_bytes_fun_obj); -STATIC mp_obj_t int_to_bytes(uint n_args, const mp_obj_t *args) { +STATIC mp_obj_t int_to_bytes(mp_uint_t n_args, const mp_obj_t *args) { mp_int_t val = mp_obj_int_get_checked(args[0]); uint len = MP_OBJ_SMALL_INT_VALUE(args[1]); diff --git a/py/objint.h b/py/objint.h index b4f8c9ae50..50f36df4d0 100644 --- a/py/objint.h +++ b/py/objint.h @@ -40,6 +40,6 @@ char *mp_obj_int_formatted_impl(char **buf, int *buf_size, int *fmt_size, mp_con int base, const char *prefix, char base_char, char comma); mp_int_t mp_obj_int_hash(mp_obj_t self_in); bool mp_obj_int_is_positive(mp_obj_t self_in); -mp_obj_t mp_obj_int_unary_op(int op, mp_obj_t o_in); -mp_obj_t mp_obj_int_binary_op(int op, mp_obj_t lhs_in, mp_obj_t rhs_in); -mp_obj_t mp_obj_int_binary_op_extra_cases(int op, mp_obj_t lhs_in, mp_obj_t rhs_in); +mp_obj_t mp_obj_int_unary_op(mp_uint_t op, mp_obj_t o_in); +mp_obj_t mp_obj_int_binary_op(mp_uint_t op, mp_obj_t lhs_in, mp_obj_t rhs_in); +mp_obj_t mp_obj_int_binary_op_extra_cases(mp_uint_t op, mp_obj_t lhs_in, mp_obj_t rhs_in); diff --git a/py/objint_longlong.c b/py/objint_longlong.c index 466b45c51f..c4c16139fd 100644 --- a/py/objint_longlong.c +++ b/py/objint_longlong.c @@ -73,7 +73,7 @@ bool mp_obj_int_is_positive(mp_obj_t self_in) { return self->val >= 0; } -mp_obj_t mp_obj_int_unary_op(int op, mp_obj_t o_in) { +mp_obj_t mp_obj_int_unary_op(mp_uint_t op, mp_obj_t o_in) { mp_obj_int_t *o = o_in; switch (op) { case MP_UNARY_OP_BOOL: return MP_BOOL(o->val != 0); @@ -84,7 +84,7 @@ mp_obj_t mp_obj_int_unary_op(int op, mp_obj_t o_in) { } } -mp_obj_t mp_obj_int_binary_op(int op, mp_obj_t lhs_in, mp_obj_t rhs_in) { +mp_obj_t mp_obj_int_binary_op(mp_uint_t op, mp_obj_t lhs_in, mp_obj_t rhs_in) { long long lhs_val; long long rhs_val; diff --git a/py/objint_mpz.c b/py/objint_mpz.c index 8233773b8b..6e347c7425 100644 --- a/py/objint_mpz.c +++ b/py/objint_mpz.c @@ -112,7 +112,7 @@ bool mp_obj_int_is_positive(mp_obj_t self_in) { return !self->mpz.neg; } -mp_obj_t mp_obj_int_unary_op(int op, mp_obj_t o_in) { +mp_obj_t mp_obj_int_unary_op(mp_uint_t op, mp_obj_t o_in) { mp_obj_int_t *o = o_in; switch (op) { case MP_UNARY_OP_BOOL: return MP_BOOL(!mpz_is_zero(&o->mpz)); @@ -123,7 +123,7 @@ mp_obj_t mp_obj_int_unary_op(int op, mp_obj_t o_in) { } } -mp_obj_t mp_obj_int_binary_op(int op, mp_obj_t lhs_in, mp_obj_t rhs_in) { +mp_obj_t mp_obj_int_binary_op(mp_uint_t op, mp_obj_t lhs_in, mp_obj_t rhs_in) { const mpz_t *zlhs; const mpz_t *zrhs; mpz_t z_int; diff --git a/py/objlist.c b/py/objlist.c index e459f0deb1..fb151f80ed 100644 --- a/py/objlist.c +++ b/py/objlist.c @@ -39,7 +39,7 @@ STATIC mp_obj_t mp_obj_new_list_iterator(mp_obj_list_t *list, int cur); STATIC mp_obj_list_t *list_new(uint n); STATIC mp_obj_t list_extend(mp_obj_t self_in, mp_obj_t arg_in); -STATIC mp_obj_t list_pop(uint n_args, const mp_obj_t *args); +STATIC mp_obj_t list_pop(mp_uint_t n_args, const mp_obj_t *args); // TODO: Move to mpconfig.h #define LIST_MIN_ALLOC 4 @@ -68,7 +68,7 @@ STATIC mp_obj_t list_extend_from_iter(mp_obj_t list, mp_obj_t iterable) { return list; } -STATIC mp_obj_t list_make_new(mp_obj_t type_in, uint n_args, uint n_kw, const mp_obj_t *args) { +STATIC mp_obj_t list_make_new(mp_obj_t type_in, mp_uint_t n_args, mp_uint_t n_kw, const mp_obj_t *args) { mp_arg_check_num(n_args, n_kw, 0, 1, false); switch (n_args) { @@ -87,7 +87,7 @@ STATIC mp_obj_t list_make_new(mp_obj_t type_in, uint n_args, uint n_kw, const mp } // Don't pass MP_BINARY_OP_NOT_EQUAL here -STATIC bool list_cmp_helper(int op, mp_obj_t self_in, mp_obj_t another_in) { +STATIC bool list_cmp_helper(mp_uint_t op, mp_obj_t self_in, mp_obj_t another_in) { assert(MP_OBJ_IS_TYPE(self_in, &mp_type_list)); if (!MP_OBJ_IS_TYPE(another_in, &mp_type_list)) { return false; @@ -98,7 +98,7 @@ STATIC bool list_cmp_helper(int op, mp_obj_t self_in, mp_obj_t another_in) { return mp_seq_cmp_objs(op, self->items, self->len, another->items, another->len); } -STATIC mp_obj_t list_unary_op(int op, mp_obj_t self_in) { +STATIC mp_obj_t list_unary_op(mp_uint_t op, mp_obj_t self_in) { mp_obj_list_t *self = self_in; switch (op) { case MP_UNARY_OP_BOOL: return MP_BOOL(self->len != 0); @@ -107,7 +107,7 @@ STATIC mp_obj_t list_unary_op(int op, mp_obj_t self_in) { } } -STATIC mp_obj_t list_binary_op(int op, mp_obj_t lhs, mp_obj_t rhs) { +STATIC mp_obj_t list_binary_op(mp_uint_t op, mp_obj_t lhs, mp_obj_t rhs) { mp_obj_list_t *o = lhs; switch (op) { case MP_BINARY_OP_ADD: { @@ -264,7 +264,7 @@ STATIC mp_obj_t list_extend(mp_obj_t self_in, mp_obj_t arg_in) { return mp_const_none; // return None, as per CPython } -STATIC mp_obj_t list_pop(uint n_args, const mp_obj_t *args) { +STATIC mp_obj_t list_pop(mp_uint_t n_args, const mp_obj_t *args) { assert(1 <= n_args && n_args <= 2); assert(MP_OBJ_IS_TYPE(args[0], &mp_type_list)); mp_obj_list_t *self = args[0]; @@ -307,7 +307,7 @@ STATIC void mp_quicksort(mp_obj_t *head, mp_obj_t *tail, mp_obj_t key_fn, bool r } } -mp_obj_t mp_obj_list_sort(uint n_args, const mp_obj_t *args, mp_map_t *kwargs) { +mp_obj_t mp_obj_list_sort(mp_uint_t n_args, const mp_obj_t *args, mp_map_t *kwargs) { assert(n_args >= 1); assert(MP_OBJ_IS_TYPE(args[0], &mp_type_list)); if (n_args > 1) { @@ -347,7 +347,7 @@ STATIC mp_obj_t list_count(mp_obj_t self_in, mp_obj_t value) { return mp_seq_count_obj(self->items, self->len, value); } -STATIC mp_obj_t list_index(uint n_args, const mp_obj_t *args) { +STATIC mp_obj_t list_index(mp_uint_t n_args, const mp_obj_t *args) { assert(2 <= n_args && n_args <= 4); assert(MP_OBJ_IS_TYPE(args[0], &mp_type_list)); mp_obj_list_t *self = args[0]; @@ -358,7 +358,7 @@ STATIC mp_obj_t list_insert(mp_obj_t self_in, mp_obj_t idx, mp_obj_t obj) { assert(MP_OBJ_IS_TYPE(self_in, &mp_type_list)); mp_obj_list_t *self = self_in; // insert has its own strange index logic - int index = MP_OBJ_SMALL_INT_VALUE(idx); + mp_int_t index = MP_OBJ_SMALL_INT_VALUE(idx); if (index < 0) { index += self->len; } @@ -371,7 +371,7 @@ STATIC mp_obj_t list_insert(mp_obj_t self_in, mp_obj_t idx, mp_obj_t obj) { mp_obj_list_append(self_in, mp_const_none); - for (int i = self->len-1; i > index; i--) { + for (mp_int_t i = self->len-1; i > index; i--) { self->items[i] = self->items[i-1]; } self->items[index] = obj; @@ -392,8 +392,8 @@ STATIC mp_obj_t list_reverse(mp_obj_t self_in) { assert(MP_OBJ_IS_TYPE(self_in, &mp_type_list)); mp_obj_list_t *self = self_in; - int len = self->len; - for (int i = 0; i < len/2; i++) { + mp_int_t len = self->len; + for (mp_int_t i = 0; i < len/2; i++) { mp_obj_t *a = self->items[i]; self->items[i] = self->items[len-i-1]; self->items[len-i-1] = a; diff --git a/py/objmap.c b/py/objmap.c index 2cbc1619ba..f7d7b01c3a 100644 --- a/py/objmap.c +++ b/py/objmap.c @@ -41,7 +41,7 @@ typedef struct _mp_obj_map_t { mp_obj_t iters[]; } mp_obj_map_t; -STATIC mp_obj_t map_make_new(mp_obj_t type_in, uint n_args, uint n_kw, const mp_obj_t *args) { +STATIC mp_obj_t map_make_new(mp_obj_t type_in, mp_uint_t n_args, mp_uint_t n_kw, const mp_obj_t *args) { if (n_args < 2 || n_kw != 0) { nlr_raise(mp_obj_new_exception_msg(&mp_type_TypeError, "map must have at least 2 arguments and no keyword arguments")); } @@ -50,7 +50,7 @@ STATIC mp_obj_t map_make_new(mp_obj_t type_in, uint n_args, uint n_kw, const mp_ o->base.type = &mp_type_map; o->n_iters = n_args - 1; o->fun = args[0]; - for (int i = 0; i < n_args - 1; i++) { + for (mp_uint_t i = 0; i < n_args - 1; i++) { o->iters[i] = mp_getiter(args[i + 1]); } return o; @@ -61,7 +61,7 @@ STATIC mp_obj_t map_iternext(mp_obj_t self_in) { mp_obj_map_t *self = self_in; mp_obj_t *nextses = m_new(mp_obj_t, self->n_iters); - for (int i = 0; i < self->n_iters; i++) { + for (mp_uint_t i = 0; i < self->n_iters; i++) { mp_obj_t next = mp_iternext(self->iters[i]); if (next == MP_OBJ_STOP_ITERATION) { m_del(mp_obj_t, nextses, self->n_iters); diff --git a/py/objnamedtuple.c b/py/objnamedtuple.c index 6f228a8f09..1a8b328be5 100644 --- a/py/objnamedtuple.c +++ b/py/objnamedtuple.c @@ -134,7 +134,7 @@ STATIC bool namedtuple_store_attr(mp_obj_t self_in, qstr attr, mp_obj_t value) { nlr_raise(mp_obj_new_exception_msg(&mp_type_AttributeError, "can't set attribute")); } -STATIC mp_obj_t namedtuple_make_new(mp_obj_t type_in, uint n_args, uint n_kw, const mp_obj_t *args) { +STATIC mp_obj_t namedtuple_make_new(mp_obj_t type_in, mp_uint_t n_args, mp_uint_t n_kw, const mp_obj_t *args) { mp_obj_namedtuple_type_t *type = type_in; uint num_fields = namedtuple_count_fields(type->fields); if (n_args != num_fields) { diff --git a/py/objnone.c b/py/objnone.c index 165c8e5a43..a8d6071435 100644 --- a/py/objnone.c +++ b/py/objnone.c @@ -41,7 +41,7 @@ STATIC void none_print(void (*print)(void *env, const char *fmt, ...), void *env print(env, "None"); } -STATIC mp_obj_t none_unary_op(int op, mp_obj_t o_in) { +STATIC mp_obj_t none_unary_op(mp_uint_t op, mp_obj_t o_in) { switch (op) { case MP_UNARY_OP_BOOL: return mp_const_false; default: return MP_OBJ_NULL; // op not supported diff --git a/py/objobject.c b/py/objobject.c index 7e2a35a52f..551ccf76ea 100644 --- a/py/objobject.c +++ b/py/objobject.c @@ -33,13 +33,13 @@ #include "obj.h" #include "runtime0.h" -mp_obj_t instance_make_new(mp_obj_t self_in, uint n_args, uint n_kw, const mp_obj_t *args); +mp_obj_t instance_make_new(mp_obj_t self_in, mp_uint_t n_args, mp_uint_t n_kw, const mp_obj_t *args); typedef struct _mp_obj_object_t { mp_obj_base_t base; } mp_obj_object_t; -STATIC mp_obj_t object_make_new(mp_obj_t type_in, uint n_args, uint n_kw, const mp_obj_t *args) { +STATIC mp_obj_t object_make_new(mp_obj_t type_in, mp_uint_t n_args, mp_uint_t n_kw, const mp_obj_t *args) { if (n_args != 0 || n_kw != 0) { nlr_raise(mp_obj_new_exception_msg(&mp_type_TypeError, "object takes no arguments")); } diff --git a/py/objproperty.c b/py/objproperty.c index 5a9311ac96..c83ca2dbb0 100644 --- a/py/objproperty.c +++ b/py/objproperty.c @@ -41,7 +41,7 @@ typedef struct _mp_obj_property_t { mp_obj_t proxy[3]; // getter, setter, deleter } mp_obj_property_t; -STATIC mp_obj_t property_make_new(mp_obj_t type_in, uint n_args, uint n_kw, const mp_obj_t *args) { +STATIC mp_obj_t property_make_new(mp_obj_t type_in, mp_uint_t n_args, mp_uint_t n_kw, const mp_obj_t *args) { mp_arg_check_num(n_args, n_kw, 0, 4, false); mp_obj_property_t *o = m_new_obj(mp_obj_property_t); diff --git a/py/objrange.c b/py/objrange.c index 3bd974f740..dc3662b103 100644 --- a/py/objrange.c +++ b/py/objrange.c @@ -93,7 +93,7 @@ STATIC void range_print(void (*print)(void *env, const char *fmt, ...), void *en } } -STATIC mp_obj_t range_make_new(mp_obj_t type_in, uint n_args, uint n_kw, const mp_obj_t *args) { +STATIC mp_obj_t range_make_new(mp_obj_t type_in, mp_uint_t n_args, mp_uint_t n_kw, const mp_obj_t *args) { mp_arg_check_num(n_args, n_kw, 1, 3, false); mp_obj_range_t *o = m_new_obj(mp_obj_range_t); @@ -130,7 +130,7 @@ STATIC mp_int_t range_len(mp_obj_range_t *self) { return len; } -STATIC mp_obj_t range_unary_op(int op, mp_obj_t self_in) { +STATIC mp_obj_t range_unary_op(mp_uint_t op, mp_obj_t self_in) { mp_obj_range_t *self = self_in; mp_int_t len = range_len(self); switch (op) { diff --git a/py/objreversed.c b/py/objreversed.c index 3f758699d3..aa73f37710 100644 --- a/py/objreversed.c +++ b/py/objreversed.c @@ -40,7 +40,7 @@ typedef struct _mp_obj_reversed_t { mp_uint_t cur_index; // current index, plus 1; 0=no more, 1=last one (index 0) } mp_obj_reversed_t; -STATIC mp_obj_t reversed_make_new(mp_obj_t type_in, uint n_args, uint n_kw, const mp_obj_t *args) { +STATIC mp_obj_t reversed_make_new(mp_obj_t type_in, mp_uint_t n_args, mp_uint_t n_kw, const mp_obj_t *args) { mp_arg_check_num(n_args, n_kw, 1, 1, false); mp_obj_reversed_t *o = m_new_obj(mp_obj_reversed_t); diff --git a/py/objset.c b/py/objset.c index f17628d53e..1184bef93b 100644 --- a/py/objset.c +++ b/py/objset.c @@ -122,7 +122,7 @@ STATIC void set_print(void (*print)(void *env, const char *fmt, ...), void *env, } -STATIC mp_obj_t set_make_new(mp_obj_t type_in, uint n_args, uint n_kw, const mp_obj_t *args) { +STATIC mp_obj_t set_make_new(mp_obj_t type_in, mp_uint_t n_args, mp_uint_t n_kw, const mp_obj_t *args) { mp_arg_check_num(n_args, n_kw, 0, 1, false); switch (n_args) { @@ -234,7 +234,7 @@ STATIC mp_obj_t set_discard(mp_obj_t self_in, mp_obj_t item) { } STATIC MP_DEFINE_CONST_FUN_OBJ_2(set_discard_obj, set_discard); -STATIC mp_obj_t set_diff_int(int n_args, const mp_obj_t *args, bool update) { +STATIC mp_obj_t set_diff_int(mp_uint_t n_args, const mp_obj_t *args, bool update) { assert(n_args > 0); mp_obj_set_t *self; @@ -264,12 +264,12 @@ STATIC mp_obj_t set_diff_int(int n_args, const mp_obj_t *args, bool update) { return self; } -STATIC mp_obj_t set_diff(uint n_args, const mp_obj_t *args) { +STATIC mp_obj_t set_diff(mp_uint_t n_args, const mp_obj_t *args) { return set_diff_int(n_args, args, false); } STATIC MP_DEFINE_CONST_FUN_OBJ_VAR(set_diff_obj, 1, set_diff); -STATIC mp_obj_t set_diff_update(uint n_args, const mp_obj_t *args) { +STATIC mp_obj_t set_diff_update(mp_uint_t n_args, const mp_obj_t *args) { set_diff_int(n_args, args, true); return mp_const_none; } @@ -453,7 +453,7 @@ STATIC void set_update_int(mp_obj_set_t *self, mp_obj_t other_in) { } } -STATIC mp_obj_t set_update(uint n_args, const mp_obj_t *args) { +STATIC mp_obj_t set_update(mp_uint_t n_args, const mp_obj_t *args) { assert(n_args > 0); for (int i = 1; i < n_args; i++) { @@ -472,7 +472,7 @@ STATIC mp_obj_t set_union(mp_obj_t self_in, mp_obj_t other_in) { } STATIC MP_DEFINE_CONST_FUN_OBJ_2(set_union_obj, set_union); -STATIC mp_obj_t set_unary_op(int op, mp_obj_t self_in) { +STATIC mp_obj_t set_unary_op(mp_uint_t op, mp_obj_t self_in) { mp_obj_set_t *self = self_in; switch (op) { case MP_UNARY_OP_BOOL: return MP_BOOL(self->set.used != 0); @@ -481,7 +481,7 @@ STATIC mp_obj_t set_unary_op(int op, mp_obj_t self_in) { } } -STATIC mp_obj_t set_binary_op(int op, mp_obj_t lhs, mp_obj_t rhs) { +STATIC mp_obj_t set_binary_op(mp_uint_t op, mp_obj_t lhs, mp_obj_t rhs) { mp_obj_t args[] = {lhs, rhs}; switch (op) { case MP_BINARY_OP_OR: diff --git a/py/objstr.c b/py/objstr.c index fd4bc8289f..be527bcaa2 100644 --- a/py/objstr.c +++ b/py/objstr.c @@ -41,7 +41,7 @@ #include "objstr.h" #include "objlist.h" -STATIC mp_obj_t str_modulo_format(mp_obj_t pattern, uint n_args, const mp_obj_t *args, mp_obj_t dict); +STATIC mp_obj_t str_modulo_format(mp_obj_t pattern, mp_uint_t n_args, const mp_obj_t *args, mp_obj_t dict); const mp_obj_t mp_const_empty_bytes; mp_obj_t mp_obj_new_str_iterator(mp_obj_t str); @@ -105,7 +105,7 @@ STATIC void str_print(void (*print)(void *env, const char *fmt, ...), void *env, } } -STATIC mp_obj_t str_make_new(mp_obj_t type_in, uint n_args, uint n_kw, const mp_obj_t *args) { +STATIC mp_obj_t str_make_new(mp_obj_t type_in, mp_uint_t n_args, mp_uint_t n_kw, const mp_obj_t *args) { #if MICROPY_CPYTHON_COMPAT if (n_kw != 0) { mp_arg_error_unimpl_kw(); @@ -145,7 +145,7 @@ STATIC mp_obj_t str_make_new(mp_obj_t type_in, uint n_args, uint n_kw, const mp_ } } -STATIC mp_obj_t bytes_make_new(mp_obj_t type_in, uint n_args, uint n_kw, const mp_obj_t *args) { +STATIC mp_obj_t bytes_make_new(mp_obj_t type_in, mp_uint_t n_args, mp_uint_t n_kw, const mp_obj_t *args) { if (n_args == 0) { return mp_const_empty_bytes; } @@ -250,7 +250,7 @@ STATIC const byte *find_subbytes(const byte *haystack, mp_uint_t hlen, const byt // Note: this function is used to check if an object is a str or bytes, which // works because both those types use it as their binary_op method. Revisit // MP_OBJ_IS_STR_OR_BYTES if this fact changes. -mp_obj_t mp_obj_str_binary_op(int op, mp_obj_t lhs_in, mp_obj_t rhs_in) { +mp_obj_t mp_obj_str_binary_op(mp_uint_t op, mp_obj_t lhs_in, mp_obj_t rhs_in) { GET_STR_DATA_LEN(lhs_in, lhs_data, lhs_len); mp_obj_type_t *lhs_type = mp_obj_get_type(lhs_in); mp_obj_type_t *rhs_type = mp_obj_get_type(rhs_in); @@ -440,7 +440,7 @@ STATIC mp_obj_t str_join(mp_obj_t self_in, mp_obj_t arg) { #define is_ws(c) ((c) == ' ' || (c) == '\t') -STATIC mp_obj_t str_split(uint n_args, const mp_obj_t *args) { +STATIC mp_obj_t str_split(mp_uint_t n_args, const mp_obj_t *args) { const mp_obj_type_t *self_type = mp_obj_get_type(args[0]); mp_int_t splits = -1; mp_obj_t sep = mp_const_none; @@ -515,7 +515,7 @@ STATIC mp_obj_t str_split(uint n_args, const mp_obj_t *args) { return res; } -STATIC mp_obj_t str_rsplit(uint n_args, const mp_obj_t *args) { +STATIC mp_obj_t str_rsplit(mp_uint_t n_args, const mp_obj_t *args) { if (n_args < 3) { // If we don't have split limit, it doesn't matter from which side // we split. @@ -576,7 +576,7 @@ STATIC mp_obj_t str_rsplit(uint n_args, const mp_obj_t *args) { return res; } -STATIC mp_obj_t str_finder(uint n_args, const mp_obj_t *args, mp_int_t direction, bool is_index) { +STATIC mp_obj_t str_finder(mp_uint_t n_args, const mp_obj_t *args, mp_int_t direction, bool is_index) { const mp_obj_type_t *self_type = mp_obj_get_type(args[0]); assert(2 <= n_args && n_args <= 4); assert(MP_OBJ_IS_STR(args[0])); @@ -613,24 +613,24 @@ STATIC mp_obj_t str_finder(uint n_args, const mp_obj_t *args, mp_int_t direction } } -STATIC mp_obj_t str_find(uint n_args, const mp_obj_t *args) { +STATIC mp_obj_t str_find(mp_uint_t n_args, const mp_obj_t *args) { return str_finder(n_args, args, 1, false); } -STATIC mp_obj_t str_rfind(uint n_args, const mp_obj_t *args) { +STATIC mp_obj_t str_rfind(mp_uint_t n_args, const mp_obj_t *args) { return str_finder(n_args, args, -1, false); } -STATIC mp_obj_t str_index(uint n_args, const mp_obj_t *args) { +STATIC mp_obj_t str_index(mp_uint_t n_args, const mp_obj_t *args) { return str_finder(n_args, args, 1, true); } -STATIC mp_obj_t str_rindex(uint n_args, const mp_obj_t *args) { +STATIC mp_obj_t str_rindex(mp_uint_t n_args, const mp_obj_t *args) { return str_finder(n_args, args, -1, true); } // TODO: (Much) more variety in args -STATIC mp_obj_t str_startswith(uint n_args, const mp_obj_t *args) { +STATIC mp_obj_t str_startswith(mp_uint_t n_args, const mp_obj_t *args) { const mp_obj_type_t *self_type = mp_obj_get_type(args[0]); GET_STR_DATA_LEN(args[0], str, str_len); GET_STR_DATA_LEN(args[1], prefix, prefix_len); @@ -644,7 +644,7 @@ STATIC mp_obj_t str_startswith(uint n_args, const mp_obj_t *args) { return MP_BOOL(memcmp(start, prefix, prefix_len) == 0); } -STATIC mp_obj_t str_endswith(uint n_args, const mp_obj_t *args) { +STATIC mp_obj_t str_endswith(mp_uint_t n_args, const mp_obj_t *args) { GET_STR_DATA_LEN(args[0], str, str_len); GET_STR_DATA_LEN(args[1], suffix, suffix_len); assert(n_args == 2); @@ -657,7 +657,7 @@ STATIC mp_obj_t str_endswith(uint n_args, const mp_obj_t *args) { enum { LSTRIP, RSTRIP, STRIP }; -STATIC mp_obj_t str_uni_strip(int type, uint n_args, const mp_obj_t *args) { +STATIC mp_obj_t str_uni_strip(int type, mp_uint_t n_args, const mp_obj_t *args) { assert(1 <= n_args && n_args <= 2); assert(MP_OBJ_IS_STR_OR_BYTES(args[0])); const mp_obj_type_t *self_type = mp_obj_get_type(args[0]); @@ -725,15 +725,15 @@ STATIC mp_obj_t str_uni_strip(int type, uint n_args, const mp_obj_t *args) { return mp_obj_new_str_of_type(self_type, orig_str + first_good_char_pos, stripped_len); } -STATIC mp_obj_t str_strip(uint n_args, const mp_obj_t *args) { +STATIC mp_obj_t str_strip(mp_uint_t n_args, const mp_obj_t *args) { return str_uni_strip(STRIP, n_args, args); } -STATIC mp_obj_t str_lstrip(uint n_args, const mp_obj_t *args) { +STATIC mp_obj_t str_lstrip(mp_uint_t n_args, const mp_obj_t *args) { return str_uni_strip(LSTRIP, n_args, args); } -STATIC mp_obj_t str_rstrip(uint n_args, const mp_obj_t *args) { +STATIC mp_obj_t str_rstrip(mp_uint_t n_args, const mp_obj_t *args) { return str_uni_strip(RSTRIP, n_args, args); } @@ -785,7 +785,7 @@ static mp_obj_t arg_as_int(mp_obj_t arg) { return arg; } -mp_obj_t mp_obj_str_format(uint n_args, const mp_obj_t *args) { +mp_obj_t mp_obj_str_format(mp_uint_t n_args, const mp_obj_t *args) { assert(MP_OBJ_IS_STR(args[0])); GET_STR_DATA_LEN(args[0], str, len); @@ -1148,7 +1148,7 @@ mp_obj_t mp_obj_str_format(uint n_args, const mp_obj_t *args) { return s; } -STATIC mp_obj_t str_modulo_format(mp_obj_t pattern, uint n_args, const mp_obj_t *args, mp_obj_t dict) { +STATIC mp_obj_t str_modulo_format(mp_obj_t pattern, mp_uint_t n_args, const mp_obj_t *args, mp_obj_t dict) { assert(MP_OBJ_IS_STR(pattern)); GET_STR_DATA_LEN(pattern, str, len); @@ -1336,7 +1336,7 @@ not_enough_args: return s; } -STATIC mp_obj_t str_replace(uint n_args, const mp_obj_t *args) { +STATIC mp_obj_t str_replace(mp_uint_t n_args, const mp_obj_t *args) { assert(MP_OBJ_IS_STR(args[0])); mp_int_t max_rep = -1; @@ -1438,7 +1438,7 @@ STATIC mp_obj_t str_replace(uint n_args, const mp_obj_t *args) { return mp_obj_str_builder_end(replaced_str); } -STATIC mp_obj_t str_count(uint n_args, const mp_obj_t *args) { +STATIC mp_obj_t str_count(mp_uint_t n_args, const mp_obj_t *args) { const mp_obj_type_t *self_type = mp_obj_get_type(args[0]); assert(2 <= n_args && n_args <= 4); assert(MP_OBJ_IS_STR(args[0])); @@ -1595,7 +1595,7 @@ STATIC mp_obj_t str_islower(mp_obj_t self_in) { // These methods are superfluous in the presense of str() and bytes() // constructors. // TODO: should accept kwargs too -STATIC mp_obj_t bytes_decode(uint n_args, const mp_obj_t *args) { +STATIC mp_obj_t bytes_decode(mp_uint_t n_args, const mp_obj_t *args) { mp_obj_t new_args[2]; if (n_args == 1) { new_args[0] = args[0]; @@ -1607,7 +1607,7 @@ STATIC mp_obj_t bytes_decode(uint n_args, const mp_obj_t *args) { } // TODO: should accept kwargs too -STATIC mp_obj_t str_encode(uint n_args, const mp_obj_t *args) { +STATIC mp_obj_t str_encode(mp_uint_t n_args, const mp_obj_t *args) { mp_obj_t new_args[2]; if (n_args == 1) { new_args[0] = args[0]; diff --git a/py/objstr.h b/py/objstr.h index 76e41d385d..7cbfee5b85 100644 --- a/py/objstr.h +++ b/py/objstr.h @@ -50,10 +50,10 @@ typedef struct _mp_obj_str_t { { str_data = qstr_data(MP_OBJ_QSTR_VALUE(str_obj_in), &str_len); } \ else { str_len = ((mp_obj_str_t*)str_obj_in)->len; str_data = ((mp_obj_str_t*)str_obj_in)->data; } -mp_obj_t mp_obj_str_format(uint n_args, const mp_obj_t *args); +mp_obj_t mp_obj_str_format(mp_uint_t n_args, const mp_obj_t *args); mp_obj_t mp_obj_new_str_of_type(const mp_obj_type_t *type, const byte* data, uint len); -mp_obj_t mp_obj_str_binary_op(int op, mp_obj_t lhs_in, mp_obj_t rhs_in); +mp_obj_t mp_obj_str_binary_op(mp_uint_t op, mp_obj_t lhs_in, mp_obj_t rhs_in); mp_int_t mp_obj_str_get_buffer(mp_obj_t self_in, mp_buffer_info_t *bufinfo, int flags); const byte *str_index_to_ptr(const mp_obj_type_t *type, const byte *self_data, uint self_len, diff --git a/py/objstringio.c b/py/objstringio.c index 70f0c68dd4..d3673d1f96 100644 --- a/py/objstringio.c +++ b/py/objstringio.c @@ -95,7 +95,7 @@ STATIC mp_obj_t stringio_close(mp_obj_t self_in) { } STATIC MP_DEFINE_CONST_FUN_OBJ_1(stringio_close_obj, stringio_close); -mp_obj_t stringio___exit__(uint n_args, const mp_obj_t *args) { +mp_obj_t stringio___exit__(mp_uint_t n_args, const mp_obj_t *args) { return stringio_close(args[0]); } STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(stringio___exit___obj, 4, 4, stringio___exit__); @@ -108,7 +108,7 @@ STATIC mp_obj_stringio_t *stringio_new(mp_obj_t type_in) { return o; } -STATIC mp_obj_t stringio_make_new(mp_obj_t type_in, uint n_args, uint n_kw, const mp_obj_t *args) { +STATIC mp_obj_t stringio_make_new(mp_obj_t type_in, mp_uint_t n_args, mp_uint_t n_kw, const mp_obj_t *args) { mp_obj_stringio_t *o = stringio_new(type_in); if (n_args > 0) { diff --git a/py/objstrunicode.c b/py/objstrunicode.c index 848005c545..853e3dc392 100644 --- a/py/objstrunicode.c +++ b/py/objstrunicode.c @@ -100,7 +100,7 @@ STATIC void uni_print(void (*print)(void *env, const char *fmt, ...), void *env, } } -STATIC mp_obj_t uni_unary_op(int op, mp_obj_t self_in) { +STATIC mp_obj_t uni_unary_op(mp_uint_t op, mp_obj_t self_in) { GET_STR_DATA_LEN(self_in, str_data, str_len); switch (op) { case MP_UNARY_OP_BOOL: @@ -112,7 +112,7 @@ STATIC mp_obj_t uni_unary_op(int op, mp_obj_t self_in) { } } -STATIC mp_obj_t str_make_new(mp_obj_t type_in, uint n_args, uint n_kw, const mp_obj_t *args) { +STATIC mp_obj_t str_make_new(mp_obj_t type_in, mp_uint_t n_args, mp_uint_t n_kw, const mp_obj_t *args) { #if MICROPY_CPYTHON_COMPAT if (n_kw != 0) { mp_arg_error_unimpl_kw(); diff --git a/py/objtuple.c b/py/objtuple.c index 377fbf5431..39fda748de 100644 --- a/py/objtuple.c +++ b/py/objtuple.c @@ -56,7 +56,7 @@ void mp_obj_tuple_print(void (*print)(void *env, const char *fmt, ...), void *en print(env, ")"); } -STATIC mp_obj_t mp_obj_tuple_make_new(mp_obj_t type_in, uint n_args, uint n_kw, const mp_obj_t *args) { +STATIC mp_obj_t mp_obj_tuple_make_new(mp_obj_t type_in, mp_uint_t n_args, mp_uint_t n_kw, const mp_obj_t *args) { mp_arg_check_num(n_args, n_kw, 0, 1, false); switch (n_args) { @@ -96,7 +96,7 @@ STATIC mp_obj_t mp_obj_tuple_make_new(mp_obj_t type_in, uint n_args, uint n_kw, } // Don't pass MP_BINARY_OP_NOT_EQUAL here -STATIC bool tuple_cmp_helper(int op, mp_obj_t self_in, mp_obj_t another_in) { +STATIC bool tuple_cmp_helper(mp_uint_t op, mp_obj_t self_in, mp_obj_t another_in) { mp_obj_type_t *self_type = mp_obj_get_type(self_in); if (self_type->getiter != mp_obj_tuple_getiter) { assert(0); @@ -115,7 +115,7 @@ STATIC bool tuple_cmp_helper(int op, mp_obj_t self_in, mp_obj_t another_in) { return mp_seq_cmp_objs(op, self->items, self->len, another->items, another->len); } -mp_obj_t mp_obj_tuple_unary_op(int op, mp_obj_t self_in) { +mp_obj_t mp_obj_tuple_unary_op(mp_uint_t op, mp_obj_t self_in) { mp_obj_tuple_t *self = self_in; switch (op) { case MP_UNARY_OP_BOOL: return MP_BOOL(self->len != 0); @@ -124,7 +124,7 @@ mp_obj_t mp_obj_tuple_unary_op(int op, mp_obj_t self_in) { } } -mp_obj_t mp_obj_tuple_binary_op(int op, mp_obj_t lhs, mp_obj_t rhs) { +mp_obj_t mp_obj_tuple_binary_op(mp_uint_t op, mp_obj_t lhs, mp_obj_t rhs) { mp_obj_tuple_t *o = lhs; switch (op) { case MP_BINARY_OP_ADD: { @@ -194,7 +194,7 @@ STATIC mp_obj_t tuple_count(mp_obj_t self_in, mp_obj_t value) { } STATIC MP_DEFINE_CONST_FUN_OBJ_2(tuple_count_obj, tuple_count); -STATIC mp_obj_t tuple_index(uint n_args, const mp_obj_t *args) { +STATIC mp_obj_t tuple_index(mp_uint_t n_args, const mp_obj_t *args) { assert(MP_OBJ_IS_TYPE(args[0], &mp_type_tuple)); mp_obj_tuple_t *self = args[0]; return mp_seq_index_obj(self->items, self->len, n_args, args); diff --git a/py/objtuple.h b/py/objtuple.h index b1e02e422d..43b3826bf5 100644 --- a/py/objtuple.h +++ b/py/objtuple.h @@ -31,7 +31,7 @@ typedef struct _mp_obj_tuple_t { } mp_obj_tuple_t; void mp_obj_tuple_print(void (*print)(void *env, const char *fmt, ...), void *env, mp_obj_t o_in, mp_print_kind_t kind); -mp_obj_t mp_obj_tuple_unary_op(int op, mp_obj_t self_in); -mp_obj_t mp_obj_tuple_binary_op(int op, mp_obj_t lhs, mp_obj_t rhs); +mp_obj_t mp_obj_tuple_unary_op(mp_uint_t op, mp_obj_t self_in); +mp_obj_t mp_obj_tuple_binary_op(mp_uint_t op, mp_obj_t lhs, mp_obj_t rhs); mp_obj_t mp_obj_tuple_subscr(mp_obj_t base, mp_obj_t index, mp_obj_t value); mp_obj_t mp_obj_tuple_getiter(mp_obj_t o_in); diff --git a/py/objtype.c b/py/objtype.c index ed323ed1d2..34e6c0a15f 100644 --- a/py/objtype.c +++ b/py/objtype.c @@ -46,14 +46,14 @@ #define DEBUG_printf(...) (void)0 #endif -STATIC mp_obj_t static_class_method_make_new(mp_obj_t self_in, uint n_args, uint n_kw, const mp_obj_t *args); +STATIC mp_obj_t static_class_method_make_new(mp_obj_t self_in, mp_uint_t n_args, mp_uint_t n_kw, const mp_obj_t *args); /******************************************************************************/ // instance object #define is_instance_type(type) ((type)->make_new == instance_make_new) #define is_native_type(type) ((type)->make_new != instance_make_new) -mp_obj_t instance_make_new(mp_obj_t self_in, uint n_args, uint n_kw, const mp_obj_t *args); +mp_obj_t instance_make_new(mp_obj_t self_in, mp_uint_t n_args, mp_uint_t n_kw, const mp_obj_t *args); STATIC void instance_convert_return_attr(mp_obj_t self, const mp_obj_type_t *type, mp_obj_t member, mp_obj_t *dest); STATIC mp_obj_t mp_obj_new_instance(mp_obj_t class, uint subobjs) { @@ -236,7 +236,7 @@ STATIC void instance_print(void (*print)(void *env, const char *fmt, ...), void print(env, "<%s object at %p>", mp_obj_get_type_str(self_in), self_in); } -mp_obj_t instance_make_new(mp_obj_t self_in, uint n_args, uint n_kw, const mp_obj_t *args) { +mp_obj_t instance_make_new(mp_obj_t self_in, mp_uint_t n_args, mp_uint_t n_kw, const mp_obj_t *args) { assert(MP_OBJ_IS_TYPE(self_in, &mp_type_type)); mp_obj_type_t *self = self_in; @@ -327,7 +327,7 @@ STATIC const qstr unary_op_method_name[] = { [MP_UNARY_OP_NOT] = MP_QSTR_, // don't need to implement this, used to make sure array has full size }; -STATIC mp_obj_t instance_unary_op(int op, mp_obj_t self_in) { +STATIC mp_obj_t instance_unary_op(mp_uint_t op, mp_obj_t self_in) { mp_obj_instance_t *self = self_in; qstr op_name = unary_op_method_name[op]; /* Still try to lookup native slot @@ -421,7 +421,7 @@ STATIC void instance_convert_return_attr(mp_obj_t self, const mp_obj_type_t *typ } } -STATIC mp_obj_t instance_binary_op(int op, mp_obj_t lhs_in, mp_obj_t rhs_in) { +STATIC mp_obj_t instance_binary_op(mp_uint_t op, mp_obj_t lhs_in, mp_obj_t rhs_in) { // Note: For ducktyping, CPython does not look in the instance members or use // __getattr__ or __getattribute__. It only looks in the class dictionary. mp_obj_instance_t *lhs = lhs_in; @@ -583,7 +583,7 @@ STATIC mp_obj_t instance_subscr(mp_obj_t self_in, mp_obj_t index, mp_obj_t value } } -STATIC mp_obj_t instance_call(mp_obj_t self_in, uint n_args, uint n_kw, const mp_obj_t *args) { +STATIC mp_obj_t instance_call(mp_obj_t self_in, mp_uint_t n_args, mp_uint_t n_kw, const mp_obj_t *args) { mp_obj_instance_t *self = self_in; mp_obj_t member[2] = {MP_OBJ_NULL}; struct class_lookup_data lookup = { @@ -643,7 +643,7 @@ STATIC void type_print(void (*print)(void *env, const char *fmt, ...), void *env print(env, "<class '%s'>", qstr_str(self->name)); } -STATIC mp_obj_t type_make_new(mp_obj_t type_in, uint n_args, uint n_kw, const mp_obj_t *args) { +STATIC mp_obj_t type_make_new(mp_obj_t type_in, mp_uint_t n_args, mp_uint_t n_kw, const mp_obj_t *args) { mp_arg_check_num(n_args, n_kw, 1, 3, false); switch (n_args) { @@ -661,7 +661,7 @@ STATIC mp_obj_t type_make_new(mp_obj_t type_in, uint n_args, uint n_kw, const mp } } -STATIC mp_obj_t type_call(mp_obj_t self_in, uint n_args, uint n_kw, const mp_obj_t *args) { +STATIC mp_obj_t type_call(mp_obj_t self_in, mp_uint_t n_args, mp_uint_t n_kw, const mp_obj_t *args) { // instantiate an instance of a class mp_obj_type_t *self = self_in; @@ -725,7 +725,7 @@ STATIC bool type_store_attr(mp_obj_t self_in, qstr attr, mp_obj_t value) { return false; } -STATIC mp_obj_t type_binary_op(int op, mp_obj_t lhs_in, mp_obj_t rhs_in) { +STATIC mp_obj_t type_binary_op(mp_uint_t op, mp_obj_t lhs_in, mp_obj_t rhs_in) { switch (op) { case MP_BINARY_OP_EQUAL: // Types can be equal only if it's the same type structure, @@ -819,7 +819,7 @@ STATIC void super_print(void (*print)(void *env, const char *fmt, ...), void *en print(env, ">"); } -STATIC mp_obj_t super_make_new(mp_obj_t type_in, uint n_args, uint n_kw, const mp_obj_t *args) { +STATIC mp_obj_t super_make_new(mp_obj_t type_in, mp_uint_t n_args, mp_uint_t n_kw, const mp_obj_t *args) { if (n_args != 2 || n_kw != 0) { // 0 arguments are turned into 2 in the compiler // 1 argument is not yet implemented @@ -968,7 +968,7 @@ mp_obj_t mp_instance_cast_to_native_base(mp_const_obj_t self_in, mp_const_obj_t /******************************************************************************/ // staticmethod and classmethod types (probably should go in a different file) -STATIC mp_obj_t static_class_method_make_new(mp_obj_t self_in, uint n_args, uint n_kw, const mp_obj_t *args) { +STATIC mp_obj_t static_class_method_make_new(mp_obj_t self_in, mp_uint_t n_args, mp_uint_t n_kw, const mp_obj_t *args) { assert(self_in == &mp_type_staticmethod || self_in == &mp_type_classmethod); if (n_args != 1 || n_kw != 0) { diff --git a/py/objzip.c b/py/objzip.c index 97a14eb870..828d6bd03e 100644 --- a/py/objzip.c +++ b/py/objzip.c @@ -39,7 +39,7 @@ typedef struct _mp_obj_zip_t { mp_obj_t iters[]; } mp_obj_zip_t; -STATIC mp_obj_t zip_make_new(mp_obj_t type_in, uint n_args, uint n_kw, const mp_obj_t *args) { +STATIC mp_obj_t zip_make_new(mp_obj_t type_in, mp_uint_t n_args, mp_uint_t n_kw, const mp_obj_t *args) { mp_arg_check_num(n_args, n_kw, 0, MP_OBJ_FUN_ARGS_MAX, false); mp_obj_zip_t *o = m_new_obj_var(mp_obj_zip_t, mp_obj_t, n_args); |