]> git.sesse.net Git - vlc/commitdiff
Global Hotkeys: simplify and clean code
authorJean-Baptiste Kempf <jb@videolan.org>
Wed, 19 Aug 2009 21:38:53 +0000 (23:38 +0200)
committerJean-Baptiste Kempf <jb@videolan.org>
Wed, 19 Aug 2009 21:43:13 +0000 (23:43 +0200)
modules/control/globalhotkeys/win32.c

index 161a051e9a327eb25a251e670c95d5921c66ab7f..7bb8c749060d9bb31a16bf7be7cdf252473d0ce0 100644 (file)
@@ -290,19 +290,18 @@ LRESULT CALLBACK WMHOTKEYPROC( HWND hwnd, UINT uMsg, WPARAM wParam,
     {
         case WM_HOTKEY:
             {
-                int i;
                 char psz_atomName[40];
 
                 intf_thread_t *p_intf =
                     (intf_thread_t*)GetWindowLongPtr( hwnd, GWLP_USERDATA );
                 struct hotkey *p_hotkeys = p_intf->p_libvlc->p_hotkeys;
 
-                i = GlobalGetAtomNameA(
-                        wParam, psz_atomName, sizeof( psz_atomName ) );
-                if( !i ) return 0;
+                if( !GlobalGetAtomNameA(
+                        wParam, psz_atomName, sizeof( psz_atomName ) ) )
+                    return 0;
 
                 /* search for key associated with VLC */
-                for( i = 0; p_hotkeys[i].psz_action != NULL; i++ )
+                for( int i = 0; p_hotkeys[i].psz_action != NULL; i++ )
                 {
                     if( strcmp( p_hotkeys[i].psz_action, psz_atomName ) )
                         continue;