Rename mp_type_attr -> mp_type_get_attr_slot

This commit is contained in:
Jeff Epler 2021-07-12 07:30:29 -05:00
parent 88434c53c7
commit 93c6d16d3c
3 changed files with 4 additions and 4 deletions

View File

@ -701,7 +701,7 @@ mp_binary_op_fun_t mp_type_get_binary_op_slot(const mp_obj_type_t *type) {
}
mp_attr_fun_t mp_type_attr(const mp_obj_type_t *type) {
mp_attr_fun_t mp_type_get_attr_slot(const mp_obj_type_t *type) {
return type->attr;
}

View File

@ -673,7 +673,7 @@ 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.
extern mp_attr_fun_t mp_type_attr(const mp_obj_type_t *);
extern mp_attr_fun_t mp_type_get_attr_slot(const mp_obj_type_t *);
extern const void *mp_type_get_parent_slot(const mp_obj_type_t *);
// Return the size of a type object, which can be one of two lengths depending whether it has

View File

@ -1118,7 +1118,7 @@ void mp_load_method_maybe(mp_obj_t obj, qstr attr, mp_obj_t *dest) {
dest[1] = obj;
return;
}
mp_attr_fun_t attr_fun = mp_type_attr(type);
mp_attr_fun_t attr_fun = mp_type_get_attr_slot(type);
if (attr_fun != NULL) {
// this type can do its own load, so call it
attr_fun(obj, attr, dest);
@ -1179,7 +1179,7 @@ void mp_load_method_protected(mp_obj_t obj, qstr attr, mp_obj_t *dest, bool catc
void mp_store_attr(mp_obj_t base, qstr attr, mp_obj_t value) {
DEBUG_OP_printf("store attr %p.%s <- %p\n", base, qstr_str(attr), value);
const mp_obj_type_t *type = mp_obj_get_type(base);
mp_attr_fun_t attr_fun = mp_type_attr(type);
mp_attr_fun_t attr_fun = mp_type_get_attr_slot(type);
if (attr_fun != NULL) {
mp_obj_t dest[2] = {MP_OBJ_SENTINEL, value};
attr_fun(base, attr, dest);