mirror of
https://github.com/micropython/micropython.git
synced 2026-01-04 19:20:22 +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
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user