From 209de7b56d473f8358281a0617c649cc7f4dcc57 Mon Sep 17 00:00:00 2001 From: Shane Liesegang Date: Tue, 8 Oct 2013 10:42:17 -0400 Subject: [PATCH 1/2] Removing warnings when building Cocoa in 64-bit NSInteger is defined as the native integer width, so these changes remove implicit conversions that were causing precision warnings. --- src/cocoa_monitor.m | 4 ++-- src/cocoa_window.m | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/cocoa_monitor.m b/src/cocoa_monitor.m index 190c1cdf..e7aec2b1 100644 --- a/src/cocoa_monitor.m +++ b/src/cocoa_monitor.m @@ -97,8 +97,8 @@ static GLboolean modeIsGood(CGDisplayModeRef mode) static GLFWvidmode vidmodeFromCGDisplayMode(CGDisplayModeRef mode) { GLFWvidmode result; - result.width = CGDisplayModeGetWidth(mode); - result.height = CGDisplayModeGetHeight(mode); + result.width = (int) CGDisplayModeGetWidth(mode); + result.height = (int) CGDisplayModeGetHeight(mode); result.refreshRate = (int) CGDisplayModeGetRefreshRate(mode); CFStringRef format = CGDisplayModeCopyPixelEncoding(mode); diff --git a/src/cocoa_window.m b/src/cocoa_window.m index b1b324d7..6306e9cc 100644 --- a/src/cocoa_window.m +++ b/src/cocoa_window.m @@ -519,7 +519,7 @@ static int translateKey(unsigned int key) - (void)otherMouseDown:(NSEvent *)event { _glfwInputMouseClick(window, - [event buttonNumber], + (int) [event buttonNumber], GLFW_PRESS, translateFlags([event modifierFlags])); } @@ -532,7 +532,7 @@ static int translateKey(unsigned int key) - (void)otherMouseUp:(NSEvent *)event { _glfwInputMouseClick(window, - [event buttonNumber], + (int) [event buttonNumber], GLFW_RELEASE, translateFlags([event modifierFlags])); } From 9e0c07b7bacc7ada50762b672ed130a1a10537c3 Mon Sep 17 00:00:00 2001 From: Shane Liesegang Date: Tue, 8 Oct 2013 10:49:00 -0400 Subject: [PATCH 2/2] Fixing Xcode 5 warning Xcode 5 has gotten more pedantic about undeclared selectors, by default. --- src/cocoa_window.m | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/cocoa_window.m b/src/cocoa_window.m index 6306e9cc..0b89caa2 100644 --- a/src/cocoa_window.m +++ b/src/cocoa_window.m @@ -783,7 +783,8 @@ static void createMenuBar(void) // Prior to Snow Leopard, we need to use this oddly-named semi-private API // to get the application menu working properly. - [NSApp performSelector:@selector(setAppleMenu:) withObject:appMenu]; + SEL setAppleMenuSelector = NSSelectorFromString(@"setAppleMenu:"); + [NSApp performSelector:setAppleMenuSelector withObject:appMenu]; } #endif /* _GLFW_USE_MENUBAR */