From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=51883 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OuQ6D-0007Lx-99 for qemu-devel@nongnu.org; Sat, 11 Sep 2010 09:26:34 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OuQ6C-00083x-6c for qemu-devel@nongnu.org; Sat, 11 Sep 2010 09:26:33 -0400 Received: from moutng.kundenserver.de ([212.227.17.8]:52244) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OuQ6B-00083b-N9 for qemu-devel@nongnu.org; Sat, 11 Sep 2010 09:26:32 -0400 Message-ID: <4C8B8383.4010503@mail.berlios.de> Date: Sat, 11 Sep 2010 15:26:27 +0200 From: Stefan Weil MIME-Version: 1.0 Subject: Re: [Qemu-devel] [PATCH] Cocoa: Avoid missing prototype warnings for qemu_main References: <1284198955-11234-1-git-send-email-andreas.faerber@web.de> In-Reply-To: <1284198955-11234-1-git-send-email-andreas.faerber@web.de> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: =?UTF-8?B?QW5kcmVhcyBGw6RyYmVy?= Cc: qemu-devel@nongnu.org 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 > --- > 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); > } > } > >