1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-04-07 18:30:55 +03:00

0026669: Eliminate compile warnings obtained by building occt with vc14: 'type cast': conversion from 'BOOL' to 'WNDPROC' of greater size

Signature of the command window callback has been fixed to avoid unnecessary type casting. It is used when Draw_IsConsoleSubsystem = Standard_False
 i.e. in non-console mode (see _main_() in Draw_Main.cxx).
This commit is contained in:
rkv 2015-10-06 16:43:47 +03:00 committed by bugmaster
parent 5a9487c4ce
commit 839b8d3cdf
3 changed files with 9 additions and 9 deletions

View File

@ -31,7 +31,7 @@
LRESULT APIENTRY WndProc(HWND, UINT, WPARAM, LPARAM); LRESULT APIENTRY WndProc(HWND, UINT, WPARAM, LPARAM);
BOOL CreateProc(HWND); BOOL CreateProc(HWND);
VOID DestroyProc(HWND); VOID DestroyProc(HWND);
BOOL CommandProc(HWND, WPARAM, LPARAM); LRESULT APIENTRY CmdProc(HWND, UINT, WPARAM, LPARAM);
#endif #endif

View File

@ -49,7 +49,7 @@ LRESULT APIENTRY WndProc(HWND hWndFrame, UINT wMsg, WPARAM wParam, LPARAM lParam
break; break;
case WM_COMMAND : case WM_COMMAND :
CommandProc(hWndFrame, wParam, lParam); CmdProc(hWndFrame, LOWORD(wParam), wParam, lParam);
break; break;
case WM_DESTROY : case WM_DESTROY :
@ -85,13 +85,14 @@ BOOL CreateProc(HWND hWndFrame)
/*--------------------------------------------------------------------------*\ /*--------------------------------------------------------------------------*\
| COMMAND PROCEDURE | COMMAND PROCEDURE
| Handler for message WM_COMMAND | Handler for message WM_COMMAND
| | It is used when Draw_IsConsoleSubsystem = Standard_False
| i.e. in non-console mode (see _main_() in Draw_Main.cxx).
\*--------------------------------------------------------------------------*/ \*--------------------------------------------------------------------------*/
BOOL CommandProc(HWND hWndFrame, WPARAM wParam, LPARAM /*lParam*/) LRESULT APIENTRY CmdProc(HWND hWndFrame, UINT wMsg, WPARAM /*wParam*/, LPARAM /*lParam*/)
{ {
// Handle on window MDI // Handle on window MDI
HWND hWndClient = (HWND)GetWindowLongPtr (hWndFrame, CLIENTWND); HWND hWndClient = (HWND)GetWindowLongPtr (hWndFrame, CLIENTWND);
switch (LOWORD(wParam)) switch (wMsg)
{ {
case IDM_WINDOW_NEXT : case IDM_WINDOW_NEXT :
if(hWndClient) if(hWndClient)
@ -123,7 +124,7 @@ BOOL CommandProc(HWND hWndFrame, WPARAM wParam, LPARAM /*lParam*/)
DestroyProc(hWndFrame); DestroyProc(hWndFrame);
break; break;
} }
return(TRUE); return(0l);
} }

View File

@ -76,8 +76,7 @@ BOOL RegisterAppClass(HINSTANCE hInstance)
// Enregistrement de la fenetre CommandWindow // Enregistrement de la fenetre CommandWindow
//------ //------
wndClass.lpfnWndProc = (WNDPROC)CommandProc((HWND)WndProc,(WPARAM)342,(LPARAM)443); wndClass.lpfnWndProc = (WNDPROC)CmdProc;
//wndClass.lpfnWndProc = (WNDPROC)CommandProc;
wndClass.hIcon = 0; wndClass.hIcon = 0;
wndClass.hbrBackground = (HBRUSH)GetStockObject(WHITE_BRUSH); wndClass.hbrBackground = (HBRUSH)GetStockObject(WHITE_BRUSH);
wndClass.lpszMenuName = NULL; wndClass.lpszMenuName = NULL;