mirror of
https://github.com/microsoft/PowerToys.git
synced 2025-06-07 09:28:03 +08:00
[Analyzers][CPP] Turn on warning 26492 (#23492)
This commit is contained in:
parent
9168f871af
commit
17475ec705
@ -79,7 +79,7 @@
|
|||||||
<Rule Id="C26485" Action="Hidden" />
|
<Rule Id="C26485" Action="Hidden" />
|
||||||
<Rule Id="C26490" Action="Hidden" />
|
<Rule Id="C26490" Action="Hidden" />
|
||||||
<Rule Id="C26491" Action="Hidden" />
|
<Rule Id="C26491" Action="Hidden" />
|
||||||
<Rule Id="C26492" Action="Hidden" />
|
<Rule Id="C26492" Action="Error" />
|
||||||
<Rule Id="C26493" Action="Hidden" />
|
<Rule Id="C26493" Action="Hidden" />
|
||||||
<Rule Id="C26494" Action="Hidden" />
|
<Rule Id="C26494" Action="Hidden" />
|
||||||
<Rule Id="C26495" Action="Error" />
|
<Rule Id="C26495" Action="Error" />
|
||||||
|
@ -294,8 +294,9 @@ inline bool run_non_elevated(const std::wstring& file, const std::wstring& param
|
|||||||
siex.StartupInfo.cb = sizeof(siex);
|
siex.StartupInfo.cb = sizeof(siex);
|
||||||
|
|
||||||
PROCESS_INFORMATION pi = { 0 };
|
PROCESS_INFORMATION pi = { 0 };
|
||||||
|
|
||||||
auto succeeded = CreateProcessW(file.c_str(),
|
auto succeeded = CreateProcessW(file.c_str(),
|
||||||
const_cast<LPWSTR>(executable_args.c_str()),
|
&executable_args[0],
|
||||||
nullptr,
|
nullptr,
|
||||||
nullptr,
|
nullptr,
|
||||||
FALSE,
|
FALSE,
|
||||||
@ -395,8 +396,9 @@ inline bool run_same_elevation(const std::wstring& file, const std::wstring& par
|
|||||||
|
|
||||||
STARTUPINFO si = { sizeof(STARTUPINFO) };
|
STARTUPINFO si = { sizeof(STARTUPINFO) };
|
||||||
PROCESS_INFORMATION pi = { 0 };
|
PROCESS_INFORMATION pi = { 0 };
|
||||||
|
|
||||||
auto succeeded = CreateProcessW(file.c_str(),
|
auto succeeded = CreateProcessW(file.c_str(),
|
||||||
const_cast<LPWSTR>(executable_args.c_str()),
|
&executable_args[0],
|
||||||
nullptr,
|
nullptr,
|
||||||
nullptr,
|
nullptr,
|
||||||
FALSE,
|
FALSE,
|
||||||
|
@ -4,9 +4,10 @@
|
|||||||
#include <Windows.h>
|
#include <Windows.h>
|
||||||
|
|
||||||
// disable warning 26471 - Don't use reinterpret_cast. A cast from void* can use static_cast
|
// disable warning 26471 - Don't use reinterpret_cast. A cast from void* can use static_cast
|
||||||
|
// disable warning 26492 - Don't use const_cast to cast away const
|
||||||
// Disable 26497 for winrt - This function function-name could be marked constexpr if compile-time evaluation is desired.
|
// Disable 26497 for winrt - This function function-name could be marked constexpr if compile-time evaluation is desired.
|
||||||
#pragma warning(push)
|
#pragma warning(push)
|
||||||
#pragma warning(disable : 26471 26497)
|
#pragma warning(disable : 26471 26492 26497)
|
||||||
#include <wil/resource.h>
|
#include <wil/resource.h>
|
||||||
#pragma warning(pop)
|
#pragma warning(pop)
|
||||||
|
|
||||||
|
@ -247,6 +247,10 @@ struct VideoCaptureReceiverPin : winrt::implements<VideoCaptureReceiverPin, IPin
|
|||||||
|
|
||||||
if (_captureInputPin)
|
if (_captureInputPin)
|
||||||
{
|
{
|
||||||
|
// disable warning 26492 - Don't use const_cast to cast away const
|
||||||
|
// reset needs 'pmt' to be non-const, we can't easily change the query accept prototype
|
||||||
|
// because of the inheritance.
|
||||||
|
#pragma warning(suppress : 26492)
|
||||||
_inputCaptureMediaType.reset(const_cast<AM_MEDIA_TYPE*>(pmt));
|
_inputCaptureMediaType.reset(const_cast<AM_MEDIA_TYPE*>(pmt));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -6,9 +6,10 @@
|
|||||||
#include <dshow.h>
|
#include <dshow.h>
|
||||||
|
|
||||||
// disable warning 26471 - Don't use reinterpret_cast. A cast from void* can use static_cast
|
// disable warning 26471 - Don't use reinterpret_cast. A cast from void* can use static_cast
|
||||||
|
// disable warning 26492 - Don't use const_cast to cast away const on winrt
|
||||||
// Disable 26497 for winrt - This function function-name could be marked constexpr if compile-time evaluation is desired.
|
// Disable 26497 for winrt - This function function-name could be marked constexpr if compile-time evaluation is desired.
|
||||||
#pragma warning(push)
|
#pragma warning(push)
|
||||||
#pragma warning(disable : 26471 26497)
|
#pragma warning(disable : 26471 26492 26497)
|
||||||
#include <wil/com.h>
|
#include <wil/com.h>
|
||||||
#pragma warning(push)
|
#pragma warning(push)
|
||||||
|
|
||||||
|
@ -6,9 +6,10 @@
|
|||||||
#include <cguid.h>
|
#include <cguid.h>
|
||||||
|
|
||||||
// disable warning 26471 - Don't use reinterpret_cast. A cast from void* can use static_cast
|
// disable warning 26471 - Don't use reinterpret_cast. A cast from void* can use static_cast
|
||||||
|
// disable warning 26492 - Don't use const_cast to cast away const
|
||||||
// Disable 26497 for winrt - This function function-name could be marked constexpr if compile-time evaluation is desired.
|
// Disable 26497 for winrt - This function function-name could be marked constexpr if compile-time evaluation is desired.
|
||||||
#pragma warning(push)
|
#pragma warning(push)
|
||||||
#pragma warning(disable : 26471 26497)
|
#pragma warning(disable : 26471 26492 26497)
|
||||||
#include <wil/com.h>
|
#include <wil/com.h>
|
||||||
#pragma warning(push)
|
#pragma warning(push)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user