ui/cocoa: Replace fprintf with error_report
Signed-off-by: Akihiko Odaki <akihiko.odaki@gmail.com>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Message-Id: <20210223131106.21166-1-akihiko.odaki@gmail.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
diff --git a/ui/cocoa.m b/ui/cocoa.m
index 6a59f87..f27beb3 100644
--- a/ui/cocoa.m
+++ b/ui/cocoa.m
@@ -270,7 +270,7 @@
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];
@@ -1060,7 +1060,7 @@
// 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);
}
@@ -1069,7 +1069,7 @@
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];