diff --git a/Source/diablo.cpp b/Source/diablo.cpp index ccdc90a0f..e2a757fad 100644 --- a/Source/diablo.cpp +++ b/Source/diablo.cpp @@ -564,7 +564,7 @@ static void GetMousePos(LPARAM lParam) MouseY = (short)((lParam >> 16) & 0xffff); } -LRESULT DisableInputWndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) +void DisableInputWndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) { switch (uMsg) { case DVL_WM_KEYDOWN: @@ -574,71 +574,71 @@ LRESULT DisableInputWndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) case DVL_WM_SYSCOMMAND: case DVL_WM_MOUSEMOVE: GetMousePos(lParam); - return 0; + return; case DVL_WM_LBUTTONDOWN: if (sgbMouseDown != 0) - return 0; + return; sgbMouseDown = 1; - return 0; + return; case DVL_WM_LBUTTONUP: if (sgbMouseDown != 1) - return 0; + return; sgbMouseDown = 0; - return 0; + return; case DVL_WM_RBUTTONDOWN: if (sgbMouseDown != 0) - return 0; + return; sgbMouseDown = 2; - return 0; + return; case DVL_WM_RBUTTONUP: if (sgbMouseDown != 2) - return 0; + return; sgbMouseDown = 0; - return 0; + return; case DVL_WM_CAPTURECHANGED: if (hWnd == (HWND)lParam) - return 0; + return; sgbMouseDown = 0; - return 0; + return; } - return MainWndProc(hWnd, uMsg, wParam, lParam); + MainWndProc(hWnd, uMsg, wParam, lParam); } -LRESULT GM_Game(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) +void GM_Game(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) { switch (uMsg) { case DVL_WM_KEYDOWN: PressKey(wParam); - return 0; + return; case DVL_WM_KEYUP: ReleaseKey(wParam); - return 0; + return; case DVL_WM_CHAR: PressChar(wParam); - return 0; + return; case DVL_WM_SYSKEYDOWN: if (PressSysKey(wParam)) - return 0; + return; break; case DVL_WM_SYSCOMMAND: if (wParam == DVL_SC_CLOSE) { gbRunGame = FALSE; gbRunGameResult = FALSE; - return 0; + return; } break; case DVL_WM_MOUSEMOVE: GetMousePos(lParam); gmenu_on_mouse_move(); - return 0; + return; case DVL_WM_LBUTTONDOWN: GetMousePos(lParam); if (sgbMouseDown == 0) { sgbMouseDown = 1; track_repeat_walk(LeftMouseDown(wParam)); } - return 0; + return; case DVL_WM_LBUTTONUP: GetMousePos(lParam); if (sgbMouseDown == 1) { @@ -646,20 +646,20 @@ LRESULT GM_Game(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) LeftMouseUp(); track_repeat_walk(FALSE); } - return 0; + return; case DVL_WM_RBUTTONDOWN: GetMousePos(lParam); if (sgbMouseDown == 0) { sgbMouseDown = 2; RightMouseDown(); } - return 0; + return; case DVL_WM_RBUTTONUP: GetMousePos(lParam); if (sgbMouseDown == 2) { sgbMouseDown = 0; } - return 0; + return; case DVL_WM_CAPTURECHANGED: if (hWnd != (HWND)lParam) { sgbMouseDown = 0; @@ -689,10 +689,10 @@ LRESULT GM_Game(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) PaletteFadeIn(8); nthread_ignore_mutex(FALSE); gbGameLoopStartup = TRUE; - return 0; + return; } - return MainWndProc(hWnd, uMsg, wParam, lParam); + MainWndProc(hWnd, uMsg, wParam, lParam); } BOOL LeftMouseDown(int wParam) diff --git a/Source/diablo.h b/Source/diablo.h index c320d49a5..5910be0c9 100644 --- a/Source/diablo.h +++ b/Source/diablo.h @@ -76,8 +76,8 @@ void diablo_init_screen(); void diablo_reload_process(HINSTANCE hInstance); void diablo_quit(int exitStatus); BOOL PressEscKey(); -LRESULT DisableInputWndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam); -LRESULT GM_Game(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam); +void DisableInputWndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam); +void GM_Game(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam); BOOL LeftMouseDown(int wParam); BOOL LeftMouseCmd(BOOL bShift); BOOL TryIconCurs(); diff --git a/Source/init.cpp b/Source/init.cpp index 520ad23e7..3052e6abc 100644 --- a/Source/init.cpp +++ b/Source/init.cpp @@ -171,7 +171,7 @@ void init_get_file_info() snprintf(gszVersionNumber, sizeof(gszVersionNumber) / sizeof(char), "version %s", PROJECT_VERSION); } -LRESULT MainWndProc(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam) +void MainWndProc(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam) { switch (Msg) { case DVL_WM_ERASEBKGND: diff --git a/Source/init.h b/Source/init.h index 1790f7dbf..a96537cfa 100644 --- a/Source/init.h +++ b/Source/init.h @@ -35,7 +35,7 @@ void init_disable_screensaver(BOOLEAN disable); void init_create_window(); void init_archives(); void init_get_file_info(); -LRESULT MainWndProc(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam); +void MainWndProc(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam); void init_activate_window(HWND hWnd, BOOL bActive); WNDPROC SetWindowProc(WNDPROC NewProc); diff --git a/Source/movie.h b/Source/movie.h index 5927a3226..69eb7f718 100644 --- a/Source/movie.h +++ b/Source/movie.h @@ -16,7 +16,7 @@ extern BYTE movie_playing; extern BOOL loop_movie; void play_movie(const char *pszMovie, BOOL user_can_close); -LRESULT MovieWndProc(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam); +void MovieWndProc(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam); /* rdata */ diff --git a/SourceS/miniwin/misc.h b/SourceS/miniwin/misc.h index 17886c62e..b100a0b3f 100644 --- a/SourceS/miniwin/misc.h +++ b/SourceS/miniwin/misc.h @@ -18,9 +18,8 @@ typedef void *PVOID; typedef unsigned int UINT; -typedef uintptr_t WPARAM; -typedef uintptr_t LPARAM; -typedef uintptr_t LRESULT; +typedef int32_t WPARAM; +typedef int32_t LPARAM; // // Handles @@ -29,7 +28,7 @@ typedef void *HANDLE; typedef HANDLE HWND, HMODULE, HDC, HINSTANCE; -typedef LRESULT(*WNDPROC)(HWND, UINT, WPARAM, LPARAM); +typedef void(*WNDPROC)(HWND, UINT, WPARAM, LPARAM); typedef struct _FILETIME { DWORD dwLowDateTime; @@ -54,7 +53,7 @@ SHORT GetAsyncKeyState(int vKey); bool PeekMessage(LPMSG lpMsg); bool TranslateMessage(const MSG *lpMsg); -LRESULT DispatchMessage(const MSG *lpMsg); +void DispatchMessage(const MSG *lpMsg); bool PostMessage(UINT Msg, WPARAM wParam, LPARAM lParam); #ifndef TRUE diff --git a/SourceX/miniwin/misc_msg.cpp b/SourceX/miniwin/misc_msg.cpp index 82f1be26b..6036733ce 100644 --- a/SourceX/miniwin/misc_msg.cpp +++ b/SourceX/miniwin/misc_msg.cpp @@ -708,11 +708,11 @@ SHORT GetAsyncKeyState(int vKey) } } -LRESULT DispatchMessage(const MSG *lpMsg) +void DispatchMessage(const MSG *lpMsg) { assert(CurrentProc); - return CurrentProc(NULL, lpMsg->message, lpMsg->wParam, lpMsg->lParam); + CurrentProc(NULL, lpMsg->message, lpMsg->wParam, lpMsg->lParam); } bool PostMessage(UINT Msg, WPARAM wParam, LPARAM lParam)