Fix some -Weffc++ warnings (part 1)

This commit is contained in:
Nekotekina 2021-03-30 18:31:46 +03:00
parent deacf05769
commit 2212a131ef
24 changed files with 162 additions and 56 deletions

View file

@ -210,9 +210,9 @@ namespace fs
class device_manager final
{
mutable shared_mutex m_mutex;
mutable shared_mutex m_mutex{};
std::unordered_map<std::string, std::shared_ptr<device_base>> m_map;
std::unordered_map<std::string, std::shared_ptr<device_base>> m_map{};
public:
std::shared_ptr<device_base> get_device(const std::string& path);
@ -1339,6 +1339,10 @@ fs::file::file(const void* ptr, usz size)
{
}
memory_stream(const memory_stream&) = delete;
memory_stream& operator=(const memory_stream&) = delete;
bool trunc(u64) override
{
return false;
@ -1509,6 +1513,10 @@ bool fs::dir::open(const std::string& path)
{
}
unix_dir(const unix_dir&) = delete;
unix_dir& operator=(const unix_dir&) = delete;
~unix_dir() override
{
::closedir(m_dd);
@ -1843,8 +1851,8 @@ fs::file fs::make_gather(std::vector<fs::file> files)
{
u64 pos = 0;
u64 end = 0;
std::vector<file> files;
std::map<u64, u64> ends; // Fragment End Offset -> Index
std::vector<file> files{};
std::map<u64, u64> ends{}; // Fragment End Offset -> Index
gather_stream(std::vector<fs::file> arg)
: files(std::move(arg))