diff options
author | Damien George <damien.p.george@gmail.com> | 2019-01-25 16:03:05 +1100 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2019-01-25 16:03:05 +1100 |
commit | 5089b3ffb6dbaacdd99176b0ed4ff0aeeddca4d1 (patch) | |
tree | 2c5f87376452245ae25d34b53b112974ff5f0c08 /py/runtime.h | |
parent | acd647100b0fb02aab32500c4a3ffd0faceae7e8 (diff) |
py/obj.h: Explicitly cast args to uint32_t in MP_OBJ_FUN_MAKE_SIG.
For architectures where size_t is less than 32 bits (eg 16 bits) the args
must be casted to uint32_t so the left shift will work. For architectures
where size_t is greater than 32 bits (eg 64 bits) this new casting will not
lose any bits because the end result must anyway fit in a uint32_t.
Diffstat (limited to 'py/runtime.h')
-rw-r--r-- | py/runtime.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/py/runtime.h b/py/runtime.h index 57df959d9..dd4c9a984 100644 --- a/py/runtime.h +++ b/py/runtime.h @@ -79,7 +79,7 @@ int mp_print_mp_int(const mp_print_t *print, mp_obj_t x, int base, int base_char void mp_arg_check_num_sig(size_t n_args, size_t n_kw, uint32_t sig); static inline void mp_arg_check_num(size_t n_args, size_t n_kw, size_t n_args_min, size_t n_args_max, bool takes_kw) { - mp_arg_check_num_sig(n_args, n_kw, (uint32_t)MP_OBJ_FUN_MAKE_SIG(n_args_min, n_args_max, takes_kw)); + mp_arg_check_num_sig(n_args, n_kw, MP_OBJ_FUN_MAKE_SIG(n_args_min, n_args_max, takes_kw)); } void mp_arg_parse_all(size_t n_pos, const mp_obj_t *pos, mp_map_t *kws, size_t n_allowed, const mp_arg_t *allowed, mp_arg_val_t *out_vals); void mp_arg_parse_all_kw_array(size_t n_pos, size_t n_kw, const mp_obj_t *args, size_t n_allowed, const mp_arg_t *allowed, mp_arg_val_t *out_vals); |