From 97d5c7a3d03dea649d933f6a3871217a5e8e5b53 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 2 Oct 2011 11:28:36 +0000 Subject: [PATCH] Fix harmless warnings in hot key code in wxOSX. Don't compare signed and unsigned variables if possible (insert a cast in one place where it wasn't). Put WXUNUSED() around the unused parameters. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@69283 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/osx/window_osx.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/osx/window_osx.cpp b/src/osx/window_osx.cpp index b5254d12d9..3fb5ca2ab6 100644 --- a/src/osx/window_osx.cpp +++ b/src/osx/window_osx.cpp @@ -2604,15 +2604,18 @@ bool wxWindowMac::IsShownOnScreen() const #if wxUSE_HOTKEY && wxOSX_USE_COCOA_OR_CARBON -OSStatus wxHotKeyHandler(EventHandlerCallRef nextHandler,EventRef event, void *userData) +OSStatus +wxHotKeyHandler(EventHandlerCallRef WXUNUSED(nextHandler), + EventRef event, + void* WXUNUSED(userData)) { EventHotKeyID hotKeyId; GetEventParameter( event, kEventParamDirectObject, typeEventHotKeyID, NULL, sizeof(hotKeyId), NULL, &hotKeyId); - for ( int i = 0; i < s_hotkeys.size(); ++i ) + for ( unsigned i = 0; i < s_hotkeys.size(); ++i ) { - if ( s_hotkeys[i].keyId == hotKeyId.id ) + if ( s_hotkeys[i].keyId == static_cast(hotKeyId.id) ) { unsigned char charCode ; UInt32 keyCode ; @@ -2641,7 +2644,7 @@ OSStatus wxHotKeyHandler(EventHandlerCallRef nextHandler,EventRef event, void *u bool wxWindowMac::RegisterHotKey(int hotkeyId, int modifiers, int keycode) { - for ( int i = 0; i < s_hotkeys.size(); ++i ) + for ( unsigned i = 0; i < s_hotkeys.size(); ++i ) { if ( s_hotkeys[i].keyId == hotkeyId ) { @@ -2700,7 +2703,7 @@ bool wxWindowMac::RegisterHotKey(int hotkeyId, int modifiers, int keycode) bool wxWindowMac::UnregisterHotKey(int hotkeyId) { - for ( int i = s_hotkeys.size()-1; i>=0; -- i ) + for ( unsigned i = s_hotkeys.size()-1; i>=0; -- i ) { if ( s_hotkeys[i].keyId == hotkeyId ) { -- 2.45.2