display/vmware_vga: Fix bad printf format specifiers
PATCH 1/1 display/vmware_vga: Fix bad printf format specifiers
We should use printf format specifier "%u" instead of "%d" for argument of type "unsigned int".
--- hw/display/vmware_vga.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
hw/display/vmware_vga.c +1 -1
@@ -534,7 +534,7 @@ static inline void vmsvga_cursor_define(struct vmsvga_state_s *s,#endif break ;default : -fprintf (stderr,"%s: unhandled bpp %d, using fallback cursor\n" , +fprintf (stderr,"%s: unhandled bpp %u, using fallback cursor\n" , __func__, c->bpp);cursor_put (qc); qc =cursor_builtin_left_ptr ();
Signature · 1 line
2.19.1
Hi Alex,
Quoted 14 lines · Alex Chen
We should use printf format specifier "%u" instead of "%d" for argument of type "unsigned int".
Reported-by Euler Robot <[email protected]>Signed-off-by Alex Chen <[email protected]>--- hw/display/vmware_vga.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)hw/display/vmware_vga.c +0
-0
hw/display/vmware_vga.c static inline void vmsvga_cursor_define(struct vmsvga_state_s *s, · line 538
Quoted 6 lines
hw/display/vmware_vga.c +1
-1@@ -534,7 +534,7 @@ static inline void vmsvga_cursor_define(struct vmsvga_state_s *s,#endif break ;default : -fprintf (stderr,"%s: unhandled bpp %d, using fallback cursor\n" , +fprintf (stderr,"%s: unhandled bpp %u, using fallback cursor\n" , __func__, c->bpp);
The format fix is correct, but since you change that line, "fprintf(stderr)" is old code, nowadays we prefer get rid of it by using warn_report() in place (see "qemu/error-report.h").
Preferably using warn_report():
Quoted 3 lines
hw/display/vmware_vga.c +0
-0cursor_put (qc); qc =cursor_builtin_left_ptr ();
Hi Philippe,
Quoted 12 lines · Philippe Mathieu-Daudé
Hi Alex,
Quoted 9 lines · Alex Chen
We should use printf format specifier "%u" instead of "%d" for argument of type "unsigned int".
Reported-by Euler Robot <[email protected]>Signed-off-by Alex Chen <[email protected]>--- hw/display/vmware_vga.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 16 lines
hw/display/vmware_vga.c static inline void vmsvga_cursor_define(struct vmsvga_state_s *s, · line 538
Quoted 11 lines
hw/display/vmware_vga.c +1
-1@@ -534,7 +534,7 @@ static inline void vmsvga_cursor_define(struct vmsvga_state_s *s,#endif break ;default : -fprintf (stderr,"%s: unhandled bpp %d, using fallback cursor\n" , +fprintf (stderr,"%s: unhandled bpp %u, using fallback cursor\n" , __func__, c->bpp);The format fix is correct, but since you change that line, "fprintf(stderr)" is old code, nowadays we prefer get rid of it by using
warn_report()in place (see "qemu/error-report.h").
Thanks for your review, since fprintf() is used elsewhere in vmware_vga.c, I will send a new patch to replace all fprintf() with warn_report() in vmware_vga.c. In addition, is there better to use error_report() instead of warn_report() here?
Thanks,
Alex