Skip to content

Commit 1a0bc40

Browse files
committed
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>
1 parent 954521b commit 1a0bc40

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

ports/unix/coverage.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -517,7 +517,7 @@ static mp_obj_t extra_coverage(void) {
517517
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"));
518518

519519
// mp_obj_int_get_checked with mp_obj_int_t that has a value that is a small integer
520-
mp_printf(&mp_plat_print, "%d\n", mp_obj_int_get_checked(mp_obj_int_new_mpz()));
520+
mp_printf(&mp_plat_print, "%d\n", mp_obj_int_get_checked(MP_OBJ_FROM_PTR(mp_obj_int_new_mpz())));
521521

522522
// mp_obj_int_get_uint_checked with non-negative small-int
523523
mp_printf(&mp_plat_print, "%d\n", (int)mp_obj_int_get_uint_checked(MP_OBJ_NEW_SMALL_INT(1)));
@@ -856,7 +856,7 @@ static mp_obj_t extra_coverage(void) {
856856
mp_obj_streamtest_t *s2 = mp_obj_malloc(mp_obj_streamtest_t, &mp_type_stest_textio2);
857857

858858
// return a tuple of data for testing on the Python side
859-
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)};
859+
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)};
860860
return mp_obj_new_tuple(MP_ARRAY_SIZE(items), items);
861861
}
862862
MP_DEFINE_CONST_FUN_OBJ_0(extra_coverage_obj, extra_coverage);

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy