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

@@ -135,7 +135,7 @@ static void mp_help_print_obj(const mp_obj_t obj) {
// try to print something sensible about the given object
mp_print_str(MP_PYTHON_PRINTER, "object ");
mp_obj_print(obj, PRINT_STR);
mp_printf(MP_PYTHON_PRINTER, " is of type %q\n", type->name);
mp_printf(MP_PYTHON_PRINTER, " is of type %q\n", (qstr)type->name);
mp_map_t *map = NULL;
if (type == &mp_type_module) {