Skip to content

Commit 46b5ed3

Browse files
committed
Rename mp_type_unary_op -> mp_type_get_unary_op_slot
1 parent ec53a67 commit 46b5ed3

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

py/obj.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ bool PLACE_IN_ITCM(mp_obj_is_true)(mp_obj_t arg) {
201201
}
202202
} else {
203203
const mp_obj_type_t *type = mp_obj_get_type(arg);
204-
mp_unary_op_fun_t unary_op = mp_type_unary_op(type);
204+
mp_unary_op_fun_t unary_op = mp_type_get_unary_op_slot(type);
205205
if (unary_op) {
206206
mp_obj_t result = unary_op(MP_UNARY_OP_BOOL, arg);
207207
if (result != MP_OBJ_NULL) {
@@ -564,7 +564,7 @@ mp_obj_t mp_obj_len_maybe(mp_obj_t o_in) {
564564
return MP_OBJ_NEW_SMALL_INT(l);
565565
} else {
566566
const mp_obj_type_t *type = mp_obj_get_type(o_in);
567-
mp_unary_op_fun_t unary_op = mp_type_unary_op(type);
567+
mp_unary_op_fun_t unary_op = mp_type_get_unary_op_slot(type);
568568
if (unary_op != NULL) {
569569
return unary_op(MP_UNARY_OP_LEN, o_in);
570570
} else {
@@ -685,7 +685,7 @@ mp_call_fun_t mp_type_get_call_slot(const mp_obj_type_t *type) {
685685
return type->ext[0].call;
686686
}
687687

688-
mp_unary_op_fun_t mp_type_unary_op(const mp_obj_type_t *type) {
688+
mp_unary_op_fun_t mp_type_get_unary_op_slot(const mp_obj_type_t *type) {
689689
if (!(type->flags & MP_TYPE_FLAG_EXTENDED)) {
690690
return NULL;
691691
}

py/obj.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -663,7 +663,7 @@ struct _mp_obj_full_type_t {
663663
#define MP_TYPE_GET_BUFFER ext[0].buffer_p.get_buffer
664664
#define MP_TYPE_PROTOCOL ext[0].protocol
665665
extern mp_call_fun_t mp_type_get_call_slot(const mp_obj_type_t *);
666-
extern mp_unary_op_fun_t mp_type_unary_op(const mp_obj_type_t *);
666+
extern mp_unary_op_fun_t mp_type_get_unary_op_slot(const mp_obj_type_t *);
667667
extern mp_binary_op_fun_t mp_type_binary_op(const mp_obj_type_t *);
668668
extern mp_subscr_fun_t mp_type_subscr(const mp_obj_type_t *);
669669
extern mp_getiter_fun_t mp_type_getiter(const mp_obj_type_t *);

py/runtime.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ mp_obj_t mp_unary_op(mp_unary_op_t op, mp_obj_t arg) {
282282
return MP_OBJ_NEW_SMALL_INT(h);
283283
} else {
284284
const mp_obj_type_t *type = mp_obj_get_type(arg);
285-
mp_unary_op_fun_t unary_op = mp_type_unary_op(type);
285+
mp_unary_op_fun_t unary_op = mp_type_get_unary_op_slot(type);
286286
if (unary_op != NULL) {
287287
mp_obj_t result = unary_op(op, arg);
288288
if (result != MP_OBJ_NULL) {

0 commit comments

Comments
 (0)