mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-05 18:57:19 +02:00
[Analyzers][CPP]Changes to fix warning 26493 on src/modules/ (A to F) (#23482)
starting with letter A to Letter F
This commit is contained in:
@@ -23,7 +23,7 @@ namespace NonLocalizable
|
||||
bool isExcluded(HWND window)
|
||||
{
|
||||
auto processPath = get_process_path(window);
|
||||
CharUpperBuffW(processPath.data(), (DWORD)processPath.length());
|
||||
CharUpperBuffW(processPath.data(), static_cast<DWORD>(processPath.length()));
|
||||
return find_app_name_in_path(processPath, AlwaysOnTopSettings::settings().excludedApps);
|
||||
}
|
||||
|
||||
@@ -381,7 +381,7 @@ bool AlwaysOnTop::IsPinned(HWND window) const noexcept
|
||||
|
||||
bool AlwaysOnTop::PinTopmostWindow(HWND window) const noexcept
|
||||
{
|
||||
if (!SetProp(window, NonLocalizable::WINDOW_IS_PINNED_PROP, (HANDLE)1))
|
||||
if (!SetProp(window, NonLocalizable::WINDOW_IS_PINNED_PROP, reinterpret_cast<HANDLE>(1)))
|
||||
{
|
||||
Logger::error(L"SetProp failed, {}", get_last_error_or_default(GetLastError()));
|
||||
}
|
||||
|
||||
@@ -188,10 +188,10 @@ D2D1_ROUNDED_RECT FrameDrawer::ConvertRect(RECT rect, int thickness, float radiu
|
||||
float halfThickness = thickness / 2.0f;
|
||||
|
||||
// 1 is needed to eliminate the gap between border and window
|
||||
auto d2d1Rect = D2D1::RectF((float)rect.left + halfThickness + 1,
|
||||
(float)rect.top + halfThickness + 1,
|
||||
(float)rect.right - halfThickness - 1,
|
||||
(float)rect.bottom - halfThickness - 1);
|
||||
auto d2d1Rect = D2D1::RectF(static_cast<float>(rect.left) + halfThickness + 1,
|
||||
static_cast<float>(rect.top) + halfThickness + 1,
|
||||
static_cast<float>(rect.right) - halfThickness - 1,
|
||||
static_cast<float>(rect.bottom) - halfThickness - 1);
|
||||
return D2D1::RoundedRect(d2d1Rect, radius, radius);
|
||||
}
|
||||
|
||||
@@ -200,10 +200,10 @@ D2D1_RECT_F FrameDrawer::ConvertRect(RECT rect, int thickness)
|
||||
float halfThickness = thickness / 2.0f;
|
||||
|
||||
// 1 is needed to eliminate the gap between border and window
|
||||
return D2D1::RectF((float)rect.left + halfThickness + 1,
|
||||
(float)rect.top + halfThickness + 1,
|
||||
(float)rect.right - halfThickness - 1,
|
||||
(float)rect.bottom - halfThickness - 1);
|
||||
return D2D1::RectF(static_cast<float>(rect.left) + halfThickness + 1,
|
||||
static_cast<float>(rect.top) + halfThickness + 1,
|
||||
static_cast<float>(rect.right) - halfThickness - 1,
|
||||
static_cast<float>(rect.bottom) - halfThickness - 1);
|
||||
}
|
||||
|
||||
void FrameDrawer::Render()
|
||||
|
||||
@@ -169,7 +169,7 @@ void AlwaysOnTopSettings::LoadSettings()
|
||||
std::wstring apps = std::move(*jsonVal);
|
||||
std::vector<std::wstring> excludedApps;
|
||||
auto excludedUppercase = apps;
|
||||
CharUpperBuffW(excludedUppercase.data(), (DWORD)excludedUppercase.length());
|
||||
CharUpperBuffW(excludedUppercase.data(), static_cast<DWORD>(excludedUppercase.length()));
|
||||
std::wstring_view view(excludedUppercase);
|
||||
view = left_trim<wchar_t>(trim<wchar_t>(view));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user