summaryrefslogtreecommitdiff
path: root/ports/unix/coverage.c
diff options
context:
space:
mode:
authorJeff Epler <jepler@gmail.com>2025-07-05 18:50:13 +0100
committerDamien George <damien@micropython.org>2025-07-08 21:50:27 +1000
commitda3709a73810d054bb93baf8509dcc5d246962b1 (patch)
tree7b1dc87585d60aa8b925eaf24a700c567a05d38b /ports/unix/coverage.c
parent99740dbace962eb8e38da174cc1857406e626456 (diff)
unix/coverage: Add missing MP_OBJ_FROM_PTR casts.
An attempt to build the coverage module into the nanbox binary failed, but pointed out that these sites needed explicit conversion from pointer to object. Signed-off-by: Jeff Epler <jepler@gmail.com>
Diffstat (limited to 'ports/unix/coverage.c')
-rw-r--r--ports/unix/coverage.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/ports/unix/coverage.c b/ports/unix/coverage.c
index 33e4208d9..cdab17cac 100644
--- a/ports/unix/coverage.c
+++ b/ports/unix/coverage.c
@@ -505,7 +505,7 @@ static mp_obj_t extra_coverage(void) {
mp_call_function_2_protected(MP_OBJ_FROM_PTR(&mp_builtin_divmod_obj), mp_obj_new_str_from_cstr("abc"), mp_obj_new_str_from_cstr("abc"));
// mp_obj_int_get_checked with mp_obj_int_t that has a value that is a small integer
- mp_printf(&mp_plat_print, "%d\n", mp_obj_int_get_checked(mp_obj_int_new_mpz()));
+ mp_printf(&mp_plat_print, "%d\n", mp_obj_int_get_checked(MP_OBJ_FROM_PTR(mp_obj_int_new_mpz())));
// mp_obj_int_get_uint_checked with non-negative small-int
mp_printf(&mp_plat_print, "%d\n", (int)mp_obj_int_get_uint_checked(MP_OBJ_NEW_SMALL_INT(1)));
@@ -844,7 +844,7 @@ static mp_obj_t extra_coverage(void) {
mp_obj_streamtest_t *s2 = mp_obj_malloc(mp_obj_streamtest_t, &mp_type_stest_textio2);
// return a tuple of data for testing on the Python side
- mp_obj_t items[] = {(mp_obj_t)&str_no_hash_obj, (mp_obj_t)&bytes_no_hash_obj, MP_OBJ_FROM_PTR(s), MP_OBJ_FROM_PTR(s2)};
+ mp_obj_t items[] = {MP_OBJ_FROM_PTR(&str_no_hash_obj), MP_OBJ_FROM_PTR(&bytes_no_hash_obj), MP_OBJ_FROM_PTR(s), MP_OBJ_FROM_PTR(s2)};
return mp_obj_new_tuple(MP_ARRAY_SIZE(items), items);
}
MP_DEFINE_CONST_FUN_OBJ_0(extra_coverage_obj, extra_coverage);