summaryrefslogtreecommitdiff
path: root/py/objfun.h
diff options
context:
space:
mode:
authorstijn <stijn@ignitron.net>2024-04-18 12:01:45 +0200
committerDamien George <damien@micropython.org>2024-04-22 10:34:01 +1000
commit40f7e9ce20e845ce2372347e5b5fd4dbff69ef6e (patch)
treea060c8c175eeaa7fff442f798c7d35bcb07c907e /py/objfun.h
parent3129b69e0f990d9f9bf8cc73d7650ddd8a5e06a3 (diff)
py/objfun: Fix C++ compatibility with casting in inline functions.
Explicit casts are needed. Fixes recent changes from 648a7578da21cc7ddb4046fc59891144e797b983 and 9400229766624e80db6a6f95af287a5542dc1b43. Signed-off-by: stijn <stijn@ignitron.net>
Diffstat (limited to 'py/objfun.h')
-rw-r--r--py/objfun.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/py/objfun.h b/py/objfun.h
index af7c33485..f16ef76b8 100644
--- a/py/objfun.h
+++ b/py/objfun.h
@@ -56,14 +56,14 @@ void mp_obj_fun_bc_attr(mp_obj_t self_in, qstr attr, mp_obj_t *dest);
#if MICROPY_EMIT_NATIVE
static inline mp_obj_t mp_obj_new_fun_native(const mp_obj_t *def_args, const void *fun_data, const mp_module_context_t *mc, struct _mp_raw_code_t *const *child_table) {
- mp_obj_fun_bc_t *o = MP_OBJ_TO_PTR(mp_obj_new_fun_bc(def_args, (const byte *)fun_data, mc, child_table));
+ mp_obj_fun_bc_t *o = (mp_obj_fun_bc_t *)MP_OBJ_TO_PTR(mp_obj_new_fun_bc(def_args, (const byte *)fun_data, mc, child_table));
o->base.type = &mp_type_fun_native;
return MP_OBJ_FROM_PTR(o);
}
static inline mp_obj_t mp_obj_new_fun_viper(const void *fun_data, const mp_module_context_t *mc, struct _mp_raw_code_t *const *child_table) {
mp_obj_fun_bc_t *o = mp_obj_malloc(mp_obj_fun_bc_t, &mp_type_fun_viper);
- o->bytecode = fun_data;
+ o->bytecode = (const byte *)fun_data;
o->context = mc;
o->child_table = child_table;
return MP_OBJ_FROM_PTR(o);
@@ -101,9 +101,9 @@ static inline void *mp_obj_fun_native_get_generator_resume(const mp_obj_fun_bc_t
#if MICROPY_EMIT_INLINE_ASM
static inline mp_obj_t mp_obj_new_fun_asm(size_t n_args, const void *fun_data, mp_uint_t type_sig) {
- mp_obj_fun_asm_t *o = mp_obj_malloc(mp_obj_fun_asm_t, &mp_type_fun_asm);
+ mp_obj_fun_asm_t *o = (mp_obj_fun_asm_t *)mp_obj_malloc(mp_obj_fun_asm_t, &mp_type_fun_asm);
o->n_args = n_args;
- o->fun_data = fun_data;
+ o->fun_data = (const byte *)fun_data;
o->type_sig = type_sig;
return MP_OBJ_FROM_PTR(o);
}