Remove unecessary cast

This commit is contained in:
Don HO 2019-03-18 09:45:25 +01:00
parent 0f933b16c3
commit 0c5a42153b
No known key found for this signature in database
GPG Key ID: 6C429F1D8D84F46E
2 changed files with 6 additions and 6 deletions

View File

@ -307,11 +307,11 @@ void RegExtDlg::getRegisteredExts()
//TCHAR valName[extNameLen]; //TCHAR valName[extNameLen];
TCHAR valData[extNameLen]; TCHAR valData[extNameLen];
int valDataLen = extNameLen * sizeof(TCHAR); int valDataLen = extNameLen * sizeof(TCHAR);
int valType; DWORD valType;
HKEY hKey2Check; HKEY hKey2Check;
extNameActualLen = extNameLen; extNameActualLen = extNameLen;
::RegOpenKeyEx(HKEY_CLASSES_ROOT, extName, 0, KEY_ALL_ACCESS, &hKey2Check); ::RegOpenKeyEx(HKEY_CLASSES_ROOT, extName, 0, KEY_ALL_ACCESS, &hKey2Check);
::RegQueryValueEx(hKey2Check, TEXT(""), nullptr, reinterpret_cast<LPDWORD>(&valType), reinterpret_cast<LPBYTE>(valData), reinterpret_cast<LPDWORD>(&valDataLen)); ::RegQueryValueEx(hKey2Check, TEXT(""), nullptr, &valType, reinterpret_cast<LPBYTE>(valData), reinterpret_cast<LPDWORD>(&valDataLen));
if ((valType == REG_SZ) && (!lstrcmp(valData, nppName))) if ((valType == REG_SZ) && (!lstrcmp(valData, nppName)))
::SendDlgItemMessage(_hSelf, IDC_REGEXT_REGISTEREDEXTS_LIST, LB_ADDSTRING, 0, reinterpret_cast<LPARAM>(extName)); ::SendDlgItemMessage(_hSelf, IDC_REGEXT_REGISTEREDEXTS_LIST, LB_ADDSTRING, 0, reinterpret_cast<LPARAM>(extName));
@ -372,8 +372,8 @@ bool RegExtDlg::deleteExts(const TCHAR *ext2Delete)
{ {
TCHAR valData[extNameLen]; TCHAR valData[extNameLen];
int valDataLen = extNameLen*sizeof(TCHAR); int valDataLen = extNameLen*sizeof(TCHAR);
int valType; DWORD valType;
int res = ::RegQueryValueEx(hKey, nppBackup, nullptr, (LPDWORD)&valType, (LPBYTE)valData, (LPDWORD)&valDataLen); int res = ::RegQueryValueEx(hKey, nppBackup, nullptr, &valType, (LPBYTE)valData, (LPDWORD)&valDataLen);
if (res == ERROR_SUCCESS) if (res == ERROR_SUCCESS)
{ {

View File

@ -1804,12 +1804,12 @@ void Notepad_plus::command(int id)
TCHAR valData[MAX_PATH] = {'\0'}; TCHAR valData[MAX_PATH] = {'\0'};
int valDataLen = MAX_PATH * sizeof(TCHAR); int valDataLen = MAX_PATH * sizeof(TCHAR);
int valType; DWORD valType;
HKEY hKey2Check = nullptr; HKEY hKey2Check = nullptr;
generic_string appEntry = TEXT("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\App Paths\\"); generic_string appEntry = TEXT("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\App Paths\\");
appEntry += appName; appEntry += appName;
::RegOpenKeyEx(HKEY_LOCAL_MACHINE, appEntry.c_str(), 0, KEY_READ, &hKey2Check); ::RegOpenKeyEx(HKEY_LOCAL_MACHINE, appEntry.c_str(), 0, KEY_READ, &hKey2Check);
::RegQueryValueEx(hKey2Check, TEXT(""), nullptr, reinterpret_cast<LPDWORD>(&valType), reinterpret_cast<LPBYTE>(valData), reinterpret_cast<LPDWORD>(&valDataLen)); ::RegQueryValueEx(hKey2Check, TEXT(""), nullptr, &valType, reinterpret_cast<LPBYTE>(valData), reinterpret_cast<LPDWORD>(&valDataLen));
generic_string fullCurrentPath = TEXT("\""); generic_string fullCurrentPath = TEXT("\"");