[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:
sosssego
2022-12-12 17:21:48 +00:00
committed by GitHub
parent 6cbb094cfb
commit e42bbaaaf7
12 changed files with 40 additions and 30 deletions

View File

@@ -36,8 +36,9 @@ public:
std::wstring saveFolderPath = PTSettingsHelper::get_module_save_folder_location(NonLocalizable::ModuleKey);
#if defined(UNIT_TESTS)
return saveFolderPath + L"\\test-app-zone-history.json";
#endif
#else
return saveFolderPath + L"\\app-zone-history.json";
#endif
}
void LoadData();

View File

@@ -36,7 +36,7 @@ class AppliedLayouts
{
public:
using TAppliedLayoutsMap = std::unordered_map<FancyZonesDataTypes::WorkAreaId, LayoutData>;
static AppliedLayouts& instance();
inline static std::wstring AppliedLayoutsFileName()
@@ -44,8 +44,9 @@ public:
std::wstring saveFolderPath = PTSettingsHelper::get_module_save_folder_location(NonLocalizable::ModuleKey);
#if defined(UNIT_TESTS)
return saveFolderPath + L"\\test-applied-layouts.json";
#endif
#else
return saveFolderPath + L"\\applied-layouts.json";
#endif
}
void LoadData();

View File

@@ -58,8 +58,9 @@ public:
std::wstring saveFolderPath = PTSettingsHelper::get_module_save_folder_location(NonLocalizable::ModuleKey);
#if defined(UNIT_TESTS)
return saveFolderPath + L"\\test-custom-layouts.json";
#endif
#else
return saveFolderPath + L"\\custom-layouts.json";
#endif
}
void LoadData();

View File

@@ -2,7 +2,6 @@
#include <FancyZonesLib/FancyZonesData/LayoutData.h>
#include <FancyZonesLib/ModuleConstants.h>
#include <common/SettingsAPI/FileWatcher.h>
#include <common/SettingsAPI/settings_helpers.h>
@@ -40,8 +39,9 @@ public:
std::wstring saveFolderPath = PTSettingsHelper::get_module_save_folder_location(NonLocalizable::ModuleKey);
#if defined(UNIT_TESTS)
return saveFolderPath + L"\\test-default-layouts.json";
#endif
#else
return saveFolderPath + L"\\default-layouts.json";
#endif
}
void LoadData();

View File

@@ -32,12 +32,13 @@ public:
std::wstring saveFolderPath = PTSettingsHelper::get_module_save_folder_location(NonLocalizable::ModuleKey);
#if defined(UNIT_TESTS)
return saveFolderPath + L"\\test-layout-hotkeys.json";
#endif
#else
return saveFolderPath + L"\\layout-hotkeys.json";
#endif
}
void LoadData();
void LoadData();
std::optional<GUID> GetLayoutId(int key) const noexcept;
size_t GetHotkeysCount() const noexcept;

View File

@@ -29,8 +29,9 @@ public:
std::wstring saveFolderPath = PTSettingsHelper::get_module_save_folder_location(NonLocalizable::ModuleKey);
#if defined(UNIT_TESTS)
return saveFolderPath + L"\\test-layout-templates.json";
#endif
#else
return saveFolderPath + L"\\layout-templates.json";
#endif
}
void LoadData();