Add cppcoreguidelines-pro-type-member-init clang-tidy check

Fix the warnings it emits.
This commit is contained in:
Oliver Hamlet
2022-02-07 20:25:13 +00:00
parent dcee43e08b
commit 4393dd0e66
7 changed files with 7 additions and 6 deletions
+1
View File
@@ -498,6 +498,7 @@ if(RUN_CLANG_TIDY)
"cppcoreguidelines-pro-bounds-pointer-arithmetic"
"cppcoreguidelines-pro-type-const-cast"
"cppcoreguidelines-pro-type-cstyle-cast"
"cppcoreguidelines-pro-type-member-init"
"cppcoreguidelines-pro-type-reinterpret-cast"
"cppcoreguidelines-pro-type-static-cast-downcast"
"cppcoreguidelines-pro-type-union-access"
+1 -1
View File
@@ -34,7 +34,7 @@ namespace loot {
*/
struct SimpleMessage {
/** The type of the message. */
MessageType type;
MessageType type{MessageType::say};
/** The language the message string is written in. */
std::string language;
+1 -1
View File
@@ -59,7 +59,7 @@ struct ApiDatabase final : public DatabaseInterface {
std::vector<Group> GetGroups(bool includeUserMetadata = true) const override;
std::vector<Group> GetUserGroups() const override;
void SetUserGroups(const std::vector<Group>& groups);
void SetUserGroups(const std::vector<Group>& groups) override;
std::vector<Vertex> GetGroupsPath(
const std::string& fromGroupName,
const std::string& toGroupName) const override;
+1 -1
View File
@@ -56,7 +56,7 @@ uint32_t GetCrc32(const std::filesystem::path& filename) {
ifile.exceptions(std::ios_base::badbit | std::ios_base::failbit);
static constexpr size_t BUFFER_SIZE = 8192;
std::array<char, BUFFER_SIZE> buffer;
std::array<char, BUFFER_SIZE> buffer{};
boost::crc_32_type result;
size_t bytesLeft = GetStreamSize(ifile);
while (bytesLeft > 0) {
@@ -46,7 +46,7 @@ protected:
errorMessage("Obsolete. Remove this and install Enhanced Weather."),
generalMasterlistMessage("A general masterlist message.") {}
virtual void SetUp() override {
void SetUp() override {
CommonGameTestFixture::SetUp();
ASSERT_FALSE(std::filesystem::exists(masterlistPath));
+1 -1
View File
@@ -40,7 +40,7 @@ protected:
{metadataFilesPath / "invalid" / "non_map_root.yaml",
metadataFilesPath / "invalid" / "non_unique.yaml"}) {}
inline virtual void SetUp() override {
inline void SetUp() override {
CommonGameTestFixture::SetUp();
using std::filesystem::copy;
+1 -1
View File
@@ -146,7 +146,7 @@ protected:
ASSERT_TRUE(std::filesystem::exists(dataPath / filename));
}
void TearDown() {
void TearDown() override {
// Grant write permissions to everything in rootTestPath
// in case the test made anything read only.
for (const auto& path :