all: Convert mp_uint_t to mp_unary_op_t/mp_binary_op_t where appropriate

The unary-op/binary-op enums are already defined, and there are no
arithmetic tricks used with these types, so it makes sense to use the
correct enum type for arguments that take these values.  It also reduces
code size quite a bit for nan-boxing builds.
This commit is contained in:
Damien George
2017-08-29 13:04:01 +10:00
parent be8e5744e6
commit 58321dd985
25 changed files with 54 additions and 52 deletions

View File

@@ -505,7 +505,7 @@ void mp_get_buffer_raise(mp_obj_t obj, mp_buffer_info_t *bufinfo, mp_uint_t flag
}
}
mp_obj_t mp_generic_unary_op(mp_uint_t op, mp_obj_t o_in) {
mp_obj_t mp_generic_unary_op(mp_unary_op_t op, mp_obj_t o_in) {
switch (op) {
case MP_UNARY_OP_HASH: return MP_OBJ_NEW_SMALL_INT((mp_uint_t)o_in);
default: return MP_OBJ_NULL; // op not supported