summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorstijn <stijn@ignitron.net>2022-02-28 10:20:47 +0100
committerDamien George <damien@micropython.org>2022-03-01 16:17:30 +1100
commit795370ca23ac8b0f3589ec1d4b34d3d7f3b175eb (patch)
tree2800d7b2946d595b44156c4ffcfb7c413a5e4681
parent3c2aa5ff93a3b12723c7ca794aa9c583891c349b (diff)
py/bc.h: Fix C++ compilation of public API.
Casts between unrelated types must be explicit. Regression in f2040bfc7ee033e48acef9f289790f3b4e6b74e5
-rw-r--r--py/bc.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/py/bc.h b/py/bc.h
index 7d761e30e..5710f4d24 100644
--- a/py/bc.h
+++ b/py/bc.h
@@ -287,8 +287,8 @@ static inline void mp_module_context_alloc_tables(mp_module_context_t *context,
size_t nq = (n_qstr * sizeof(qstr_short_t) + sizeof(mp_uint_t) - 1) / sizeof(mp_uint_t);
size_t no = n_obj;
mp_uint_t *mem = m_new(mp_uint_t, nq + no);
- context->constants.qstr_table = (void *)(mem);
- context->constants.obj_table = (void *)(mem + nq);
+ context->constants.qstr_table = (qstr_short_t *)mem;
+ context->constants.obj_table = (mp_obj_t *)(mem + nq);
#else
if (n_obj == 0) {
context->constants.obj_table = NULL;