@@ -301,7 +301,7 @@ mp_obj_t mp_binary_op(mp_uint_t op, mp_obj_t lhs, mp_obj_t rhs) {
301301 }
302302 } else if (MP_OBJ_IS_TYPE (rhs , & mp_type_tuple )) {
303303 mp_obj_tuple_t * tuple = MP_OBJ_TO_PTR (rhs );
304- for (mp_uint_t i = 0 ; i < tuple -> len ; i ++ ) {
304+ for (size_t i = 0 ; i < tuple -> len ; i ++ ) {
305305 rhs = tuple -> items [i ];
306306 if (!mp_obj_is_exception_type (rhs )) {
307307 goto unsupported_op ;
@@ -580,7 +580,7 @@ mp_obj_t mp_call_function_2(mp_obj_t fun, mp_obj_t arg1, mp_obj_t arg2) {
580580}
581581
582582// args contains, eg: arg0 arg1 key0 value0 key1 value1
583- 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 ) {
583+ mp_obj_t mp_call_function_n_kw (mp_obj_t fun_in , size_t n_args , size_t n_kw , const mp_obj_t * args ) {
584584 // TODO improve this: fun object can specify its type and we parse here the arguments,
585585 // passing to the function arrays of fixed and keyword arguments
586586
@@ -604,7 +604,7 @@ mp_obj_t mp_call_function_n_kw(mp_obj_t fun_in, mp_uint_t n_args, mp_uint_t n_kw
604604
605605// 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)
606606// if n_args==0 and n_kw==0 then there are only fun and self/NULL
607- mp_obj_t mp_call_method_n_kw (mp_uint_t n_args , mp_uint_t n_kw , const mp_obj_t * args ) {
607+ mp_obj_t mp_call_method_n_kw (size_t n_args , size_t n_kw , const mp_obj_t * args ) {
608608 DEBUG_OP_printf ("call method (fun=%p, self=%p, n_args=" UINT_FMT ", n_kw=" UINT_FMT ", args=%p)\n" , args [0 ], args [1 ], n_args , n_kw , args );
609609 int adjust = (args [1 ] == MP_OBJ_NULL ) ? 0 : 1 ;
610610 return mp_call_function_n_kw (args [0 ], n_args + adjust , n_kw , args + 2 - adjust );
@@ -614,7 +614,7 @@ mp_obj_t mp_call_method_n_kw(mp_uint_t n_args, mp_uint_t n_kw, const mp_obj_t *a
614614#if !MICROPY_STACKLESS
615615STATIC
616616#endif
617- void mp_call_prepare_args_n_kw_var (bool have_self , mp_uint_t n_args_n_kw , const mp_obj_t * args , mp_call_args_t * out_args ) {
617+ void mp_call_prepare_args_n_kw_var (bool have_self , size_t n_args_n_kw , const mp_obj_t * args , mp_call_args_t * out_args ) {
618618 mp_obj_t fun = * args ++ ;
619619 mp_obj_t self = MP_OBJ_NULL ;
620620 if (have_self ) {
@@ -724,7 +724,7 @@ void mp_call_prepare_args_n_kw_var(bool have_self, mp_uint_t n_args_n_kw, const
724724 // dictionary
725725 mp_map_t * map = mp_obj_dict_get_map (kw_dict );
726726 assert (args2_len + 2 * map -> used <= args2_alloc ); // should have enough, since kw_dict_len is in this case hinted correctly above
727- for (mp_uint_t i = 0 ; i < map -> alloc ; i ++ ) {
727+ for (size_t i = 0 ; i < map -> alloc ; i ++ ) {
728728 if (MP_MAP_SLOT_IS_FILLED (map , i )) {
729729 // the key must be a qstr, so intern it if it's a string
730730 mp_obj_t key = map -> table [i ].key ;
@@ -780,7 +780,7 @@ void mp_call_prepare_args_n_kw_var(bool have_self, mp_uint_t n_args_n_kw, const
780780 out_args -> n_alloc = args2_alloc ;
781781}
782782
783- mp_obj_t mp_call_method_n_kw_var (bool have_self , mp_uint_t n_args_n_kw , const mp_obj_t * args ) {
783+ mp_obj_t mp_call_method_n_kw_var (bool have_self , size_t n_args_n_kw , const mp_obj_t * args ) {
784784 mp_call_args_t out_args ;
785785 mp_call_prepare_args_n_kw_var (have_self , n_args_n_kw , args , & out_args );
786786
@@ -791,7 +791,7 @@ mp_obj_t mp_call_method_n_kw_var(bool have_self, mp_uint_t n_args_n_kw, const mp
791791}
792792
793793// unpacked items are stored in reverse order into the array pointed to by items
794- void mp_unpack_sequence (mp_obj_t seq_in , mp_uint_t num , mp_obj_t * items ) {
794+ void mp_unpack_sequence (mp_obj_t seq_in , size_t num , mp_obj_t * items ) {
795795 mp_uint_t seq_len ;
796796 if (MP_OBJ_IS_TYPE (seq_in , & mp_type_tuple ) || MP_OBJ_IS_TYPE (seq_in , & mp_type_list )) {
797797 mp_obj_t * seq_items ;
@@ -805,7 +805,7 @@ void mp_unpack_sequence(mp_obj_t seq_in, mp_uint_t num, mp_obj_t *items) {
805805 } else if (seq_len > num ) {
806806 goto too_long ;
807807 }
808- for (mp_uint_t i = 0 ; i < num ; i ++ ) {
808+ for (size_t i = 0 ; i < num ; i ++ ) {
809809 items [i ] = seq_items [num - 1 - i ];
810810 }
811811 } else {
@@ -841,9 +841,9 @@ void mp_unpack_sequence(mp_obj_t seq_in, mp_uint_t num, mp_obj_t *items) {
841841}
842842
843843// unpacked items are stored in reverse order into the array pointed to by items
844- void mp_unpack_ex (mp_obj_t seq_in , mp_uint_t num_in , mp_obj_t * items ) {
845- mp_uint_t num_left = num_in & 0xff ;
846- mp_uint_t num_right = (num_in >> 8 ) & 0xff ;
844+ void mp_unpack_ex (mp_obj_t seq_in , size_t num_in , mp_obj_t * items ) {
845+ size_t num_left = num_in & 0xff ;
846+ size_t num_right = (num_in >> 8 ) & 0xff ;
847847 DEBUG_OP_printf ("unpack ex " UINT_FMT " " UINT_FMT "\n" , num_left , num_right );
848848 mp_uint_t seq_len ;
849849 if (MP_OBJ_IS_TYPE (seq_in , & mp_type_tuple ) || MP_OBJ_IS_TYPE (seq_in , & mp_type_list )) {
@@ -861,11 +861,11 @@ void mp_unpack_ex(mp_obj_t seq_in, mp_uint_t num_in, mp_obj_t *items) {
861861 if (seq_len < num_left + num_right ) {
862862 goto too_short ;
863863 }
864- for (mp_uint_t i = 0 ; i < num_right ; i ++ ) {
864+ for (size_t i = 0 ; i < num_right ; i ++ ) {
865865 items [i ] = seq_items [seq_len - 1 - i ];
866866 }
867867 items [num_right ] = mp_obj_new_list (seq_len - num_left - num_right , seq_items + num_left );
868- for (mp_uint_t i = 0 ; i < num_left ; i ++ ) {
868+ for (size_t i = 0 ; i < num_left ; i ++ ) {
869869 items [num_right + 1 + i ] = seq_items [num_left - 1 - i ];
870870 }
871871 } else {
@@ -890,7 +890,7 @@ void mp_unpack_ex(mp_obj_t seq_in, mp_uint_t num_in, mp_obj_t *items) {
890890 goto too_short ;
891891 }
892892 items [num_right ] = MP_OBJ_FROM_PTR (rest );
893- for (mp_uint_t i = 0 ; i < num_right ; i ++ ) {
893+ for (size_t i = 0 ; i < num_right ; i ++ ) {
894894 items [num_right - 1 - i ] = rest -> items [rest -> len - num_right + i ];
895895 }
896896 mp_obj_list_set_len (MP_OBJ_FROM_PTR (rest ), rest -> len - num_right );
@@ -1350,7 +1350,7 @@ void mp_import_all(mp_obj_t module) {
13501350
13511351 // TODO: Support __all__
13521352 mp_map_t * map = mp_obj_dict_get_map (MP_OBJ_FROM_PTR (mp_obj_module_get_globals (module )));
1353- for (mp_uint_t i = 0 ; i < map -> alloc ; i ++ ) {
1353+ for (size_t i = 0 ; i < map -> alloc ; i ++ ) {
13541354 if (MP_MAP_SLOT_IS_FILLED (map , i )) {
13551355 qstr name = MP_OBJ_QSTR_VALUE (map -> table [i ].key );
13561356 if (* qstr_str (name ) != '_' ) {
0 commit comments