[vlc-commits] [Git][videolan/vlc][master] win32: use the proper signature for lpfnWndProc callbacks

Steve Lhomme (@robUx4) gitlab at videolan.org
Tue Feb 28 15:37:54 UTC 2023



Steve Lhomme pushed to branch master at VideoLAN / VLC


Commits:
847fa924 by Steve Lhomme at 2023-02-28T15:10:02+00:00
win32: use the proper signature for lpfnWndProc callbacks

No need to cast for that.

- - - - -


3 changed files:

- modules/gui/skins2/win32/win32_factory.cpp
- modules/video_output/win32/events.c
- modules/video_output/win32/window.c


Changes:

=====================================
modules/gui/skins2/win32/win32_factory.cpp
=====================================
@@ -161,7 +161,7 @@ bool Win32Factory::init()
     // Create window class
     WNDCLASS skinWindowClass;
     skinWindowClass.style = CS_DBLCLKS;
-    skinWindowClass.lpfnWndProc = (WNDPROC)Win32Factory::Win32Proc;
+    skinWindowClass.lpfnWndProc = Win32Factory::Win32Proc;
     skinWindowClass.lpszClassName = vlc_class;
     skinWindowClass.lpszMenuName = NULL;
     skinWindowClass.cbClsExtra = 0;


=====================================
modules/video_output/win32/events.c
=====================================
@@ -230,8 +230,8 @@ void EventThreadStop( event_thread_t *p_event )
 /***********************************
  * Local functions implementations *
  ***********************************/
-static long FAR PASCAL VideoEventProc( HWND hwnd, UINT message,
-                                       WPARAM wParam, LPARAM lParam )
+static LRESULT CALLBACK VideoEventProc( HWND hwnd, UINT message,
+                                        WPARAM wParam, LPARAM lParam )
 {
     if( message == WM_CREATE )
     {
@@ -305,7 +305,7 @@ static int Win32VoutCreateWindow( event_thread_t *p_event )
 
     /* Fill in the window class structure */
     wc.style         = CS_OWNDC|CS_DBLCLKS;          /* style: dbl click */
-    wc.lpfnWndProc   = (WNDPROC)VideoEventProc;         /* event handler */
+    wc.lpfnWndProc   = VideoEventProc;                  /* event handler */
     wc.cbClsExtra    = 0;                         /* no extra class data */
     wc.cbWndExtra    = 0;                        /* no extra window data */
     wc.hInstance     = hInstance;                            /* instance */


=====================================
modules/video_output/win32/window.c
=====================================
@@ -400,8 +400,8 @@ static int Win32VoutConvertKey( int i_key )
  * Nonqueued Messages are those that Windows will send directly to this
  * procedure (like WM_DESTROY, WM_WINDOWPOSCHANGED...)
  *****************************************************************************/
-static long FAR PASCAL WinVoutEventProc( HWND hwnd, UINT message,
-                                         WPARAM wParam, LPARAM lParam )
+static LRESULT CALLBACK WinVoutEventProc( HWND hwnd, UINT message,
+                                          WPARAM wParam, LPARAM lParam )
 {
     if( message == WM_CREATE )
     {
@@ -816,7 +816,7 @@ static int Open(vlc_window_t *wnd)
     WNDCLASS wc = { 0 };
     /* Fill in the window class structure */
     wc.style         = CS_OWNDC|CS_DBLCLKS;           /* style: dbl click */
-    wc.lpfnWndProc   = (WNDPROC)WinVoutEventProc;        /* event handler */
+    wc.lpfnWndProc   = WinVoutEventProc;                 /* event handler */
     wc.hInstance     = hInstance;                             /* instance */
     wc.hIcon         = sys->vlc_icon;            /* load the vlc big icon */
     wc.lpszClassName = sys->class_main;            /* use a special class */



View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/847fa924a0ac822db0c43226703733f6cea23f21

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/847fa924a0ac822db0c43226703733f6cea23f21
You're receiving this email because of your account on code.videolan.org.


VideoLAN code repository instance


More information about the vlc-commits mailing list