[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] Minor fixes to OS X.
From: |
C.W. Betts |
Subject: |
[Qemu-devel] Minor fixes to OS X. |
Date: |
Tue, 26 Mar 2013 16:18:21 -0600 |
This patch contains minor fixes for the Cocoa UI.
From c36f0f8e4602fe014a3a383d6bb181401e72e8fe Mon Sep 17 00:00:00 2001
From: "C.W. Betts" <address@hidden>
Date: Sun, 24 Mar 2013 11:52:14 -0600
Subject: [PATCH 2/3] Minor Cocoa UI improvements. Use fileSystemRepresentation
to get a file name from an NSString. Define NSInteger on pre-Leopard systems,
and use it on -openPanelDidEnd:returnCode:contextInfo: so that it's
consistant with the signature requested in 64-bit code.
---
ui/cocoa.m | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/ui/cocoa.m b/ui/cocoa.m
index 048cc97..edd62be 100644
--- a/ui/cocoa.m
+++ b/ui/cocoa.m
@@ -68,6 +68,10 @@ static DisplayChangeListener *dcl;
int gArgc;
char **gArgv;
+#if (MAC_OS_X_VERSION_MAX_ALLOWED <= MAC_OS_X_VERSION_10_4)
+typedef int NSInteger;
+#endif
+
// keymap conversion
int keymap[] =
{
@@ -350,11 +354,7 @@ QemuCocoaView *cocoaView;
} else {
// selective drawing code (draws only dirty rectangles) (OS X >=
10.4)
const NSRect *rectList;
-#if (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5)
NSInteger rectCount;
-#else
- int rectCount;
-#endif
int i;
CGImageRef clipImageRef;
CGRect clipRect;
@@ -712,7 +712,7 @@ QemuCocoaView *cocoaView;
{
}
- (void)startEmulationWithArgc:(int)argc argv:(char**)argv;
-- (void)openPanelDidEnd:(NSOpenPanel *)sheet returnCode:(int)returnCode
contextInfo:(void *)contextInfo;
+- (void)openPanelDidEnd:(NSOpenPanel *)sheet returnCode:(NSInteger)returnCode
contextInfo:(void *)contextInfo;
- (void)toggleFullScreen:(id)sender;
- (void)showQEMUDoc:(id)sender;
- (void)showQEMUTec:(id)sender;
@@ -802,7 +802,7 @@ QemuCocoaView *cocoaView;
exit(status);
}
-- (void)openPanelDidEnd:(NSOpenPanel *)sheet returnCode:(int)returnCode
contextInfo:(void *)contextInfo
+- (void)openPanelDidEnd:(NSOpenPanel *)sheet returnCode:(NSInteger)returnCode
contextInfo:(void *)contextInfo
{
COCOA_DEBUG("QemuCocoaAppController: openPanelDidEnd\n");
@@ -810,7 +810,7 @@ QemuCocoaView *cocoaView;
exit(0);
} else if(returnCode == NSOKButton) {
const char *bin = "qemu";
- char *img = (char*)[ [ sheet filename ]
cStringUsingEncoding:NSASCIIStringEncoding];
+ char *img = (char*)[ [ sheet filename ] fileSystemRepresentation];
char **argv = (char**)malloc( sizeof(char*)*3 );
--
1.8.2
- [Qemu-devel] Minor fixes to OS X.,
C.W. Betts <=