https://git.reactos.org/?p=reactos.git;a=commitdiff;h=806da4421c13becf47735…
commit 806da4421c13becf47735ad33f18dafd542497df
Author: Joachim Henze <joachim.henze(a)reactos.org>
AuthorDate: Sun Sep 17 19:47:23 2023 +0200
Commit: GitHub <noreply(a)github.com>
CommitDate: Sun Sep 17 17:47:23 2023 +0000
[CMICONTROL] Avoid (DLGPROC) cast (#5693)
Yes, might slightly improve with x64,
but that wasn't even my main motivation.
(DLGPROC)-casts are nonsense even for x86 actually.
---
drivers/wdm/audio/drivers/CMIDriver/cmicontrol/main.cpp | 13 +++----------
drivers/wdm/audio/drivers/CMIDriver/cmicontrol/main.h | 3 +--
2 files changed, 4 insertions(+), 12 deletions(-)
diff --git a/drivers/wdm/audio/drivers/CMIDriver/cmicontrol/main.cpp
b/drivers/wdm/audio/drivers/CMIDriver/cmicontrol/main.cpp
index 6649e4d4841..e5711703966 100644
--- a/drivers/wdm/audio/drivers/CMIDriver/cmicontrol/main.cpp
+++ b/drivers/wdm/audio/drivers/CMIDriver/cmicontrol/main.cpp
@@ -210,7 +210,6 @@ BOOL playTestTone()
return TRUE;
}
-
BOOL CALLBACK DSEnumProc(LPGUID lpGUID, LPCTSTR lpszDesc, LPCTSTR lpszDrvName, LPVOID
lpContext)
{
LPGUID* pGUID = (LPGUID*)lpContext;
@@ -312,7 +311,6 @@ BOOL setCurrentChannelConfig()
LocalFree(guid);
}
-
return FALSE;
}
@@ -414,7 +412,6 @@ BOOL getDeviceInterfaceDetail(const GUID* category, CMIDEV* pDev)
}
return TRUE;
-
}
BOOL getDriverData(CMIDEV* pDev)
@@ -545,7 +542,6 @@ void updateChannelBoxes(HWND hWnd)
}
}
-
BOOL setDlgItems(HWND hWnd)
{
HWND hWndItem;
@@ -626,7 +622,6 @@ BOOL setDlgItems(HWND hWnd)
SendMessage(GetDlgItem(hWndChild[0], IDC_EN_CENTER2MIC), BM_SETCHECK,
(cmiData.enableCenter2Mic ? BST_CHECKED : BST_UNCHECKED), 0);
SendMessage(GetDlgItem(hWndChild[0], IDC_NOROUTE_MIC), BM_SETCHECK,
(!cmiData.enableCenter2Mic ? BST_CHECKED : BST_UNCHECKED), 0);
-
return TRUE;
}
@@ -687,7 +682,7 @@ BOOL initDialog(HWND hWnd)
PrintLastError("TabCtrl_InsertItem()");
return FALSE;
}
- hWndChild[i] = CreateDialogParam(hInst, MAKEINTRESOURCE(tabsResource[i]), hWndTab,
(DLGPROC)TabDlgProc, 0);
+ hWndChild[i] = CreateDialogParam(hInst, MAKEINTRESOURCE(tabsResource[i]), hWndTab,
TabDlgProc, 0);
}
hURLFont = CreateFont(20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, VARIABLE_PITCH | FF_SWISS,
"MS Shell Dlg");
@@ -753,7 +748,7 @@ void openURL(int control)
ShellExecute(hWndMain, "open", buffer, NULL, NULL, SW_SHOWNORMAL);
}
-LRESULT CALLBACK TabDlgProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
+INT_PTR CALLBACK TabDlgProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
switch(msg) {
case WM_COMMAND:
@@ -777,7 +772,7 @@ LRESULT CALLBACK TabDlgProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM
lParam)
if ( (GetDlgItem(hWndChild[3], IDC_URL1) == (HANDLE)lParam) ||
(GetDlgItem(hWndChild[3], IDC_URL2) == (HANDLE)lParam) ) {
SetTextColor((HDC)wParam, 0xFF0000);
SetBkMode((HDC)wParam, TRANSPARENT);
- return (LRESULT)GetSysColorBrush(COLOR_BTNFACE);
+ return (INT_PTR)GetSysColorBrush(COLOR_BTNFACE);
}
}
@@ -823,7 +818,6 @@ void deleteDriverFiles() {
}
}
-
void performUninstall() {
deleteDriverFiles();
RegDeleteKey(HKEY_LOCAL_MACHINE,
"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\CMIDriver");
@@ -931,7 +925,6 @@ void InitURLControl()
if (RegisterClassEx(&wce) == 0) {
PrintLastError("RegisterClassEx()");
}
-
}
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, PSTR szCmdLine, int
iCmdShow)
diff --git a/drivers/wdm/audio/drivers/CMIDriver/cmicontrol/main.h
b/drivers/wdm/audio/drivers/CMIDriver/cmicontrol/main.h
index b0edfabf94a..a7f071fd894 100644
--- a/drivers/wdm/audio/drivers/CMIDriver/cmicontrol/main.h
+++ b/drivers/wdm/audio/drivers/CMIDriver/cmicontrol/main.h
@@ -64,10 +64,9 @@ typedef struct _CMIDEV {
HDEVINFO Info;
SP_DEVINFO_DATA InfoData;
PSP_DEVICE_INTERFACE_DETAIL_DATA InterfaceDetailData;
-
} CMIDEV;
-static LRESULT CALLBACK TabDlgProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam);
+static INT_PTR CALLBACK TabDlgProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam);
HINSTANCE hInst;
HWND hWndMain;