From patchwork Sun Dec 6 15:21:22 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [v3,3/3] Cocoa: Silence warnings Date: Sun, 06 Dec 2009 05:21:22 -0000 From: =?utf-8?q?Andreas_F=C3=A4rber_=3Candreas=2Efaerber=40web=2Ede=3E?= X-Patchwork-Id: 40426 Message-Id: <1260112882-1799-3-git-send-email-andreas.faerber@web.de> To: qemu-devel@nongnu.org Cc: John Arbuckle , Andreas Faerber , Mike Kronenberg Missing static for cocoa_keycode_to_qemu. Missing const for character constant. __LITTLE_ENDIAN__ is undefined on Big Endian host. MAC_OS_X_VERSION_10_4 is undefined on v10.3 and earlier. v3: - Silence warnings reported from Mac OS X v10.3.9 Signed-off-by: Andreas Faerber Cc: John Arbuckle Cc: Mike Kronenberg --- cocoa.m | 9 ++++++--- 1 files changed, 6 insertions(+), 3 deletions(-) diff --git a/cocoa.m b/cocoa.m index 989efd5..ae2fd86 100644 --- a/cocoa.m +++ b/cocoa.m @@ -28,6 +28,9 @@ #include "console.h" #include "sysemu.h" +#ifndef MAC_OS_X_VERSION_10_4 +#define MAC_OS_X_VERSION_10_4 1040 +#endif #ifndef MAC_OS_X_VERSION_10_5 #define MAC_OS_X_VERSION_10_5 1050 #endif @@ -233,7 +236,7 @@ int keymap[] = */ }; -int cocoa_keycode_to_qemu(int keycode) +static int cocoa_keycode_to_qemu(int keycode) { if((sizeof(keymap)/sizeof(int)) <= keycode) { @@ -319,7 +322,7 @@ int cocoa_keycode_to_qemu(int keycode) screen.bitsPerComponent, //bitsPerComponent screen.bitsPerPixel, //bitsPerPixel (screen.width * (screen.bitsPerComponent/2)), //bytesPerRow -#if __LITTLE_ENDIAN__ +#ifdef __LITTLE_ENDIAN__ CGColorSpaceCreateWithName(kCGColorSpaceGenericRGB), //colorspace for OS X >= 10.4 kCGBitmapByteOrder32Little | kCGImageAlphaNoneSkipFirst, #else @@ -791,7 +794,7 @@ int cocoa_keycode_to_qemu(int keycode) if(returnCode == NSCancelButton) { exit(0); } else if(returnCode == NSOKButton) { - char *bin = "qemu"; + const char *bin = "qemu"; char *img = (char*)[ [ sheet filename ] cStringUsingEncoding:NSASCIIStringEncoding]; char **argv = (char**)malloc( sizeof(char*)*3 );