mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-03 17:56:44 +02:00
[Analyzers][CPP] Turn on warning 4702 (#22285)
* Turn on 4702 unreachable code * fix warnings that didnt show locally * add comments about disable warnings * improve comments * changes from comments * fix from PR comments
This commit is contained in:
@@ -2,12 +2,17 @@
|
||||
|
||||
#define HKEY_WINDOWS_THEME L"Software\\Microsoft\\Windows\\CurrentVersion\\Themes\\Personalize"
|
||||
|
||||
// disabling warning 4702 - unreachable code
|
||||
// prevent the warning after the call off a infinite loop function
|
||||
#pragma warning(push)
|
||||
#pragma warning(disable : 4702)
|
||||
DWORD WINAPI _checkTheme(LPVOID lpParam)
|
||||
{
|
||||
auto listener = (ThemeListener*)lpParam;
|
||||
listener->CheckTheme();
|
||||
return 0;
|
||||
}
|
||||
#pragma warning(pop)
|
||||
|
||||
void ThemeListener::AddChangedHandler(THEME_HANDLE handle)
|
||||
{
|
||||
|
||||
@@ -67,6 +67,10 @@ namespace updating
|
||||
throw std::runtime_error("Release object doesn't have the required asset");
|
||||
}
|
||||
|
||||
// disabling warning 4702 - unreachable code
|
||||
// prevent the warning that may show up depend on the value of the constants (#defines)
|
||||
#pragma warning(push)
|
||||
#pragma warning(disable : 4702)
|
||||
std::future<nonstd::expected<github_version_info, std::wstring>> get_github_version_info_async(const bool prerelease)
|
||||
{
|
||||
// If the current version starts with 0.0.*, it means we're on a local build from a farm and shouldn't check for updates.
|
||||
@@ -126,6 +130,7 @@ namespace updating
|
||||
}
|
||||
co_return nonstd::make_unexpected(NETWORK_ERROR);
|
||||
}
|
||||
#pragma warning(pop)
|
||||
|
||||
std::filesystem::path get_pending_updates_path()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user