Rename mp_type_getbuffer -> mp_type_get_getbuffer_slot
This commit is contained in:
parent
cdd879a3cc
commit
1b2da0cda3
@ -456,7 +456,7 @@ STATIC mp_obj_t ffifunc_call(mp_obj_t self_in, size_t n_args, size_t n_kw, const
|
||||
const char *s = mp_obj_str_get_str(a);
|
||||
values[i].ffi = (ffi_arg)(intptr_t)s;
|
||||
} else {
|
||||
mp_getbuffer_fun_t get_buffer = mp_type_getbuffer(((mp_obj_base_t *)MP_OBJ_TO_PTR(a))->type);
|
||||
mp_getbuffer_fun_t get_buffer = mp_type_get_getbuffer_slot(((mp_obj_base_t *)MP_OBJ_TO_PTR(a))->type);
|
||||
if (get_buffer != NULL) {
|
||||
mp_obj_base_t *o = (mp_obj_base_t *)MP_OBJ_TO_PTR(a);
|
||||
mp_buffer_info_t bufinfo;
|
||||
|
4
py/obj.c
4
py/obj.c
@ -652,7 +652,7 @@ mp_obj_t mp_obj_new_generic_iterator(mp_obj_t obj, mp_obj_iter_buf_t *iter_buf)
|
||||
|
||||
bool mp_get_buffer(mp_obj_t obj, mp_buffer_info_t *bufinfo, mp_uint_t flags) {
|
||||
const mp_obj_type_t *type = mp_obj_get_type(obj);
|
||||
const mp_getbuffer_fun_t get_buffer = mp_type_getbuffer(type);
|
||||
const mp_getbuffer_fun_t get_buffer = mp_type_get_getbuffer_slot(type);
|
||||
if (get_buffer == NULL) {
|
||||
return false;
|
||||
}
|
||||
@ -730,7 +730,7 @@ mp_fun_1_t mp_type_get_iternext_slot(const mp_obj_type_t *type) {
|
||||
}
|
||||
|
||||
|
||||
mp_getbuffer_fun_t mp_type_getbuffer(const mp_obj_type_t *type) {
|
||||
mp_getbuffer_fun_t mp_type_get_getbuffer_slot(const mp_obj_type_t *type) {
|
||||
if (!(type->flags & MP_TYPE_FLAG_EXTENDED)) {
|
||||
return NULL;
|
||||
}
|
||||
|
2
py/obj.h
2
py/obj.h
@ -668,7 +668,7 @@ extern mp_binary_op_fun_t mp_type_get_binary_op_slot(const mp_obj_type_t *);
|
||||
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_getbuffer(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 *);
|
||||
|
||||
// These fields ended up not being placed in the extended area, but accessors
|
||||
|
Loading…
x
Reference in New Issue
Block a user