@@ -158,7 +158,7 @@ typedef enum _mp_map_lookup_kind_t {
158158 MP_MAP_LOOKUP_REMOVE_IF_FOUND , // 2
159159} mp_map_lookup_kind_t ;
160160
161- static inline bool MP_MAP_SLOT_IS_FILLED (mp_map_t * map , machine_uint_t pos ) { return ((map )-> table [pos ].key != MP_OBJ_NULL && (map )-> table [pos ].key != MP_OBJ_SENTINEL ); }
161+ static inline bool MP_MAP_SLOT_IS_FILLED (const mp_map_t * map , machine_uint_t pos ) { return ((map )-> table [pos ].key != MP_OBJ_NULL && (map )-> table [pos ].key != MP_OBJ_SENTINEL ); }
162162
163163void mp_map_init (mp_map_t * map , int n );
164164void mp_map_init_fixed_table (mp_map_t * map , int n , const mp_obj_t * table );
@@ -177,7 +177,7 @@ typedef struct _mp_set_t {
177177 mp_obj_t * table ;
178178} mp_set_t ;
179179
180- static inline bool MP_SET_SLOT_IS_FILLED (mp_set_t * set , machine_uint_t pos ) { return ((set )-> table [pos ] != MP_OBJ_NULL && (set )-> table [pos ] != MP_OBJ_SENTINEL ); }
180+ static inline bool MP_SET_SLOT_IS_FILLED (const mp_set_t * set , machine_uint_t pos ) { return ((set )-> table [pos ] != MP_OBJ_NULL && (set )-> table [pos ] != MP_OBJ_SENTINEL ); }
181181
182182void mp_set_init (mp_set_t * set , int n );
183183mp_obj_t mp_set_lookup (mp_set_t * set , mp_obj_t index , mp_map_lookup_kind_t lookup_kind );
@@ -424,8 +424,8 @@ bool mp_obj_is_callable(mp_obj_t o_in);
424424machine_int_t mp_obj_hash (mp_obj_t o_in );
425425bool mp_obj_equal (mp_obj_t o1 , mp_obj_t o2 );
426426
427- machine_int_t mp_obj_get_int (mp_obj_t arg );
428- bool mp_obj_get_int_maybe (mp_obj_t arg , machine_int_t * value );
427+ machine_int_t mp_obj_get_int (mp_const_obj_t arg );
428+ bool mp_obj_get_int_maybe (mp_const_obj_t arg , machine_int_t * value );
429429#if MICROPY_ENABLE_FLOAT
430430mp_float_t mp_obj_get_float (mp_obj_t self_in );
431431void mp_obj_get_complex (mp_obj_t self_in , mp_float_t * real , mp_float_t * imag );
@@ -452,7 +452,7 @@ machine_int_t mp_obj_int_get(mp_obj_t self_in);
452452mp_float_t mp_obj_int_as_float (mp_obj_t self_in );
453453#endif
454454// Will raise exception if value doesn't fit into machine_int_t
455- machine_int_t mp_obj_int_get_checked (mp_obj_t self_in );
455+ machine_int_t mp_obj_int_get_checked (mp_const_obj_t self_in );
456456
457457// exception
458458#define mp_obj_is_native_exception_instance (o ) (mp_obj_get_type(o)->make_new == mp_obj_exception_make_new)
@@ -540,7 +540,7 @@ typedef struct _mp_obj_fun_native_t { // need this so we can define const object
540540
541541bool mp_obj_fun_prepare_simple_args (mp_obj_t self_in , uint n_args , uint n_kw , const mp_obj_t * args ,
542542 uint * out_args1_len , const mp_obj_t * * out_args1 , uint * out_args2_len , const mp_obj_t * * out_args2 );
543- const char * mp_obj_fun_get_name (mp_obj_t fun );
543+ const char * mp_obj_fun_get_name (mp_const_obj_t fun );
544544const char * mp_obj_code_get_name (const byte * code_info );
545545
546546mp_obj_t mp_identity (mp_obj_t self );
0 commit comments