* [PATCH] ui/cocoa: Replace fprintf with error_report
@ 2021-02-23 13:11 Akihiko Odaki
2021-02-23 13:20 ` Philippe Mathieu-Daudé
2021-02-24 13:00 ` Gerd Hoffmann
0 siblings, 2 replies; 3+ messages in thread
From: Akihiko Odaki @ 2021-02-23 13:11 UTC (permalink / raw)
Cc: Peter Maydell, qemu-devel, Akihiko Odaki, Gerd Hoffmann
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];
--
2.24.3 (Apple Git-128)
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] ui/cocoa: Replace fprintf with error_report
2021-02-23 13:11 [PATCH] ui/cocoa: Replace fprintf with error_report Akihiko Odaki
@ 2021-02-23 13:20 ` Philippe Mathieu-Daudé
2021-02-24 13:00 ` Gerd Hoffmann
1 sibling, 0 replies; 3+ messages in thread
From: Philippe Mathieu-Daudé @ 2021-02-23 13:20 UTC (permalink / raw)
To: Akihiko Odaki, Alistair Francis; +Cc: Peter Maydell, qemu-devel, Gerd Hoffmann
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>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] ui/cocoa: Replace fprintf with error_report
2021-02-23 13:11 [PATCH] ui/cocoa: Replace fprintf with error_report Akihiko Odaki
2021-02-23 13:20 ` Philippe Mathieu-Daudé
@ 2021-02-24 13:00 ` Gerd Hoffmann
1 sibling, 0 replies; 3+ messages in thread
From: Gerd Hoffmann @ 2021-02-24 13:00 UTC (permalink / raw)
To: Akihiko Odaki; +Cc: Peter Maydell, qemu-devel
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
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2021-02-24 13:02 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-02-23 13:11 [PATCH] ui/cocoa: Replace fprintf with error_report Akihiko Odaki
2021-02-23 13:20 ` Philippe Mathieu-Daudé
2021-02-24 13:00 ` Gerd Hoffmann
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).