]> git.proxmox.com Git - qemu.git/commitdiff
Cocoa: Silence type warning
authorAndreas Färber <andreas.faerber@web.de>
Sun, 13 Dec 2009 00:16:27 +0000 (01:16 +0100)
committermalc <av1474@comtv.ru>
Thu, 7 Jan 2010 07:57:33 +0000 (10:57 +0300)
Add const for "qemu" character literal, to avoid:

warning: initialization discards qualifiers from pointer target type

An earlier patch by John proposed to use char[5]. Since we do not modify
the text and later copy it into malloc'ed memory, marking it as const
seems sufficient.

Signed-off-by: Andreas Färber <andreas.faerber@web.de>
Cc: John Arbuckle <programmingkidx@gmail.com>
Signed-off-by: malc <av1474@comtv.ru>
cocoa.m

diff --git a/cocoa.m b/cocoa.m
index f8c2e009a9a920620029f7167147da3c1de69bf9..0a95c7795d2ea18513a2f0dd8b65de26b8125baf 100644 (file)
--- a/cocoa.m
+++ b/cocoa.m
@@ -791,7 +791,7 @@ static 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 );