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>
This commit is contained in:
Akihiko Odaki 2021-02-23 22:11:06 +09:00 committed by Gerd Hoffmann
parent bc6a3565c8
commit 4313739a57

View File

@ -270,7 +270,7 @@ const int mac_to_qkeycode_map[] = {
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 @@ QemuCocoaView *cocoaView;
// 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 @@ QemuCocoaView *cocoaView;
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];