From 0c5a42153bf33b70b342cce5c10885c1c3392724 Mon Sep 17 00:00:00 2001 From: Don HO Date: Mon, 18 Mar 2019 09:45:25 +0100 Subject: [PATCH] Remove unecessary cast --- PowerEditor/src/MISC/RegExt/regExtDlg.cpp | 8 ++++---- PowerEditor/src/NppCommands.cpp | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/PowerEditor/src/MISC/RegExt/regExtDlg.cpp b/PowerEditor/src/MISC/RegExt/regExtDlg.cpp index 884f3195..1de77f49 100644 --- a/PowerEditor/src/MISC/RegExt/regExtDlg.cpp +++ b/PowerEditor/src/MISC/RegExt/regExtDlg.cpp @@ -307,11 +307,11 @@ void RegExtDlg::getRegisteredExts() //TCHAR valName[extNameLen]; TCHAR valData[extNameLen]; int valDataLen = extNameLen * sizeof(TCHAR); - int valType; + DWORD valType; HKEY hKey2Check; extNameActualLen = extNameLen; ::RegOpenKeyEx(HKEY_CLASSES_ROOT, extName, 0, KEY_ALL_ACCESS, &hKey2Check); - ::RegQueryValueEx(hKey2Check, TEXT(""), nullptr, reinterpret_cast(&valType), reinterpret_cast(valData), reinterpret_cast(&valDataLen)); + ::RegQueryValueEx(hKey2Check, TEXT(""), nullptr, &valType, reinterpret_cast(valData), reinterpret_cast(&valDataLen)); if ((valType == REG_SZ) && (!lstrcmp(valData, nppName))) ::SendDlgItemMessage(_hSelf, IDC_REGEXT_REGISTEREDEXTS_LIST, LB_ADDSTRING, 0, reinterpret_cast(extName)); @@ -372,8 +372,8 @@ bool RegExtDlg::deleteExts(const TCHAR *ext2Delete) { TCHAR valData[extNameLen]; int valDataLen = extNameLen*sizeof(TCHAR); - int valType; - int res = ::RegQueryValueEx(hKey, nppBackup, nullptr, (LPDWORD)&valType, (LPBYTE)valData, (LPDWORD)&valDataLen); + DWORD valType; + int res = ::RegQueryValueEx(hKey, nppBackup, nullptr, &valType, (LPBYTE)valData, (LPDWORD)&valDataLen); if (res == ERROR_SUCCESS) { diff --git a/PowerEditor/src/NppCommands.cpp b/PowerEditor/src/NppCommands.cpp index 11cd1597..51b7205f 100644 --- a/PowerEditor/src/NppCommands.cpp +++ b/PowerEditor/src/NppCommands.cpp @@ -1804,12 +1804,12 @@ void Notepad_plus::command(int id) TCHAR valData[MAX_PATH] = {'\0'}; int valDataLen = MAX_PATH * sizeof(TCHAR); - int valType; + DWORD valType; HKEY hKey2Check = nullptr; generic_string appEntry = TEXT("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\App Paths\\"); appEntry += appName; ::RegOpenKeyEx(HKEY_LOCAL_MACHINE, appEntry.c_str(), 0, KEY_READ, &hKey2Check); - ::RegQueryValueEx(hKey2Check, TEXT(""), nullptr, reinterpret_cast(&valType), reinterpret_cast(valData), reinterpret_cast(&valDataLen)); + ::RegQueryValueEx(hKey2Check, TEXT(""), nullptr, &valType, reinterpret_cast(valData), reinterpret_cast(&valDataLen)); generic_string fullCurrentPath = TEXT("\"");