diff mbox series

ui/cocoa: Replace fprintf with error_report

Message ID 20210223131106.21166-1-akihiko.odaki@gmail.com (mailing list archive)
State New, archived
Headers show
Series ui/cocoa: Replace fprintf with error_report | expand

Commit Message

Akihiko Odaki Feb. 23, 2021, 1:11 p.m. UTC
Signed-off-by: Akihiko Odaki <akihiko.odaki@gmail.com>
---
 ui/cocoa.m | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Comments

Philippe Mathieu-Daudé Feb. 23, 2021, 1:20 p.m. UTC | #1
On 2/23/21 2:11 PM, Akihiko Odaki wrote:
> Signed-off-by: Akihiko Odaki <akihiko.odaki@gmail.com>
> ---
>  ui/cocoa.m | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/ui/cocoa.m b/ui/cocoa.m
> index 0ef5fdf3b7a..900bc984733 100644
> --- a/ui/cocoa.m
> +++ b/ui/cocoa.m
> @@ -270,7 +270,7 @@ static bool bool_with_iothread_lock(BoolCodeBlock block)
>  static int cocoa_keycode_to_qemu(int keycode)
>  {
>      if (ARRAY_SIZE(mac_to_qkeycode_map) <= keycode) {
> -        fprintf(stderr, "(cocoa) warning unknown keycode 0x%x\n", keycode);
> +        error_report("(cocoa) warning unknown keycode 0x%x", keycode);
>          return 0;
>      }
>      return mac_to_qkeycode_map[keycode];
> @@ -1071,7 +1071,7 @@ - (id) init
>          // create a view and add it to the window
>          cocoaView = [[QemuCocoaView alloc] initWithFrame:NSMakeRect(0.0, 0.0, 640.0, 480.0)];
>          if(!cocoaView) {
> -            fprintf(stderr, "(cocoa) can't create a view\n");
> +            error_report("(cocoa) can't create a view");
>              exit(1);
>          }
>  
> @@ -1080,7 +1080,7 @@ - (id) init
>              styleMask:NSWindowStyleMaskTitled|NSWindowStyleMaskMiniaturizable|NSWindowStyleMaskClosable
>              backing:NSBackingStoreBuffered defer:NO];
>          if(!normalWindow) {
> -            fprintf(stderr, "(cocoa) can't create window\n");
> +            error_report("(cocoa) can't create window");
>              exit(1);
>          }
>          [normalWindow setAcceptsMouseMovedEvents:YES];
> 

Alistair did this 3 years ago:
https://www.mail-archive.com/qemu-devel@nongnu.org/msg484556.html
but it was never merged... so:
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Gerd Hoffmann Feb. 24, 2021, 1 p.m. UTC | #2
On Tue, Feb 23, 2021 at 10:11:06PM +0900, Akihiko Odaki wrote:
> Signed-off-by: Akihiko Odaki <akihiko.odaki@gmail.com>

Added to UI patch queue.

thanks,
  Gerd
diff mbox series

Patch

diff --git a/ui/cocoa.m b/ui/cocoa.m
index 0ef5fdf3b7a..900bc984733 100644
--- a/ui/cocoa.m
+++ b/ui/cocoa.m
@@ -270,7 +270,7 @@  static bool bool_with_iothread_lock(BoolCodeBlock block)
 static int cocoa_keycode_to_qemu(int keycode)
 {
     if (ARRAY_SIZE(mac_to_qkeycode_map) <= keycode) {
-        fprintf(stderr, "(cocoa) warning unknown keycode 0x%x\n", keycode);
+        error_report("(cocoa) warning unknown keycode 0x%x", keycode);
         return 0;
     }
     return mac_to_qkeycode_map[keycode];
@@ -1071,7 +1071,7 @@  - (id) init
         // create a view and add it to the window
         cocoaView = [[QemuCocoaView alloc] initWithFrame:NSMakeRect(0.0, 0.0, 640.0, 480.0)];
         if(!cocoaView) {
-            fprintf(stderr, "(cocoa) can't create a view\n");
+            error_report("(cocoa) can't create a view");
             exit(1);
         }
 
@@ -1080,7 +1080,7 @@  - (id) init
             styleMask:NSWindowStyleMaskTitled|NSWindowStyleMaskMiniaturizable|NSWindowStyleMaskClosable
             backing:NSBackingStoreBuffered defer:NO];
         if(!normalWindow) {
-            fprintf(stderr, "(cocoa) can't create window\n");
+            error_report("(cocoa) can't create window");
             exit(1);
         }
         [normalWindow setAcceptsMouseMovedEvents:YES];