From 58321dd9854d71a96e5db2d361e0efc05d9de8cf Mon Sep 17 00:00:00 2001 From: Damien George Date: Tue, 29 Aug 2017 13:04:01 +1000 Subject: 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. --- py/objtuple.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'py/objtuple.c') diff --git a/py/objtuple.c b/py/objtuple.c index 765edb907c..079b5cbdb7 100644 --- a/py/objtuple.c +++ b/py/objtuple.c @@ -118,7 +118,7 @@ STATIC bool tuple_cmp_helper(mp_uint_t op, mp_obj_t self_in, mp_obj_t another_in return mp_seq_cmp_objs(op, self->items, self->len, another->items, another->len); } -mp_obj_t mp_obj_tuple_unary_op(mp_uint_t op, mp_obj_t self_in) { +mp_obj_t mp_obj_tuple_unary_op(mp_unary_op_t op, mp_obj_t self_in) { mp_obj_tuple_t *self = MP_OBJ_TO_PTR(self_in); switch (op) { case MP_UNARY_OP_BOOL: return mp_obj_new_bool(self->len != 0); @@ -135,7 +135,7 @@ mp_obj_t mp_obj_tuple_unary_op(mp_uint_t op, mp_obj_t self_in) { } } -mp_obj_t mp_obj_tuple_binary_op(mp_uint_t op, mp_obj_t lhs, mp_obj_t rhs) { +mp_obj_t mp_obj_tuple_binary_op(mp_binary_op_t op, mp_obj_t lhs, mp_obj_t rhs) { mp_obj_tuple_t *o = MP_OBJ_TO_PTR(lhs); switch (op) { case MP_BINARY_OP_ADD: -- cgit v1.2.3