mirror of
https://github.com/microsoft/PowerToys.git
synced 2025-12-16 11:48:06 +01:00
[Analyzers][CPP]Turn on warning 26466 (#22639)
* Turn on warning 26466 * changes from comments
This commit is contained in:
@@ -63,7 +63,7 @@
|
|||||||
<Rule Id="C26463" Action="Error" />
|
<Rule Id="C26463" Action="Error" />
|
||||||
<Rule Id="C26464" Action="Error" />
|
<Rule Id="C26464" Action="Error" />
|
||||||
<Rule Id="C26465" Action="Info" />
|
<Rule Id="C26465" Action="Info" />
|
||||||
<Rule Id="C26466" Action="Info" />
|
<Rule Id="C26466" Action="Error" />
|
||||||
<Rule Id="C26471" Action="Info" />
|
<Rule Id="C26471" Action="Info" />
|
||||||
<Rule Id="C26472" Action="Info" />
|
<Rule Id="C26472" Action="Info" />
|
||||||
<Rule Id="C26473" Action="Info" />
|
<Rule Id="C26473" Action="Info" />
|
||||||
|
|||||||
@@ -12,6 +12,11 @@
|
|||||||
#include <winrt/base.h>
|
#include <winrt/base.h>
|
||||||
#include <winrt/Windows.Foundation.h>
|
#include <winrt/Windows.Foundation.h>
|
||||||
#include <winrt/Windows.Foundation.Collections.h>
|
#include <winrt/Windows.Foundation.Collections.h>
|
||||||
|
|
||||||
|
// Suppressing 26466 - Don't use static_cast downcasts - in CppUnitTest.h
|
||||||
|
#pragma warning(push)
|
||||||
|
#pragma warning(disable : 26466)
|
||||||
#include "CppUnitTest.h"
|
#include "CppUnitTest.h"
|
||||||
|
#pragma warning(pop)
|
||||||
|
|
||||||
#endif //PCH_H
|
#endif //PCH_H
|
||||||
|
|||||||
@@ -4,7 +4,13 @@
|
|||||||
#include <dcomp.h>
|
#include <dcomp.h>
|
||||||
#include <dxgi1_3.h>
|
#include <dxgi1_3.h>
|
||||||
#include <inspectable.h>
|
#include <inspectable.h>
|
||||||
|
|
||||||
|
// Suppressing 26466 - Don't use static_cast downcasts - in base.h
|
||||||
|
#pragma warning(push)
|
||||||
|
#pragma warning(disable : 26466)
|
||||||
#include <winrt/base.h>
|
#include <winrt/base.h>
|
||||||
|
#pragma warning(pop)
|
||||||
|
|
||||||
|
|
||||||
struct DxgiWindowState
|
struct DxgiWindowState
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -74,7 +74,12 @@ HRESULT __stdcall PerGlyphOpacityTextRender::DrawGlyphRun(void* /*clientDrawingC
|
|||||||
auto opacityEffect = clientDrawingEffect.try_query<IDrawingEffect>();
|
auto opacityEffect = clientDrawingEffect.try_query<IDrawingEffect>();
|
||||||
|
|
||||||
if (opacityEffect)
|
if (opacityEffect)
|
||||||
_baseBrush->SetOpacity(static_cast<OpacityEffect*>(opacityEffect.get())->alpha);
|
{
|
||||||
|
const auto temp_opacity = dynamic_cast<OpacityEffect*>(opacityEffect.get());
|
||||||
|
assert(nullptr != temp_opacity);
|
||||||
|
_baseBrush->SetOpacity(temp_opacity->alpha);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
if (SUCCEEDED(hr))
|
if (SUCCEEDED(hr))
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -13,6 +13,11 @@
|
|||||||
#include <winrt/Windows.Foundation.h>
|
#include <winrt/Windows.Foundation.h>
|
||||||
#include <winrt/Windows.Foundation.Collections.h>
|
#include <winrt/Windows.Foundation.Collections.h>
|
||||||
#include "FancyZonesLib/pch.h"
|
#include "FancyZonesLib/pch.h"
|
||||||
|
|
||||||
|
// Suppressing 26466 - Don't use static_cast downcasts - in CppUnitTest.h
|
||||||
|
#pragma warning(push)
|
||||||
|
#pragma warning(disable : 26466)
|
||||||
#include "CppUnitTest.h"
|
#include "CppUnitTest.h"
|
||||||
|
#pragma warning(pop)
|
||||||
|
|
||||||
#endif //PCH_H
|
#endif //PCH_H
|
||||||
|
|||||||
@@ -1,5 +1,11 @@
|
|||||||
#include "pch.h"
|
#include "pch.h"
|
||||||
|
|
||||||
|
// Suppressing 26466 - Don't use static_cast downcasts - in CppUnitTest.h
|
||||||
|
#pragma warning(push)
|
||||||
|
#pragma warning(disable : 26466)
|
||||||
#include "CppUnitTest.h"
|
#include "CppUnitTest.h"
|
||||||
|
#pragma warning(pop)
|
||||||
|
|
||||||
#include <keyboardmanager/KeyboardManagerEditorLibrary/BufferValidationHelpers.h>
|
#include <keyboardmanager/KeyboardManagerEditorLibrary/BufferValidationHelpers.h>
|
||||||
#include <common/interop/keyboard_layout.h>
|
#include <common/interop/keyboard_layout.h>
|
||||||
#include <common/interop/shared_constants.h>
|
#include <common/interop/shared_constants.h>
|
||||||
|
|||||||
@@ -1,5 +1,11 @@
|
|||||||
#include "pch.h"
|
#include "pch.h"
|
||||||
|
|
||||||
|
// Suppressing 26466 - Don't use static_cast downcasts - in CppUnitTest.h
|
||||||
|
#pragma warning(push)
|
||||||
|
#pragma warning(disable : 26466)
|
||||||
#include "CppUnitTest.h"
|
#include "CppUnitTest.h"
|
||||||
|
#pragma warning(pop)
|
||||||
|
|
||||||
#include <keyboardmanager/KeyboardManagerEditorLibrary/ShortcutErrorType.h>
|
#include <keyboardmanager/KeyboardManagerEditorLibrary/ShortcutErrorType.h>
|
||||||
#include <keyboardmanager/common/Helpers.h>
|
#include <keyboardmanager/common/Helpers.h>
|
||||||
#include <common/interop/keyboard_layout.h>
|
#include <common/interop/keyboard_layout.h>
|
||||||
|
|||||||
@@ -1,5 +1,11 @@
|
|||||||
#include "pch.h"
|
#include "pch.h"
|
||||||
|
|
||||||
|
// Suppressing 26466 - Don't use static_cast downcasts - in CppUnitTest.h
|
||||||
|
#pragma warning(push)
|
||||||
|
#pragma warning(disable : 26466)
|
||||||
#include "CppUnitTest.h"
|
#include "CppUnitTest.h"
|
||||||
|
#pragma warning(pop)
|
||||||
|
|
||||||
#include <keyboardmanager/common/MappingConfiguration.h>
|
#include <keyboardmanager/common/MappingConfiguration.h>
|
||||||
#include <keyboardmanager/KeyboardManagerEditorLibrary/LoadingAndSavingRemappingHelper.h>
|
#include <keyboardmanager/KeyboardManagerEditorLibrary/LoadingAndSavingRemappingHelper.h>
|
||||||
#include <common/interop/shared_constants.h>
|
#include <common/interop/shared_constants.h>
|
||||||
|
|||||||
@@ -1,5 +1,11 @@
|
|||||||
#include "pch.h"
|
#include "pch.h"
|
||||||
|
|
||||||
|
// Suppressing 26466 - Don't use static_cast downcasts - in CppUnitTest.h
|
||||||
|
#pragma warning(push)
|
||||||
|
#pragma warning(disable : 26466)
|
||||||
#include "CppUnitTest.h"
|
#include "CppUnitTest.h"
|
||||||
|
#pragma warning(pop)
|
||||||
|
|
||||||
#include "MockedInput.h"
|
#include "MockedInput.h"
|
||||||
#include <keyboardmanager/KeyboardManagerEngineLibrary/State.h>
|
#include <keyboardmanager/KeyboardManagerEngineLibrary/State.h>
|
||||||
#include <keyboardmanager/KeyboardManagerEngineLibrary/KeyboardEventHandlers.h>
|
#include <keyboardmanager/KeyboardManagerEngineLibrary/KeyboardEventHandlers.h>
|
||||||
|
|||||||
@@ -1,5 +1,11 @@
|
|||||||
#include "pch.h"
|
#include "pch.h"
|
||||||
|
|
||||||
|
// Suppressing 26466 - Don't use static_cast downcasts - in CppUnitTest.h
|
||||||
|
#pragma warning(push)
|
||||||
|
#pragma warning(disable : 26466)
|
||||||
#include "CppUnitTest.h"
|
#include "CppUnitTest.h"
|
||||||
|
#pragma warning(pop)
|
||||||
|
|
||||||
#include "MockedInput.h"
|
#include "MockedInput.h"
|
||||||
#include <keyboardmanager/KeyboardManagerEngineLibrary/State.h>
|
#include <keyboardmanager/KeyboardManagerEngineLibrary/State.h>
|
||||||
#include <keyboardmanager/common/KeyboardEventHandlers.h>
|
#include <keyboardmanager/common/KeyboardEventHandlers.h>
|
||||||
|
|||||||
@@ -1,5 +1,11 @@
|
|||||||
#include "pch.h"
|
#include "pch.h"
|
||||||
|
|
||||||
|
// Suppressing 26466 - Don't use static_cast downcasts - in CppUnitTest.h
|
||||||
|
#pragma warning(push)
|
||||||
|
#pragma warning(disable : 26466)
|
||||||
#include "CppUnitTest.h"
|
#include "CppUnitTest.h"
|
||||||
|
#pragma warning(pop)
|
||||||
|
|
||||||
#include "MockedInput.h"
|
#include "MockedInput.h"
|
||||||
#include <keyboardmanager/KeyboardManagerEngineLibrary/State.h>
|
#include <keyboardmanager/KeyboardManagerEngineLibrary/State.h>
|
||||||
#include <keyboardmanager/KeyboardManagerEngineLibrary/KeyboardEventHandlers.h>
|
#include <keyboardmanager/KeyboardManagerEngineLibrary/KeyboardEventHandlers.h>
|
||||||
|
|||||||
@@ -1,5 +1,11 @@
|
|||||||
#include "pch.h"
|
#include "pch.h"
|
||||||
|
|
||||||
|
// Suppressing 26466 - Don't use static_cast downcasts - in CppUnitTest.h
|
||||||
|
#pragma warning(push)
|
||||||
|
#pragma warning(disable : 26466)
|
||||||
#include "CppUnitTest.h"
|
#include "CppUnitTest.h"
|
||||||
|
#pragma warning(pop)
|
||||||
|
|
||||||
#include "MockedInput.h"
|
#include "MockedInput.h"
|
||||||
#include <keyboardmanager/KeyboardManagerEngineLibrary/State.h>
|
#include <keyboardmanager/KeyboardManagerEngineLibrary/State.h>
|
||||||
#include <keyboardmanager/common/KeyboardEventHandlers.h>
|
#include <keyboardmanager/common/KeyboardEventHandlers.h>
|
||||||
|
|||||||
@@ -1,5 +1,11 @@
|
|||||||
#include "pch.h"
|
#include "pch.h"
|
||||||
|
|
||||||
|
// Suppressing 26466 - Don't use static_cast downcasts - in CppUnitTest.h
|
||||||
|
#pragma warning(push)
|
||||||
|
#pragma warning(disable : 26466)
|
||||||
#include "CppUnitTest.h"
|
#include "CppUnitTest.h"
|
||||||
|
#pragma warning(pop)
|
||||||
|
|
||||||
#include "MockedInput.h"
|
#include "MockedInput.h"
|
||||||
#include <keyboardmanager/KeyboardManagerEngineLibrary/State.h>
|
#include <keyboardmanager/KeyboardManagerEngineLibrary/State.h>
|
||||||
#include <keyboardmanager/KeyboardManagerEngineLibrary/KeyboardEventHandlers.h>
|
#include <keyboardmanager/KeyboardManagerEngineLibrary/KeyboardEventHandlers.h>
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
#include "pch.h"
|
#include "pch.h"
|
||||||
#include "CppUnitTest.h"
|
|
||||||
#include <PowerRenameInterfaces.h>
|
#include <PowerRenameInterfaces.h>
|
||||||
#include <PowerRenameManager.h>
|
#include <PowerRenameManager.h>
|
||||||
#include <PowerRenameItem.h>
|
#include <PowerRenameItem.h>
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
#include "pch.h"
|
#include "pch.h"
|
||||||
#include "CppUnitTest.h"
|
|
||||||
#include "powerrename/lib/Settings.h"
|
#include "powerrename/lib/Settings.h"
|
||||||
#include <PowerRenameInterfaces.h>
|
#include <PowerRenameInterfaces.h>
|
||||||
#include <PowerRenameRegEx.h>
|
#include <PowerRenameRegEx.h>
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
#include "pch.h"
|
#include "pch.h"
|
||||||
#include "CppUnitTest.h"
|
|
||||||
#include "powerrename/lib/Settings.h"
|
#include "powerrename/lib/Settings.h"
|
||||||
#include <PowerRenameInterfaces.h>
|
#include <PowerRenameInterfaces.h>
|
||||||
#include <PowerRenameRegEx.h>
|
#include <PowerRenameRegEx.h>
|
||||||
|
|||||||
@@ -5,4 +5,9 @@
|
|||||||
#include <atlbase.h>
|
#include <atlbase.h>
|
||||||
|
|
||||||
// Headers for CppUnitTest
|
// Headers for CppUnitTest
|
||||||
|
|
||||||
|
// Suppressing 26466 - Don't use static_cast downcasts - in CppUnitTest.h
|
||||||
|
#pragma warning(push)
|
||||||
|
#pragma warning(disable : 26466)
|
||||||
#include "CppUnitTest.h"
|
#include "CppUnitTest.h"
|
||||||
|
#pragma warning(pop)
|
||||||
|
|||||||
Reference in New Issue
Block a user