]> git.sesse.net Git - vlc/blobdiff - modules/control/globalhotkeys/win32.c
Win32 globalhotkeys: kill warnings
[vlc] / modules / control / globalhotkeys / win32.c
index 7bb8c749060d9bb31a16bf7be7cdf252473d0ce0..8e3aeafbf5b4b228e3556c7f4164a684d068e468 100644 (file)
@@ -168,14 +168,14 @@ static void *Thread( void *p_data )
             (LONG_PTR)p_intf );
 
     /* Registering of Hotkeys */
-    for( struct hotkey *p_hotkey = p_intf->p_libvlc->p_hotkeys;
+    for( const struct hotkey *p_hotkey = p_intf->p_libvlc->p_hotkeys;
             p_hotkey->psz_action != NULL;
             p_hotkey++ )
     {
         if( asprintf( &psz_hotkey, "global-%s", p_hotkey->psz_action ) < 0 )
             break;
 
-        i_key = config_GetInt( p_intf, psz_hotkey );
+        i_key = var_InheritInteger( p_intf, psz_hotkey );
 
         free( psz_hotkey );
 
@@ -187,6 +187,8 @@ static void *Thread( void *p_data )
 #define HANDLE( key ) case KEY_##key: i_vk = VK_##key; break
 #define HANDLE2( key, key2 ) case KEY_##key: i_vk = VK_##key2; break
 
+#define KEY_SPACE ' '
+
 #ifndef VK_VOLUME_DOWN
 #define VK_VOLUME_DOWN          0xAE
 #define VK_VOLUME_UP            0xAF
@@ -260,7 +262,7 @@ static void *Thread( void *p_data )
         DispatchMessage( &message );
 
     /* Unregistering of Hotkeys */
-    for( struct hotkey *p_hotkey = p_intf->p_libvlc->p_hotkeys;
+    for( const struct hotkey *p_hotkey = p_intf->p_libvlc->p_hotkeys;
             p_hotkey->psz_action != NULL;
             p_hotkey++ )
     {
@@ -292,9 +294,9 @@ LRESULT CALLBACK WMHOTKEYPROC( HWND hwnd, UINT uMsg, WPARAM wParam,
             {
                 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;
+                LONG_PTR ret = GetWindowLongPtr( hwnd, GWLP_USERDATA );
+                intf_thread_t *p_intf = (intf_thread_t*)ret;
+                const struct hotkey *p_hotkeys = p_intf->p_libvlc->p_hotkeys;
 
                 if( !GlobalGetAtomNameA(
                         wParam, psz_atomName, sizeof( psz_atomName ) ) )