@@ -96,11 +96,11 @@ static NORETURN void syntax_error(void) {
96
96
static mp_obj_t uctypes_struct_make_new (const mp_obj_type_t * type , size_t n_args , size_t n_kw , const mp_obj_t * args ) {
97
97
mp_arg_check_num (n_args , n_kw , 2 , 3 , false);
98
98
mp_obj_uctypes_struct_t * o = mp_obj_malloc (mp_obj_uctypes_struct_t , type );
99
- #ifdef __CHERI_PURE_CAPABILITY__
99
+ #ifdef __CHERI_PURE_CAPABILITY__
100
100
o -> addr = (void * )mp_obj_cap_get (args [0 ]);
101
- #else
101
+ #else
102
102
o -> addr = (void * )(uintptr_t )mp_obj_int_get_truncated (args [0 ]);
103
- #endif
103
+ #endif
104
104
o -> desc = args [1 ];
105
105
o -> flags = LAYOUT_NATIVE ;
106
106
if (n_args == 3 ) {
@@ -620,33 +620,33 @@ static mp_int_t uctypes_get_buffer(mp_obj_t self_in, mp_buffer_info_t *bufinfo,
620
620
static mp_obj_t uctypes_struct_addressof (mp_obj_t buf ) {
621
621
mp_buffer_info_t bufinfo ;
622
622
mp_get_buffer_raise (buf , & bufinfo , MP_BUFFER_READ );
623
- #ifdef __CHERI_PURE_CAPABILITY__
623
+ #ifdef __CHERI_PURE_CAPABILITY__
624
624
return mp_obj_new_cap (bufinfo .buf );
625
- #else
625
+ #else
626
626
return mp_obj_new_int ((mp_int_t )(uintptr_t )bufinfo .buf );
627
- #endif
627
+ #endif
628
628
}
629
629
MP_DEFINE_CONST_FUN_OBJ_1 (uctypes_struct_addressof_obj , uctypes_struct_addressof );
630
630
631
631
// bytearray_at()
632
632
// Capture memory at given address of given size as bytearray.
633
633
static mp_obj_t uctypes_struct_bytearray_at (mp_obj_t ptr , mp_obj_t size ) {
634
- #ifdef __CHERI_PURE_CAPABILITY__
634
+ #ifdef __CHERI_PURE_CAPABILITY__
635
635
return mp_obj_new_bytearray_by_ref (mp_obj_int_get_truncated (size ), (void * )mp_obj_cap_get (ptr ));
636
- #else
636
+ #else
637
637
return mp_obj_new_bytearray_by_ref (mp_obj_int_get_truncated (size ), (void * )(uintptr_t )mp_obj_int_get_truncated (ptr ));
638
- #endif
638
+ #endif
639
639
}
640
640
MP_DEFINE_CONST_FUN_OBJ_2 (uctypes_struct_bytearray_at_obj , uctypes_struct_bytearray_at );
641
641
642
642
// bytes_at()
643
643
// Capture memory at given address of given size as bytes.
644
644
static mp_obj_t uctypes_struct_bytes_at (mp_obj_t ptr , mp_obj_t size ) {
645
- #ifdef __CHERI_PURE_CAPABILITY__
646
- return mp_obj_new_bytes ((void * )mp_obj_cap_get (ptr ), mp_obj_int_get_truncated (size ));
647
- #else
645
+ #ifdef __CHERI_PURE_CAPABILITY__
646
+ return mp_obj_new_bytes ((void * )mp_obj_cap_get (ptr ), mp_obj_int_get_truncated (size ));
647
+ #else
648
648
return mp_obj_new_bytes ((void * )(uintptr_t )mp_obj_int_get_truncated (ptr ), mp_obj_int_get_truncated (size ));
649
- #endif
649
+ #endif
650
650
}
651
651
MP_DEFINE_CONST_FUN_OBJ_2 (uctypes_struct_bytes_at_obj , uctypes_struct_bytes_at );
652
652
0 commit comments