Skip to content

Commit

Permalink
py/bc.h: Fix C++ compilation of public API.
Browse files Browse the repository at this point in the history
Casts between unrelated types must be explicit.  Regression in
f2040bf
  • Loading branch information
stinos authored and dpgeorge committed Mar 1, 2022
1 parent 3c2aa5f commit 795370c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions py/bc.h
Expand Up @@ -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;
Expand Down

0 comments on commit 795370c

Please sign in to comment.