Fix all uninitialized variable warnings (C26495)

This commit is contained in:
Pokechu22
2021-09-03 21:43:19 -07:00
parent 525e6b2194
commit 78bfd25964
111 changed files with 638 additions and 651 deletions

View File

@ -23,7 +23,7 @@ using UnderlyingType = typename std::enable_if_t<std::is_enum<T>{}, std::underly
struct Location
{
System system;
System system{};
std::string section;
std::string key;

View File

@ -85,11 +85,11 @@ enum
namespace File
{
// FileSystem tree node/
// FileSystem tree node
struct FSTEntry
{
bool isDirectory;
u64 size; // File length, or for directories, recursive count of children
bool isDirectory = false;
u64 size = 0; // File length, or for directories, recursive count of children
std::string physicalName; // Name on disk
std::string virtualName; // Name in FST names table
std::vector<FSTEntry> children;

View File

@ -78,7 +78,7 @@ public:
bool empty() const noexcept { return size() == 0; }
private:
std::array<T, N> storage;
std::array<T, N> storage{};
int head = 0;
int tail = 0;
// Sacrifice 4 bytes for a simpler implementation. may optimize away in the future.

View File

@ -59,9 +59,9 @@ public:
}
template <typename T, std::size_t N>
bool ReadArray(std::array<T, N>& elements, size_t* num_read = nullptr)
bool ReadArray(std::array<T, N>* elements, size_t* num_read = nullptr)
{
return ReadArray(elements.data(), elements.size(), num_read);
return ReadArray(elements->data(), elements->size(), num_read);
}
template <typename T, std::size_t N>

View File

@ -153,7 +153,7 @@ private:
std::min(Common::scm_rev_git_str.size(), sizeof(ver)));
}
u32 id;
u32 id = 0;
const u16 key_t_size = sizeof(K);
const u16 value_t_size = sizeof(V);
char ver[40] = {};
@ -161,5 +161,5 @@ private:
} m_header;
File::IOFile m_file;
u32 m_num_entries;
u32 m_num_entries = 0;
};

View File

@ -14,5 +14,5 @@ public:
void Log(Common::Log::LOG_LEVELS level, const char* text) override;
private:
bool m_use_color;
bool m_use_color = false;
};

View File

@ -98,7 +98,7 @@ private:
delete next_ptr;
}
T current;
T current{};
std::atomic<ElementPtr*> next;
};