Skip to content

Commit 18a835e

Browse files
jeplerdpgeorge
authored andcommitted
examples/usercmodule: Cast arguments for printf.
These locations were found using an experimental gcc plugin for `mp_printf` error checking. Signed-off-by: Jeff Epler <[email protected]>
1 parent 338ca3b commit 18a835e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

examples/usercmodule/cexample/examplemodule.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,12 +86,12 @@ static void example_AdvancedTimer_print(const mp_print_t *print, mp_obj_t self_i
8686
mp_uint_t elapsed = mp_obj_get_int(example_Timer_time(self_in));
8787

8888
// We'll make all representations print at least the class name.
89-
mp_printf(print, "%q()", MP_QSTR_AdvancedTimer);
89+
mp_printf(print, "%q()", (qstr)MP_QSTR_AdvancedTimer);
9090

9191
// Decide what else to print based on print kind.
9292
if (kind == PRINT_STR) {
9393
// For __str__, let's attempt to make it more readable.
94-
mp_printf(print, " # created %d seconds ago", elapsed / 1000);
94+
mp_printf(print, " # created %d seconds ago", (int)(elapsed / 1000));
9595
}
9696
}
9797

0 commit comments

Comments
 (0)