Patchwork [3/3] Cocoa: Silence warnings

login
register
mail settings
Submitter Andreas Färber
Date Dec. 6, 2009, 4:57 a.m.
Message ID <1260075477-76209-4-git-send-email-andreas.faerber@web.de>
Download mbox | patch
Permalink /patch/40411/
State New
Headers show

Comments

Andreas Färber - Dec. 6, 2009, 4:57 a.m.
Missing static for cocoa_keycode_to_qemu.
Missing const for character constant.

__LITTLE_ENDIAN__ is undefined on Big Endian host.

Signed-off-by: Andreas Faerber <andreas.faerber@web.de>
Cc: John Arbuckle <programmingkidx@gmail.com>
---
 cocoa.m |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

Patch

diff --git a/cocoa.m b/cocoa.m
index 7062571..05f507d 100644
--- a/cocoa.m
+++ b/cocoa.m
@@ -229,7 +229,7 @@  int keymap[] =
 */
 };
 
-int cocoa_keycode_to_qemu(int keycode)
+static int cocoa_keycode_to_qemu(int keycode)
 {
     if((sizeof(keymap)/sizeof(int)) <= keycode)
     {
@@ -315,7 +315,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
@@ -783,7 +783,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 );