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:
@@ -209,7 +209,7 @@ void mp_delete_global(qstr qst) {
|
||||
mp_obj_dict_delete(MP_OBJ_FROM_PTR(mp_globals_get()), MP_OBJ_NEW_QSTR(qst));
|
||||
}
|
||||
|
||||
mp_obj_t mp_unary_op(mp_uint_t op, mp_obj_t arg) {
|
||||
mp_obj_t mp_unary_op(mp_unary_op_t op, mp_obj_t arg) {
|
||||
DEBUG_OP_printf("unary " UINT_FMT " %p\n", op, arg);
|
||||
|
||||
if (op == MP_UNARY_OP_NOT) {
|
||||
@@ -261,7 +261,7 @@ mp_obj_t mp_unary_op(mp_uint_t op, mp_obj_t arg) {
|
||||
}
|
||||
}
|
||||
|
||||
mp_obj_t mp_binary_op(mp_uint_t op, mp_obj_t lhs, mp_obj_t rhs) {
|
||||
mp_obj_t mp_binary_op(mp_binary_op_t op, mp_obj_t lhs, mp_obj_t rhs) {
|
||||
DEBUG_OP_printf("binary " UINT_FMT " %p %p\n", op, lhs, rhs);
|
||||
|
||||
// TODO correctly distinguish inplace operators for mutable objects
|
||||
|
||||
Reference in New Issue
Block a user