[vlc-devel] commit: Global Hotkeys: simplify and clean code (Jean-Baptiste Kempf )

git version control git at videolan.org
Wed Aug 19 23:43:23 CEST 2009


vlc | branch: master | Jean-Baptiste Kempf <jb at videolan.org> | Wed Aug 19 23:38:53 2009 +0200| [fde883118b56e9ab1c4817cd8194b6ff8d147bd1] | committer: Jean-Baptiste Kempf 

Global Hotkeys: simplify and clean code

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=fde883118b56e9ab1c4817cd8194b6ff8d147bd1
---

 modules/control/globalhotkeys/win32.c |    9 ++++-----
 1 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/modules/control/globalhotkeys/win32.c b/modules/control/globalhotkeys/win32.c
index 161a051..7bb8c74 100644
--- a/modules/control/globalhotkeys/win32.c
+++ b/modules/control/globalhotkeys/win32.c
@@ -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;




More information about the vlc-devel mailing list