Rename mp_type_protocol -> mp_type_get_protocol_slot
This commit is contained in:
parent
1b2da0cda3
commit
75e995f372
2
py/obj.c
2
py/obj.c
@ -738,7 +738,7 @@ mp_getbuffer_fun_t mp_type_get_getbuffer_slot(const mp_obj_type_t *type) {
|
||||
}
|
||||
|
||||
|
||||
const void *mp_type_protocol(const mp_obj_type_t *type) {
|
||||
const void *mp_type_get_protocol_slot(const mp_obj_type_t *type) {
|
||||
if (!(type->flags & MP_TYPE_FLAG_EXTENDED)) {
|
||||
return NULL;
|
||||
}
|
||||
|
2
py/obj.h
2
py/obj.h
@ -669,7 +669,7 @@ extern mp_subscr_fun_t mp_type_get_subscr_slot(const mp_obj_type_t *);
|
||||
extern mp_getiter_fun_t mp_type_get_getiter_slot(const mp_obj_type_t *);
|
||||
extern mp_fun_1_t mp_type_get_iternext_slot(const mp_obj_type_t *);
|
||||
extern mp_getbuffer_fun_t mp_type_get_getbuffer_slot(const mp_obj_type_t *);
|
||||
extern const void *mp_type_protocol(const mp_obj_type_t *);
|
||||
extern const void *mp_type_get_protocol_slot(const mp_obj_type_t *);
|
||||
|
||||
// These fields ended up not being placed in the extended area, but accessors
|
||||
// were created for them anyway.
|
||||
|
@ -1216,7 +1216,7 @@ mp_obj_t mp_obj_new_type(qstr name, mp_obj_t bases_tuple, mp_obj_t locals_dict)
|
||||
// abstract base class which would translate C-level protocol to
|
||||
// Python method calls, and any subclass inheriting from it will
|
||||
// support this feature.
|
||||
o->MP_TYPE_PROTOCOL = mp_type_protocol((mp_obj_type_t *)MP_OBJ_TO_PTR(bases_items[0]));
|
||||
o->MP_TYPE_PROTOCOL = mp_type_get_protocol_slot((mp_obj_type_t *)MP_OBJ_TO_PTR(bases_items[0]));
|
||||
|
||||
if (bases_len >= 2) {
|
||||
#if MICROPY_MULTIPLE_INHERITANCE
|
||||
|
@ -31,7 +31,7 @@
|
||||
#ifndef MICROPY_UNSAFE_PROTO
|
||||
const void *mp_proto_get(uint16_t name, mp_const_obj_t obj) {
|
||||
const mp_obj_type_t *type = mp_obj_get_type(obj);
|
||||
const void *protocol = mp_type_protocol(type);
|
||||
const void *protocol = mp_type_get_protocol_slot(type);
|
||||
if (!protocol) {
|
||||
return NULL;
|
||||
}
|
||||
|
@ -31,7 +31,7 @@
|
||||
#define MP_PROTOCOL_HEAD /* NOTHING */
|
||||
#define MP_PROTO_IMPLEMENT(name) /* NOTHING */
|
||||
static inline void *mp_proto_get(uint16_t name, mp_const_obj_type_t obj) {
|
||||
return mp_type_protocol(mp_obj_get_type(obj));
|
||||
return mp_type_get_protocol_slot(mp_obj_get_type(obj));
|
||||
}
|
||||
#else
|
||||
#define MP_PROTOCOL_HEAD \
|
||||
|
Loading…
x
Reference in New Issue
Block a user