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:
Jeff Epler
2025-06-21 15:37:35 +02:00
committed by Damien George
parent 7493275918
commit 519cba4d05
5 changed files with 5 additions and 5 deletions

View File

@@ -84,7 +84,7 @@ static void dict_print(const mp_print_t *print, mp_obj_t self_in, mp_print_kind_
#endif
}
if (MICROPY_PY_COLLECTIONS_ORDEREDDICT && self->base.type != &mp_type_dict && kind != PRINT_JSON) {
mp_printf(print, "%q(", self->base.type->name);
mp_printf(print, "%q(", (qstr)self->base.type->name);
}
mp_print_str(print, "{");
size_t cur = 0;