From 46b5ed33ed86b93bfbabdc1cf81609740def9bfe Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Mon, 12 Jul 2021 07:03:50 -0500 Subject: [PATCH] Rename mp_type_unary_op -> mp_type_get_unary_op_slot --- py/obj.c | 6 +++--- py/obj.h | 2 +- py/runtime.c | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/py/obj.c b/py/obj.c index 15cb2b9f54..854e9a4f7a 100644 --- a/py/obj.c +++ b/py/obj.c @@ -201,7 +201,7 @@ bool PLACE_IN_ITCM(mp_obj_is_true)(mp_obj_t arg) { } } else { const mp_obj_type_t *type = mp_obj_get_type(arg); - mp_unary_op_fun_t unary_op = mp_type_unary_op(type); + mp_unary_op_fun_t unary_op = mp_type_get_unary_op_slot(type); if (unary_op) { mp_obj_t result = unary_op(MP_UNARY_OP_BOOL, arg); if (result != MP_OBJ_NULL) { @@ -564,7 +564,7 @@ mp_obj_t mp_obj_len_maybe(mp_obj_t o_in) { return MP_OBJ_NEW_SMALL_INT(l); } else { const mp_obj_type_t *type = mp_obj_get_type(o_in); - mp_unary_op_fun_t unary_op = mp_type_unary_op(type); + mp_unary_op_fun_t unary_op = mp_type_get_unary_op_slot(type); if (unary_op != NULL) { return unary_op(MP_UNARY_OP_LEN, o_in); } else { @@ -685,7 +685,7 @@ mp_call_fun_t mp_type_get_call_slot(const mp_obj_type_t *type) { return type->ext[0].call; } -mp_unary_op_fun_t mp_type_unary_op(const mp_obj_type_t *type) { +mp_unary_op_fun_t mp_type_get_unary_op_slot(const mp_obj_type_t *type) { if (!(type->flags & MP_TYPE_FLAG_EXTENDED)) { return NULL; } diff --git a/py/obj.h b/py/obj.h index 8555da051e..234e776f0c 100644 --- a/py/obj.h +++ b/py/obj.h @@ -663,7 +663,7 @@ struct _mp_obj_full_type_t { #define MP_TYPE_GET_BUFFER ext[0].buffer_p.get_buffer #define MP_TYPE_PROTOCOL ext[0].protocol extern mp_call_fun_t mp_type_get_call_slot(const mp_obj_type_t *); -extern mp_unary_op_fun_t mp_type_unary_op(const mp_obj_type_t *); +extern mp_unary_op_fun_t mp_type_get_unary_op_slot(const mp_obj_type_t *); extern mp_binary_op_fun_t mp_type_binary_op(const mp_obj_type_t *); extern mp_subscr_fun_t mp_type_subscr(const mp_obj_type_t *); extern mp_getiter_fun_t mp_type_getiter(const mp_obj_type_t *); diff --git a/py/runtime.c b/py/runtime.c index 6aeb0797df..6c8c4e5fb5 100644 --- a/py/runtime.c +++ b/py/runtime.c @@ -282,7 +282,7 @@ mp_obj_t mp_unary_op(mp_unary_op_t op, mp_obj_t arg) { return MP_OBJ_NEW_SMALL_INT(h); } else { const mp_obj_type_t *type = mp_obj_get_type(arg); - mp_unary_op_fun_t unary_op = mp_type_unary_op(type); + mp_unary_op_fun_t unary_op = mp_type_get_unary_op_slot(type); if (unary_op != NULL) { mp_obj_t result = unary_op(op, arg); if (result != MP_OBJ_NULL) {