diff --git a/extmod/moductypes.c b/extmod/moductypes.c index 48cbfad52d217762f8b2b1596384b11745de5393..cd7e9d1782c9196c1fa1f6777d238d1e4c4fd720 100644 --- a/extmod/moductypes.c +++ b/extmod/moductypes.c @@ -121,7 +121,7 @@ STATIC NORETURN void syntax_error(void) { nlr_raise(mp_obj_new_exception_msg(&mp_type_TypeError, "syntax error in uctypes descriptor")); } -STATIC mp_obj_t uctypes_struct_make_new(mp_obj_t type_in, mp_uint_t n_args, mp_uint_t n_kw, const mp_obj_t *args) { +STATIC mp_obj_t uctypes_struct_make_new(mp_obj_t type_in, size_t n_args, size_t n_kw, const mp_obj_t *args) { mp_arg_check_num(n_args, n_kw, 2, 3, false); mp_obj_uctypes_struct_t *o = m_new_obj(mp_obj_uctypes_struct_t); o->base.type = MP_OBJ_TO_PTR(type_in); diff --git a/extmod/moduhashlib.c b/extmod/moduhashlib.c index a824bd0eb305ebeac5833ed7fe65a291853b0df4..6ddfa6141b9004feb2bdce5674ece9148510454d 100644 --- a/extmod/moduhashlib.c +++ b/extmod/moduhashlib.c @@ -41,7 +41,7 @@ typedef struct _mp_obj_hash_t { STATIC mp_obj_t hash_update(mp_obj_t self_in, mp_obj_t arg); -STATIC mp_obj_t hash_make_new(mp_obj_t type_in, mp_uint_t n_args, mp_uint_t n_kw, const mp_obj_t *args) { +STATIC mp_obj_t hash_make_new(mp_obj_t type_in, size_t n_args, size_t n_kw, const mp_obj_t *args) { mp_arg_check_num(n_args, n_kw, 0, 1, false); mp_obj_hash_t *o = m_new_obj_var(mp_obj_hash_t, char, sizeof(CRYAL_SHA256_CTX)); o->base.type = MP_OBJ_TO_PTR(type_in); diff --git a/py/obj.h b/py/obj.h index 58221bf06ddc8c6aecdb0c6ca5e5b519f57f38fa..88767bf1ae13fa5bfa74f6952bf6b8f42930879e 100644 --- a/py/obj.h +++ b/py/obj.h @@ -408,8 +408,8 @@ typedef enum { } mp_print_kind_t; typedef void (*mp_print_fun_t)(const mp_print_t *print, mp_obj_t o, mp_print_kind_t kind); -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_make_new_fun_t)(mp_obj_t type_in, size_t n_args, size_t n_kw, const mp_obj_t *args); +typedef mp_obj_t (*mp_call_fun_t)(mp_obj_t fun, size_t n_args, size_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_attr_fun_t)(mp_obj_t self_in, qstr attr, mp_obj_t *dest); @@ -691,7 +691,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, size_t line, qstr block); void mp_obj_exception_get_traceback(mp_obj_t self_in, size_t *n, size_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, mp_uint_t n_args, mp_uint_t n_kw, const mp_obj_t *args); +mp_obj_t mp_obj_exception_make_new(mp_obj_t type_in, size_t n_args, size_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); diff --git a/py/objarray.c b/py/objarray.c index 3445bff82e597e23d0be2f540fade75c14033d74..2c4813f54f2990306353decdd0434126828b1704 100644 --- a/py/objarray.c +++ b/py/objarray.c @@ -168,7 +168,7 @@ STATIC mp_obj_t array_construct(char typecode, mp_obj_t initializer) { #endif #if MICROPY_PY_ARRAY -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) { +STATIC mp_obj_t array_make_new(mp_obj_t type_in, size_t n_args, size_t n_kw, const mp_obj_t *args) { (void)type_in; mp_arg_check_num(n_args, n_kw, 1, 2, false); @@ -187,7 +187,7 @@ STATIC mp_obj_t array_make_new(mp_obj_t type_in, mp_uint_t n_args, mp_uint_t n_k #endif #if MICROPY_PY_BUILTINS_BYTEARRAY -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) { +STATIC mp_obj_t bytearray_make_new(mp_obj_t type_in, size_t n_args, size_t n_kw, const mp_obj_t *args) { (void)type_in; mp_arg_check_num(n_args, n_kw, 0, 1, false); @@ -219,7 +219,7 @@ mp_obj_t mp_obj_new_memoryview(byte typecode, mp_uint_t nitems, void *items) { return MP_OBJ_FROM_PTR(self); } -STATIC mp_obj_t memoryview_make_new(mp_obj_t type_in, mp_uint_t n_args, mp_uint_t n_kw, const mp_obj_t *args) { +STATIC mp_obj_t memoryview_make_new(mp_obj_t type_in, size_t n_args, size_t n_kw, const mp_obj_t *args) { (void)type_in; // TODO possibly allow memoryview constructor to take start/stop so that one diff --git a/py/objbool.c b/py/objbool.c index 4276335635f42ad60c5905d1cb7fb068f3e2a72f..09878a7505ae29f4293a3515ab007ef879c9190f 100644 --- a/py/objbool.c +++ b/py/objbool.c @@ -52,7 +52,7 @@ STATIC void bool_print(const mp_print_t *print, mp_obj_t self_in, mp_print_kind_ } } -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) { +STATIC mp_obj_t bool_make_new(mp_obj_t type_in, size_t n_args, size_t n_kw, const mp_obj_t *args) { (void)type_in; mp_arg_check_num(n_args, n_kw, 0, 1, false); diff --git a/py/objboundmeth.c b/py/objboundmeth.c index c19192397999e545d607f20e039742b7a6087544..c0e75eae979f63f63580eda547989923d77e99b7 100644 --- a/py/objboundmeth.c +++ b/py/objboundmeth.c @@ -47,7 +47,7 @@ STATIC void bound_meth_print(const mp_print_t *print, mp_obj_t o_in, mp_print_ki } #endif -STATIC 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) { +STATIC mp_obj_t bound_meth_call(mp_obj_t self_in, size_t n_args, size_t n_kw, const mp_obj_t *args) { mp_obj_bound_meth_t *self = MP_OBJ_TO_PTR(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 e331a659bb35bcdd75d0c25d65403529d3b0a305..d556b3b8ae9251e797c93da93b3d9894e9f19c7e 100644 --- a/py/objclosure.c +++ b/py/objclosure.c @@ -36,7 +36,7 @@ typedef struct _mp_obj_closure_t { mp_obj_t closed[]; } mp_obj_closure_t; -STATIC 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) { +STATIC mp_obj_t closure_call(mp_obj_t self_in, size_t n_args, size_t n_kw, const mp_obj_t *args) { mp_obj_closure_t *self = MP_OBJ_TO_PTR(self_in); // need to concatenate closed-over-vars and args diff --git a/py/objcomplex.c b/py/objcomplex.c index e9a15d254767d98043d917d961ddf7c9cfb936d9..df0467e3242a8ae8b43bea3e4f64f6827a97bb5a 100644 --- a/py/objcomplex.c +++ b/py/objcomplex.c @@ -69,7 +69,7 @@ STATIC void complex_print(const mp_print_t *print, mp_obj_t o_in, mp_print_kind_ } } -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) { +STATIC mp_obj_t complex_make_new(mp_obj_t type_in, size_t n_args, size_t n_kw, const mp_obj_t *args) { (void)type_in; mp_arg_check_num(n_args, n_kw, 0, 2, false); diff --git a/py/objdict.c b/py/objdict.c index f3217507a9c8747e3db24c6b5e60e5c457015b34..4010d9ce3f4a713cf42bfe586d3f4fcc3065e7dd 100644 --- a/py/objdict.c +++ b/py/objdict.c @@ -82,7 +82,7 @@ STATIC void dict_print(const mp_print_t *print, mp_obj_t self_in, mp_print_kind_ } } -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) { +STATIC mp_obj_t dict_make_new(mp_obj_t type_in, size_t n_args, size_t n_kw, const mp_obj_t *args) { mp_obj_t dict_out = mp_obj_new_dict(0); mp_obj_dict_t *dict = MP_OBJ_TO_PTR(dict_out); dict->base.type = MP_OBJ_TO_PTR(type_in); diff --git a/py/objenumerate.c b/py/objenumerate.c index 3629c1a20bb5227e9dba7ade69a7e98f5c74dbdf..46c3e801dfe673151fe4ca39962be97e432af7bf 100644 --- a/py/objenumerate.c +++ b/py/objenumerate.c @@ -45,7 +45,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, mp_uint_t n_args, mp_uint_t n_kw, const mp_obj_t *args) { +STATIC mp_obj_t enumerate_make_new(mp_obj_t type_in, size_t n_args, size_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 ffe5ea04167dc9720c468398ddd65d9e8c7e4db4..6e28a980bde9968f1babb4811adfc5438e28f5e1 100644 --- a/py/objexcept.c +++ b/py/objexcept.c @@ -114,7 +114,7 @@ STATIC void mp_obj_exception_print(const mp_print_t *print, mp_obj_t o_in, mp_pr mp_obj_tuple_print(print, MP_OBJ_FROM_PTR(o->args), kind); } -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_obj_exception_make_new(mp_obj_t type_in, size_t n_args, size_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_exception_t *o = m_new_obj_var_maybe(mp_obj_exception_t, mp_obj_t, 0); if (o == NULL) { diff --git a/py/objfilter.c b/py/objfilter.c index cc3083c96ca33a87c5376d675714b5d8bccf46f4..168f0e76125709fd81190905d008e6debfc8906a 100644 --- a/py/objfilter.c +++ b/py/objfilter.c @@ -34,7 +34,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, mp_uint_t n_args, mp_uint_t n_kw, const mp_obj_t *args) { +STATIC mp_obj_t filter_make_new(mp_obj_t type_in, size_t n_args, size_t n_kw, const mp_obj_t *args) { mp_arg_check_num(n_args, n_kw, 2, 2, false); mp_obj_filter_t *o = m_new_obj(mp_obj_filter_t); o->base.type = MP_OBJ_TO_PTR(type_in); diff --git a/py/objfloat.c b/py/objfloat.c index 051c0f61c330068b162df5b82a1f6ad1f5bf55f1..f144bfd8642613b3b04f21d70c6a75bfa51374d4 100644 --- a/py/objfloat.c +++ b/py/objfloat.c @@ -69,7 +69,7 @@ STATIC void float_print(const mp_print_t *print, mp_obj_t o_in, mp_print_kind_t } } -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) { +STATIC mp_obj_t float_make_new(mp_obj_t type_in, size_t n_args, size_t n_kw, const mp_obj_t *args) { (void)type_in; mp_arg_check_num(n_args, n_kw, 0, 1, false); diff --git a/py/objfun.c b/py/objfun.c index a574926ba585f4ff1335069f464e0c8956cfdce8..f2cc34fad686876b1f854073c0c0a568d3f0bddd 100644 --- a/py/objfun.c +++ b/py/objfun.c @@ -52,7 +52,7 @@ // mp_obj_fun_builtin_t defined in obj.h -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) { +STATIC mp_obj_t fun_builtin_call(mp_obj_t self_in, size_t n_args, size_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 = MP_OBJ_TO_PTR(self_in); @@ -196,7 +196,7 @@ mp_code_state *mp_obj_fun_bc_prepare_codestate(mp_obj_t self_in, size_t n_args, } #endif -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) { +STATIC mp_obj_t fun_bc_call(mp_obj_t self_in, size_t n_args, size_t n_kw, const mp_obj_t *args) { MP_STACK_CHECK(); DEBUG_printf("Input n_args: " UINT_FMT ", n_kw: " UINT_FMT "\n", n_args, n_kw); @@ -353,7 +353,7 @@ mp_obj_t mp_obj_new_fun_bc(mp_obj_t def_args_in, mp_obj_t def_kw_args, const byt #if MICROPY_EMIT_NATIVE -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) { +STATIC mp_obj_t fun_native_call(mp_obj_t self_in, size_t n_args, size_t n_kw, const mp_obj_t *args) { MP_STACK_CHECK(); mp_obj_fun_bc_t *self = self_in; mp_call_fun_t fun = MICROPY_MAKE_POINTER_CALLABLE((void*)self->bytecode); @@ -393,7 +393,7 @@ 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); typedef mp_uint_t (*viper_fun_4_t)(mp_uint_t, mp_uint_t, mp_uint_t, mp_uint_t); -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) { +STATIC mp_obj_t fun_viper_call(mp_obj_t self_in, size_t n_args, size_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); @@ -514,7 +514,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, mp_uint_t n_args, mp_uint_t n_kw, const mp_obj_t *args) { +STATIC mp_obj_t fun_asm_call(mp_obj_t self_in, size_t n_args, size_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 0a684856289e9f5b2b07d67643bd9bfa9a536ea5..91936f92f33df7a01d43a5485edb590938952870 100644 --- a/py/objgenerator.c +++ b/py/objgenerator.c @@ -49,7 +49,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, mp_uint_t n_args, mp_uint_t n_kw, const mp_obj_t *args) { +STATIC mp_obj_t gen_wrap_call(mp_obj_t self_in, size_t n_args, size_t n_kw, const mp_obj_t *args) { mp_obj_gen_wrap_t *self = MP_OBJ_TO_PTR(self_in); mp_obj_fun_bc_t *self_fun = (mp_obj_fun_bc_t*)self->fun; assert(self_fun->base.type == &mp_type_fun_bc); diff --git a/py/objint.c b/py/objint.c index 57fe364dcfd0a97b462ea9605442bff51eac06d0..7ee7653cadf5b705375b53fef0c4d7d47ef6e263 100644 --- a/py/objint.c +++ b/py/objint.c @@ -42,7 +42,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, mp_uint_t n_args, mp_uint_t n_kw, const mp_obj_t *args) { +STATIC mp_obj_t mp_obj_int_make_new(mp_obj_t type_in, size_t n_args, size_t n_kw, const mp_obj_t *args) { (void)type_in; mp_arg_check_num(n_args, n_kw, 0, 2, false); diff --git a/py/objlist.c b/py/objlist.c index d0641f21c2097bbbacd74a75be5e7ea1731cdc0f..059fec1b25dfd4c351961becb201fca5a108448d 100644 --- a/py/objlist.c +++ b/py/objlist.c @@ -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, mp_uint_t n_args, mp_uint_t n_kw, const mp_obj_t *args) { +STATIC mp_obj_t list_make_new(mp_obj_t type_in, size_t n_args, size_t n_kw, const mp_obj_t *args) { (void)type_in; mp_arg_check_num(n_args, n_kw, 0, 1, false); diff --git a/py/objmap.c b/py/objmap.c index 6dbfaca05f2f9c36de6927ddf89c49f2e5db2982..a0293c36f8164f9baba50904c1bbdeaa9066a125 100644 --- a/py/objmap.c +++ b/py/objmap.c @@ -36,7 +36,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, mp_uint_t n_args, mp_uint_t n_kw, const mp_obj_t *args) { +STATIC mp_obj_t map_make_new(mp_obj_t type_in, size_t n_args, size_t n_kw, const mp_obj_t *args) { mp_arg_check_num(n_args, n_kw, 2, MP_OBJ_FUN_ARGS_MAX, false); mp_obj_map_t *o = m_new_obj_var(mp_obj_map_t, mp_obj_t, n_args - 1); o->base.type = MP_OBJ_TO_PTR(type_in); diff --git a/py/objnamedtuple.c b/py/objnamedtuple.c index 167e23b4a434325cb6d9c623dfe1992c3b22535e..3e346032630525ac7c9d1bed53d79095baa6f376 100644 --- a/py/objnamedtuple.c +++ b/py/objnamedtuple.c @@ -77,7 +77,7 @@ STATIC void namedtuple_attr(mp_obj_t self_in, qstr attr, mp_obj_t *dest) { } } -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) { +STATIC mp_obj_t namedtuple_make_new(mp_obj_t type_in, size_t n_args, size_t n_kw, const mp_obj_t *args) { mp_obj_namedtuple_type_t *type = MP_OBJ_TO_PTR(type_in); mp_uint_t num_fields = type->n_fields; if (n_args + n_kw != num_fields) { diff --git a/py/objobject.c b/py/objobject.c index afb9d5af723187e4480f635db3f9bd5ffd28fc5c..5cd37739407d678a2d776152a2c5902fa4ce76b7 100644 --- a/py/objobject.c +++ b/py/objobject.c @@ -33,7 +33,7 @@ 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, mp_uint_t n_args, mp_uint_t n_kw, const mp_obj_t *args) { +STATIC mp_obj_t object_make_new(mp_obj_t type_in, size_t n_args, size_t n_kw, const mp_obj_t *args) { (void)args; mp_arg_check_num(n_args, n_kw, 0, 0, false); mp_obj_object_t *o = m_new_obj(mp_obj_object_t); diff --git a/py/objproperty.c b/py/objproperty.c index fb814cba1af7e1d8f9c57fc6f2001a41b951a019..323696cf159d204a464a76f732db059da6c55683 100644 --- a/py/objproperty.c +++ b/py/objproperty.c @@ -37,7 +37,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, mp_uint_t n_args, mp_uint_t n_kw, const mp_obj_t *args) { +STATIC mp_obj_t property_make_new(mp_obj_t type_in, size_t n_args, size_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 7a4aaa72cd17498802d4f723be6ef70baf6c8760..bec026ff6fda87de0f3bb881545456b2153ae325 100644 --- a/py/objrange.c +++ b/py/objrange.c @@ -90,7 +90,7 @@ STATIC void range_print(const mp_print_t *print, mp_obj_t self_in, mp_print_kind } } -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) { +STATIC mp_obj_t range_make_new(mp_obj_t type_in, size_t n_args, size_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); diff --git a/py/objreversed.c b/py/objreversed.c index 2b16f0893fc0d78ea566fa3745e3d54e5a1fd40a..b0da00a885f4a48585dbd541f0066ef6008b2708 100644 --- a/py/objreversed.c +++ b/py/objreversed.c @@ -38,7 +38,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, mp_uint_t n_args, mp_uint_t n_kw, const mp_obj_t *args) { +STATIC mp_obj_t reversed_make_new(mp_obj_t type_in, size_t n_args, size_t n_kw, const mp_obj_t *args) { mp_arg_check_num(n_args, n_kw, 1, 1, false); // check if __reversed__ exists, and if so delegate to it diff --git a/py/objset.c b/py/objset.c index fbcf0cdae9a56d60f151cb4c213aec864c3ff5ea..6ac9c580ab63d5428f44056090bb18e9d3290a00 100644 --- a/py/objset.c +++ b/py/objset.c @@ -119,7 +119,7 @@ STATIC void set_print(const mp_print_t *print, mp_obj_t self_in, mp_print_kind_t #endif } -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) { +STATIC mp_obj_t set_make_new(mp_obj_t type_in, size_t n_args, size_t n_kw, const mp_obj_t *args) { mp_arg_check_num(n_args, n_kw, 0, 1, false); switch (n_args) { diff --git a/py/objstr.c b/py/objstr.c index c4335bbac7ffa486130491800cc5a7afba1391e0..55c7cdd5f7134bfdab73e17f805adb81df52356d 100644 --- a/py/objstr.c +++ b/py/objstr.c @@ -131,7 +131,7 @@ STATIC void str_print(const mp_print_t *print, mp_obj_t self_in, mp_print_kind_t } } -mp_obj_t mp_obj_str_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_obj_str_make_new(mp_obj_t type_in, size_t n_args, size_t n_kw, const mp_obj_t *args) { #if MICROPY_CPYTHON_COMPAT if (n_kw != 0) { mp_arg_error_unimpl_kw(); @@ -169,7 +169,7 @@ mp_obj_t mp_obj_str_make_new(mp_obj_t type_in, mp_uint_t n_args, mp_uint_t n_kw, } } -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) { +STATIC mp_obj_t bytes_make_new(mp_obj_t type_in, size_t n_args, size_t n_kw, const mp_obj_t *args) { (void)type_in; #if MICROPY_CPYTHON_COMPAT diff --git a/py/objstr.h b/py/objstr.h index d9cc85ef0b0fe64c171aa3a3101e087e6180c6de..d9327b1ab8c31bc0413640342f54b6a10f5a9ab1 100644 --- a/py/objstr.h +++ b/py/objstr.h @@ -60,7 +60,7 @@ const byte *mp_obj_str_get_data_no_check(mp_obj_t self_in, size_t *len); else { str_len = ((mp_obj_str_t*)MP_OBJ_TO_PTR(str_obj_in))->len; str_data = ((mp_obj_str_t*)MP_OBJ_TO_PTR(str_obj_in))->data; } #endif -mp_obj_t mp_obj_str_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_obj_str_make_new(mp_obj_t type_in, size_t n_args, size_t n_kw, const mp_obj_t *args); void mp_str_print_json(const mp_print_t *print, const byte *str_data, size_t str_len); mp_obj_t mp_obj_str_format(mp_uint_t n_args, const mp_obj_t *args, mp_map_t *kwargs); mp_obj_t mp_obj_str_split(mp_uint_t n_args, const mp_obj_t *args); diff --git a/py/objstringio.c b/py/objstringio.c index 5a8f43da13098d146b7fa7c3ba4cae970f0ff22a..d046cdd80d0f11e3054ea14d93736bf9a0dcbd26 100644 --- a/py/objstringio.c +++ b/py/objstringio.c @@ -128,7 +128,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, mp_uint_t n_args, mp_uint_t n_kw, const mp_obj_t *args) { +STATIC mp_obj_t stringio_make_new(mp_obj_t type_in, size_t n_args, size_t n_kw, const mp_obj_t *args) { (void)n_kw; // TODO check n_kw==0 mp_obj_stringio_t *o = stringio_new(type_in); diff --git a/py/objtuple.c b/py/objtuple.c index de2bfc31d2f6f37d150293f2f8e01bf095dc7f32..8337b67042368ebc322db2c99ec5e76ae8938d08 100644 --- a/py/objtuple.c +++ b/py/objtuple.c @@ -61,7 +61,7 @@ void mp_obj_tuple_print(const mp_print_t *print, mp_obj_t o_in, mp_print_kind_t } } -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) { +STATIC mp_obj_t mp_obj_tuple_make_new(mp_obj_t type_in, size_t n_args, size_t n_kw, const mp_obj_t *args) { (void)type_in; mp_arg_check_num(n_args, n_kw, 0, 1, false); diff --git a/py/objtype.c b/py/objtype.c index ca52006f25a299b0ca8c03b5b605d375e24f7ff7..c9ab59642f7e79250d5d6d20128b2b51b04483b8 100644 --- a/py/objtype.c +++ b/py/objtype.c @@ -43,7 +43,7 @@ #define DEBUG_printf(...) (void)0 #endif -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); +STATIC mp_obj_t static_class_method_make_new(mp_obj_t self_in, size_t n_args, size_t n_kw, const mp_obj_t *args); /******************************************************************************/ // instance object @@ -235,7 +235,7 @@ STATIC void instance_print(const mp_print_t *print, mp_obj_t self_in, mp_print_k mp_printf(print, "<%s object at %p>", mp_obj_get_type_str(self_in), self_in); } -mp_obj_t mp_obj_instance_make_new(mp_obj_t self_in, mp_uint_t n_args, mp_uint_t n_kw, const mp_obj_t *args) { +mp_obj_t mp_obj_instance_make_new(mp_obj_t self_in, size_t n_args, size_t n_kw, const mp_obj_t *args) { assert(MP_OBJ_IS_TYPE(self_in, &mp_type_type)); mp_obj_type_t *self = MP_OBJ_TO_PTR(self_in); assert(mp_obj_is_instance_type(self)); @@ -707,7 +707,7 @@ bool mp_obj_instance_is_callable(mp_obj_t self_in) { return mp_obj_instance_get_call(self_in) != MP_OBJ_NULL; } -mp_obj_t mp_obj_instance_call(mp_obj_t self_in, mp_uint_t n_args, mp_uint_t n_kw, const mp_obj_t *args) { +mp_obj_t mp_obj_instance_call(mp_obj_t self_in, size_t n_args, size_t n_kw, const mp_obj_t *args) { mp_obj_t call = mp_obj_instance_get_call(self_in); if (call == MP_OBJ_NULL) { if (MICROPY_ERROR_REPORTING == MICROPY_ERROR_REPORTING_TERSE) { @@ -778,7 +778,7 @@ STATIC void type_print(const mp_print_t *print, mp_obj_t self_in, mp_print_kind_ mp_printf(print, "<class '%q'>", self->name); } -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) { +STATIC mp_obj_t type_make_new(mp_obj_t type_in, size_t n_args, size_t n_kw, const mp_obj_t *args) { (void)type_in; mp_arg_check_num(n_args, n_kw, 1, 3, false); @@ -798,7 +798,7 @@ STATIC mp_obj_t type_make_new(mp_obj_t type_in, mp_uint_t n_args, mp_uint_t n_kw } } -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) { +STATIC mp_obj_t type_call(mp_obj_t self_in, size_t n_args, size_t n_kw, const mp_obj_t *args) { // instantiate an instance of a class mp_obj_type_t *self = MP_OBJ_TO_PTR(self_in); @@ -957,7 +957,7 @@ STATIC void super_print(const mp_print_t *print, mp_obj_t self_in, mp_print_kind mp_print_str(print, ">"); } -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) { +STATIC mp_obj_t super_make_new(mp_obj_t type_in, size_t n_args, size_t n_kw, const mp_obj_t *args) { (void)type_in; // 0 arguments are turned into 2 in the compiler // 1 argument is not yet implemented @@ -1108,7 +1108,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, mp_uint_t n_args, mp_uint_t n_kw, const mp_obj_t *args) { +STATIC mp_obj_t static_class_method_make_new(mp_obj_t self_in, size_t n_args, size_t n_kw, const mp_obj_t *args) { mp_obj_type_t *self = MP_OBJ_TO_PTR(self_in); assert(self == &mp_type_staticmethod || self == &mp_type_classmethod); diff --git a/py/objtype.h b/py/objtype.h index 6023e8dfe51ff89353c2bc6d88ad9517d3c0b363..06227cf5a3ce63c52c9aef85d8dc57c1003812ba 100644 --- a/py/objtype.h +++ b/py/objtype.h @@ -42,11 +42,11 @@ void mp_obj_instance_attr(mp_obj_t self_in, qstr attr, mp_obj_t *dest); // these need to be exposed so mp_obj_is_callable can work correctly bool mp_obj_instance_is_callable(mp_obj_t self_in); -mp_obj_t mp_obj_instance_call(mp_obj_t self_in, mp_uint_t n_args, mp_uint_t n_kw, const mp_obj_t *args); +mp_obj_t mp_obj_instance_call(mp_obj_t self_in, size_t n_args, size_t n_kw, const mp_obj_t *args); #define mp_obj_is_instance_type(type) ((type)->make_new == mp_obj_instance_make_new) #define mp_obj_is_native_type(type) ((type)->make_new != mp_obj_instance_make_new) // this needs to be exposed for the above macros to work correctly -mp_obj_t mp_obj_instance_make_new(mp_obj_t self_in, mp_uint_t n_args, mp_uint_t n_kw, const mp_obj_t *args); +mp_obj_t mp_obj_instance_make_new(mp_obj_t self_in, size_t n_args, size_t n_kw, const mp_obj_t *args); #endif // __MICROPY_INCLUDED_PY_OBJTYPE_H__ diff --git a/py/objzip.c b/py/objzip.c index 3ac6af15cd5875929b7fd2c7ea6b93b59c847535..4b240fbbf7019eb7dc4f47d42e932931ee1634b3 100644 --- a/py/objzip.c +++ b/py/objzip.c @@ -36,7 +36,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, mp_uint_t n_args, mp_uint_t n_kw, const mp_obj_t *args) { +STATIC mp_obj_t zip_make_new(mp_obj_t type_in, size_t n_args, size_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); diff --git a/py/runtime.c b/py/runtime.c index c97710bc90c310ceed098abed60e37bc735f07c1..b0f407a150dd415ec3fd20080f9dd48c64a955d9 100644 --- a/py/runtime.c +++ b/py/runtime.c @@ -894,7 +894,7 @@ typedef struct _mp_obj_checked_fun_t { mp_obj_t fun; } mp_obj_checked_fun_t; -STATIC mp_obj_t checked_fun_call(mp_obj_t self_in, mp_uint_t n_args, mp_uint_t n_kw, const mp_obj_t *args) { +STATIC mp_obj_t checked_fun_call(mp_obj_t self_in, size_t n_args, size_t n_kw, const mp_obj_t *args) { mp_obj_checked_fun_t *self = MP_OBJ_TO_PTR(self_in); if (n_args > 0) { const mp_obj_type_t *arg0_type = mp_obj_get_type(args[0]); diff --git a/unix/file.c b/unix/file.c index 7f113d6712096099aa526ddda18e91d07c9b5b27..751d62fd5119ff65c0ff13ed1d2b286782dcb44a 100644 --- a/unix/file.c +++ b/unix/file.c @@ -202,7 +202,7 @@ STATIC mp_obj_t fdfile_open(const mp_obj_type_t *type, mp_arg_val_t *args) { return MP_OBJ_FROM_PTR(o); } -STATIC mp_obj_t fdfile_make_new(mp_obj_t type_in, mp_uint_t n_args, mp_uint_t n_kw, const mp_obj_t *args) { +STATIC mp_obj_t fdfile_make_new(mp_obj_t type_in, size_t n_args, size_t n_kw, const mp_obj_t *args) { mp_arg_val_t arg_vals[FILE_OPEN_NUM_ARGS]; mp_arg_parse_all_kw_array(n_args, n_kw, args, FILE_OPEN_NUM_ARGS, file_open_args, arg_vals); return fdfile_open(MP_OBJ_TO_PTR(type_in), arg_vals); diff --git a/unix/modffi.c b/unix/modffi.c index c998a809e4bc2029be6e547b914b67f5b3c12a19..be12974979f65086a7f8c0010ed91727179c3ea6 100644 --- a/unix/modffi.c +++ b/unix/modffi.c @@ -301,7 +301,7 @@ STATIC mp_obj_t ffimod_addr(mp_obj_t self_in, mp_obj_t symname_in) { } MP_DEFINE_CONST_FUN_OBJ_2(ffimod_addr_obj, ffimod_addr); -STATIC mp_obj_t ffimod_make_new(mp_obj_t type_in, mp_uint_t n_args, mp_uint_t n_kw, const mp_obj_t *args) { +STATIC mp_obj_t ffimod_make_new(mp_obj_t type_in, size_t n_args, size_t n_kw, const mp_obj_t *args) { (void)n_args; (void)n_kw; @@ -345,7 +345,7 @@ STATIC void ffifunc_print(const mp_print_t *print, mp_obj_t self_in, mp_print_ki mp_printf(print, "<ffifunc %p>", self->func); } -STATIC mp_obj_t ffifunc_call(mp_obj_t self_in, mp_uint_t n_args, mp_uint_t n_kw, const mp_obj_t *args) { +STATIC mp_obj_t ffifunc_call(mp_obj_t self_in, size_t n_args, size_t n_kw, const mp_obj_t *args) { mp_obj_ffifunc_t *self = MP_OBJ_TO_PTR(self_in); assert(n_kw == 0); assert(n_args == self->cif.nargs); diff --git a/unix/modsocket.c b/unix/modsocket.c index 6a7c3f5510533df68a816259ee31eb525ce32aa1..0857d05733d590a2146934f86f36520c26fc0df6 100644 --- a/unix/modsocket.c +++ b/unix/modsocket.c @@ -313,7 +313,7 @@ STATIC mp_obj_t socket_makefile(mp_uint_t n_args, const mp_obj_t *args) { } STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(socket_makefile_obj, 1, 3, socket_makefile); -STATIC mp_obj_t socket_make_new(mp_obj_t type_in, mp_uint_t n_args, mp_uint_t n_kw, const mp_obj_t *args) { +STATIC mp_obj_t socket_make_new(mp_obj_t type_in, size_t n_args, size_t n_kw, const mp_obj_t *args) { (void)type_in; (void)n_kw;