mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-08 12:18:50 +02:00
[Analyzers][CPP]Changes to fix warning 26493 on src/modules/ (P) (#23604)
* Changes to fix warning 26493 on src/modules/
This commit is contained in:
@@ -420,7 +420,7 @@ BOOL GetEnumeratedFileName(__out_ecount(cchMax) PWSTR pszUniqueName, UINT cchMax
|
||||
if (!pszRest)
|
||||
{
|
||||
pszRest = PathFindExtension(pszTemplate);
|
||||
cchStem = (int)(pszRest - pszTemplate);
|
||||
cchStem = static_cast<int>(pszRest - pszTemplate);
|
||||
|
||||
hr = StringCchCopy(szFormat, ARRAYSIZE(szFormat), L" (%lu)");
|
||||
}
|
||||
@@ -428,7 +428,7 @@ BOOL GetEnumeratedFileName(__out_ecount(cchMax) PWSTR pszUniqueName, UINT cchMax
|
||||
{
|
||||
pszRest++;
|
||||
|
||||
cchStem = (int)(pszRest - pszTemplate);
|
||||
cchStem = static_cast<int>(pszRest - pszTemplate);
|
||||
|
||||
while (*pszRest && *pszRest >= L'0' && *pszRest <= L'9')
|
||||
{
|
||||
@@ -581,7 +581,7 @@ HWND CreateMsgWindow(_In_ HINSTANCE hInst, _In_ WNDPROC pfnWndProc, _In_ void* p
|
||||
wc.lpfnWndProc = DefWindowProc;
|
||||
wc.cbWndExtra = sizeof(void*);
|
||||
wc.hInstance = hInst;
|
||||
wc.hbrBackground = (HBRUSH)(COLOR_BTNFACE + 1);
|
||||
wc.hbrBackground = reinterpret_cast<HBRUSH>(COLOR_BTNFACE + 1);
|
||||
wc.lpszClassName = wndClassName;
|
||||
|
||||
RegisterClass(&wc);
|
||||
@@ -590,10 +590,10 @@ HWND CreateMsgWindow(_In_ HINSTANCE hInst, _In_ WNDPROC pfnWndProc, _In_ void* p
|
||||
0, wndClassName, nullptr, 0, 0, 0, 0, 0, HWND_MESSAGE, 0, hInst, nullptr);
|
||||
if (hwnd)
|
||||
{
|
||||
SetWindowLongPtr(hwnd, 0, (LONG_PTR)p);
|
||||
SetWindowLongPtr(hwnd, 0, reinterpret_cast<LONG_PTR>(p));
|
||||
if (pfnWndProc)
|
||||
{
|
||||
SetWindowLongPtr(hwnd, GWLP_WNDPROC, (LONG_PTR)pfnWndProc);
|
||||
SetWindowLongPtr(hwnd, GWLP_WNDPROC, reinterpret_cast<LONG_PTR>(pfnWndProc));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -123,12 +123,12 @@ void MRUListHandler::ParseJson()
|
||||
unsigned int oldSize{ size };
|
||||
if (json::has(jsonObject, c_maxMRUSize, json::JsonValueType::Number))
|
||||
{
|
||||
oldSize = (unsigned int)jsonObject.GetNamedNumber(c_maxMRUSize);
|
||||
oldSize = static_cast<unsigned int>(jsonObject.GetNamedNumber(c_maxMRUSize));
|
||||
}
|
||||
unsigned int oldPushIdx{ 0 };
|
||||
if (json::has(jsonObject, c_insertionIdx, json::JsonValueType::Number))
|
||||
{
|
||||
oldPushIdx = (unsigned int)jsonObject.GetNamedNumber(c_insertionIdx);
|
||||
oldPushIdx = static_cast<unsigned int>(jsonObject.GetNamedNumber(c_insertionIdx));
|
||||
if (oldPushIdx < 0 || oldPushIdx >= oldSize)
|
||||
{
|
||||
oldPushIdx = 0;
|
||||
@@ -156,7 +156,7 @@ void MRUListHandler::ParseJson()
|
||||
if (size > oldSize)
|
||||
{
|
||||
std::reverse(std::begin(temp), std::end(temp));
|
||||
pushIdx = (unsigned int)temp.size();
|
||||
pushIdx = static_cast<unsigned int>(temp.size());
|
||||
temp.resize(size);
|
||||
}
|
||||
else
|
||||
|
||||
@@ -526,7 +526,7 @@ LRESULT CALLBACK CPowerRenameManager::s_msgWndProc(_In_ HWND hwnd, _In_ UINT uMs
|
||||
{
|
||||
LRESULT lRes = 0;
|
||||
|
||||
CPowerRenameManager* pThis = (CPowerRenameManager*)GetWindowLongPtr(hwnd, 0);
|
||||
CPowerRenameManager* pThis = reinterpret_cast<CPowerRenameManager*>(GetWindowLongPtr(hwnd, 0));
|
||||
if (pThis != nullptr)
|
||||
{
|
||||
lRes = pThis->_WndProc(hwnd, uMsg, wParam, lParam);
|
||||
|
||||
@@ -125,7 +125,7 @@ void CSettings::ParseJson()
|
||||
}
|
||||
if (json::has(jsonSettings, c_maxMRUSize, json::JsonValueType::Number))
|
||||
{
|
||||
settings.maxMRUSize = (unsigned int)jsonSettings.GetNamedNumber(c_maxMRUSize);
|
||||
settings.maxMRUSize = static_cast<unsigned int>(jsonSettings.GetNamedNumber(c_maxMRUSize));
|
||||
}
|
||||
if (json::has(jsonSettings, c_searchText, json::JsonValueType::String))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user