* [Qemu-devel] [PATCH] Cocoa: Avoid missing prototype warnings for qemu_main
@ 2010-09-11 9:55 Andreas Färber
2010-09-11 13:26 ` Stefan Weil
2010-09-19 9:36 ` Andreas Färber
0 siblings, 2 replies; 4+ messages in thread
From: Andreas Färber @ 2010-09-11 9:55 UTC (permalink / raw)
To: qemu-devel; +Cc: Andreas Färber
In vl.c main is redefined to qemu_main but no prototype is available.
Move it into qemu-common.h since it is needed in ui/cocoa.m, too.
Adjust the call sites to the signature used in vl.c.
Signed-off-by: Andreas Färber <andreas.faerber@web.de>
---
qemu-common.h | 4 ++++
ui/cocoa.m | 5 ++---
2 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/qemu-common.h b/qemu-common.h
index dfd3dc0..f8ce3ce 100644
--- a/qemu-common.h
+++ b/qemu-common.h
@@ -13,6 +13,10 @@
#define QEMU_BUILD_BUG_ON(x) typedef char __build_bug_on__##__LINE__[(x)?-1:1];
+#ifdef CONFIG_COCOA
+int qemu_main(int argc, char** argv, char** envp);
+#endif
+
typedef struct QEMUTimer QEMUTimer;
typedef struct QEMUFile QEMUFile;
typedef struct QEMUBH QEMUBH;
diff --git a/ui/cocoa.m b/ui/cocoa.m
index 56c789a..d7deb0e 100644
--- a/ui/cocoa.m
+++ b/ui/cocoa.m
@@ -61,7 +61,6 @@ typedef struct {
int bitsPerPixel;
} QEMUScreen;
-int qemu_main(int argc, char **argv); // main defined in qemu/vl.c
NSWindow *normalWindow;
id cocoaView;
static DisplayChangeListener *dcl;
@@ -794,7 +793,7 @@ static int cocoa_keycode_to_qemu(int keycode)
COCOA_DEBUG("QemuCocoaAppController: startEmulationWithArgc\n");
int status;
- status = qemu_main(argc, argv);
+ status = qemu_main(argc, argv, NULL);
exit(status);
}
@@ -868,7 +867,7 @@ int main (int argc, const char * argv[]) {
if (!strcmp(argv[i], "-vnc") ||
!strcmp(argv[i], "-nographic") ||
!strcmp(argv[i], "-curses")) {
- return qemu_main(gArgc, gArgv);
+ return qemu_main(gArgc, gArgv, NULL);
}
}
--
1.7.0.4
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [Qemu-devel] [PATCH] Cocoa: Avoid missing prototype warnings for qemu_main
2010-09-11 9:55 [Qemu-devel] [PATCH] Cocoa: Avoid missing prototype warnings for qemu_main Andreas Färber
@ 2010-09-11 13:26 ` Stefan Weil
2010-09-11 14:20 ` Andreas Färber
2010-09-19 9:36 ` Andreas Färber
1 sibling, 1 reply; 4+ messages in thread
From: Stefan Weil @ 2010-09-11 13:26 UTC (permalink / raw)
To: Andreas Färber; +Cc: qemu-devel
Am 11.09.2010 11:55, schrieb Andreas Färber:
> In vl.c main is redefined to qemu_main but no prototype is available.
> Move it into qemu-common.h since it is needed in ui/cocoa.m, too.
> Adjust the call sites to the signature used in vl.c.
>
> Signed-off-by: Andreas Färber<andreas.faerber@web.de>
> ---
> qemu-common.h | 4 ++++
> ui/cocoa.m | 5 ++---
> 2 files changed, 6 insertions(+), 3 deletions(-)
>
> diff --git a/qemu-common.h b/qemu-common.h
> index dfd3dc0..f8ce3ce 100644
> --- a/qemu-common.h
> +++ b/qemu-common.h
> @@ -13,6 +13,10 @@
>
> #define QEMU_BUILD_BUG_ON(x) typedef char __build_bug_on__##__LINE__[(x)?-1:1];
>
> +#ifdef CONFIG_COCOA
> +int qemu_main(int argc, char** argv, char** envp);
> +#endif
> +
>
Is this conditional compilation needed here, or
could qemu_main be declared unconditionally?
> typedef struct QEMUTimer QEMUTimer;
> typedef struct QEMUFile QEMUFile;
> typedef struct QEMUBH QEMUBH;
> diff --git a/ui/cocoa.m b/ui/cocoa.m
> index 56c789a..d7deb0e 100644
> --- a/ui/cocoa.m
> +++ b/ui/cocoa.m
> @@ -61,7 +61,6 @@ typedef struct {
> int bitsPerPixel;
> } QEMUScreen;
>
> -int qemu_main(int argc, char **argv); // main defined in qemu/vl.c
> NSWindow *normalWindow;
> id cocoaView;
> static DisplayChangeListener *dcl;
> @@ -794,7 +793,7 @@ static int cocoa_keycode_to_qemu(int keycode)
> COCOA_DEBUG("QemuCocoaAppController: startEmulationWithArgc\n");
>
> int status;
> - status = qemu_main(argc, argv);
> + status = qemu_main(argc, argv, NULL);
> exit(status);
> }
>
> @@ -868,7 +867,7 @@ int main (int argc, const char * argv[]) {
> if (!strcmp(argv[i], "-vnc") ||
> !strcmp(argv[i], "-nographic") ||
> !strcmp(argv[i], "-curses")) {
> - return qemu_main(gArgc, gArgv);
> + return qemu_main(gArgc, gArgv, NULL);
> }
> }
>
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Qemu-devel] [PATCH] Cocoa: Avoid missing prototype warnings for qemu_main
2010-09-11 13:26 ` Stefan Weil
@ 2010-09-11 14:20 ` Andreas Färber
0 siblings, 0 replies; 4+ messages in thread
From: Andreas Färber @ 2010-09-11 14:20 UTC (permalink / raw)
To: Stefan Weil; +Cc: qemu-devel
Am 11.09.2010 um 15:26 schrieb Stefan Weil:
> Am 11.09.2010 11:55, schrieb Andreas Färber:
>> In vl.c main is redefined to qemu_main but no prototype is available.
>> Move it into qemu-common.h since it is needed in ui/cocoa.m, too.
>> Adjust the call sites to the signature used in vl.c.
>>
>> Signed-off-by: Andreas Färber<andreas.faerber@web.de>
>> diff --git a/qemu-common.h b/qemu-common.h
>> index dfd3dc0..f8ce3ce 100644
>> --- a/qemu-common.h
>> +++ b/qemu-common.h
>> @@ -13,6 +13,10 @@
>>
>> #define QEMU_BUILD_BUG_ON(x) typedef char
>> __build_bug_on__##__LINE__[(x)?-1:1];
>>
>> +#ifdef CONFIG_COCOA
>> +int qemu_main(int argc, char** argv, char** envp);
>> +#endif
>> +
>>
>
> Is this conditional compilation needed here, or
> could qemu_main be declared unconditionally?
There's another (identical) declaration for SDL, but SDL on Solaris
does not take that code path, so I couldn't test.
The tricky thing is that when CONFIG_SDL and (main or __APPLE__) is
defined, a new main() function is provided that already uses
qemu_main(), likely before qemu-common.h is included.
Anyway, generalizing it should be done in a follow-on patch imo, so
that the SDL part can be reverted independently.
Andreas
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Qemu-devel] [PATCH] Cocoa: Avoid missing prototype warnings for qemu_main
2010-09-11 9:55 [Qemu-devel] [PATCH] Cocoa: Avoid missing prototype warnings for qemu_main Andreas Färber
2010-09-11 13:26 ` Stefan Weil
@ 2010-09-19 9:36 ` Andreas Färber
1 sibling, 0 replies; 4+ messages in thread
From: Andreas Färber @ 2010-09-19 9:36 UTC (permalink / raw)
To: qemu-devel@nongnu.org Developers
Am 11.09.2010 um 11:55 schrieb Andreas Färber:
> In vl.c main is redefined to qemu_main but no prototype is available.
> Move it into qemu-common.h since it is needed in ui/cocoa.m, too.
> Adjust the call sites to the signature used in vl.c.
>
> Signed-off-by: Andreas Färber <andreas.faerber@web.de>
Ping? Should I issue a pull request for this?
Or might console.h be a better place for the prototype to live than
qemu-common.h?
Or does SDL need to be refactored at the same time? In that case I
would need suggestions and (Win32?) testers.
Regards,
Andreas
> ---
> qemu-common.h | 4 ++++
> ui/cocoa.m | 5 ++---
> 2 files changed, 6 insertions(+), 3 deletions(-)
>
> diff --git a/qemu-common.h b/qemu-common.h
> index dfd3dc0..f8ce3ce 100644
> --- a/qemu-common.h
> +++ b/qemu-common.h
> @@ -13,6 +13,10 @@
>
> #define QEMU_BUILD_BUG_ON(x) typedef char
> __build_bug_on__##__LINE__[(x)?-1:1];
>
> +#ifdef CONFIG_COCOA
> +int qemu_main(int argc, char** argv, char** envp);
> +#endif
> +
> typedef struct QEMUTimer QEMUTimer;
> typedef struct QEMUFile QEMUFile;
> typedef struct QEMUBH QEMUBH;
> diff --git a/ui/cocoa.m b/ui/cocoa.m
> index 56c789a..d7deb0e 100644
> --- a/ui/cocoa.m
> +++ b/ui/cocoa.m
> @@ -61,7 +61,6 @@ typedef struct {
> int bitsPerPixel;
> } QEMUScreen;
>
> -int qemu_main(int argc, char **argv); // main defined in qemu/vl.c
> NSWindow *normalWindow;
> id cocoaView;
> static DisplayChangeListener *dcl;
> @@ -794,7 +793,7 @@ static int cocoa_keycode_to_qemu(int keycode)
> COCOA_DEBUG("QemuCocoaAppController: startEmulationWithArgc\n");
>
> int status;
> - status = qemu_main(argc, argv);
> + status = qemu_main(argc, argv, NULL);
> exit(status);
> }
>
> @@ -868,7 +867,7 @@ int main (int argc, const char * argv[]) {
> if (!strcmp(argv[i], "-vnc") ||
> !strcmp(argv[i], "-nographic") ||
> !strcmp(argv[i], "-curses")) {
> - return qemu_main(gArgc, gArgv);
> + return qemu_main(gArgc, gArgv, NULL);
> }
> }
>
> --
> 1.7.0.4
>
>
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2010-09-19 9:37 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-09-11 9:55 [Qemu-devel] [PATCH] Cocoa: Avoid missing prototype warnings for qemu_main Andreas Färber
2010-09-11 13:26 ` Stefan Weil
2010-09-11 14:20 ` Andreas Färber
2010-09-19 9:36 ` Andreas Färber
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.