mirror of
https://github.com/micropython/micropython.git
synced 2026-01-06 20:20:14 +01:00
py: Cast type names to qstr explicitly.
The name field of type objects is of type `uint16_t` for efficiency, but when the type is passed to `mp_printf` it must be cast explicitly to type `qstr`. These locations were found using an experimental gcc plugin for `mp_printf` error checking, cross-building for x64 windows on Linux. Signed-off-by: Jeff Epler <jepler@gmail.com>
This commit is contained in:
committed by
Damien George
parent
7493275918
commit
519cba4d05
@@ -977,7 +977,7 @@ static bool check_for_special_accessors(mp_obj_t key, mp_obj_t value) {
|
||||
static void type_print(const mp_print_t *print, mp_obj_t self_in, mp_print_kind_t kind) {
|
||||
(void)kind;
|
||||
mp_obj_type_t *self = MP_OBJ_TO_PTR(self_in);
|
||||
mp_printf(print, "<class '%q'>", self->name);
|
||||
mp_printf(print, "<class '%q'>", (qstr)self->name);
|
||||
}
|
||||
|
||||
static mp_obj_t type_make_new(const mp_obj_type_t *type_in, size_t n_args, size_t n_kw, const mp_obj_t *args) {
|
||||
|
||||
Reference in New Issue
Block a user