diff options
author | Dominick Allen <djallen@librehumanitas.org> | 2024-11-10 15:14:38 -0600 |
---|---|---|
committer | Dominick Allen <djallen@librehumanitas.org> | 2024-11-10 15:14:38 -0600 |
commit | 2b641aa2f4f5b894ceed8bf2a46fcef35e930d56 (patch) | |
tree | b5decb0fcd6a225c89d2ababb0fdf2d84b39a334 /src/archive.cpp | |
parent | 47e0ff88edd4660513f1d4f3d731008461532a13 (diff) |
Diffstat (limited to 'src/archive.cpp')
-rw-r--r-- | src/archive.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/archive.cpp b/src/archive.cpp index b4bee29..f46f6a7 100644 --- a/src/archive.cpp +++ b/src/archive.cpp @@ -8,7 +8,7 @@ using fud::FudStatus; ZipArchive::ZipArchive(const QString& filename) { auto filenameUtf8 = filename.toUtf8(); - int err; + int err{}; m_archive = zip_open(filenameUtf8.data(), 0, &err); if (m_archive == nullptr) { @@ -26,7 +26,7 @@ ZipArchive::ZipArchive(const QString& filename) } } -ZipArchive::ZipArchive(ZipArchive&& rhs) +ZipArchive::ZipArchive(ZipArchive&& rhs) noexcept :m_archive{rhs.m_archive}, m_sortedIndices{std::move(rhs.m_sortedIndices)}, m_filenames{std::move(rhs.m_filenames)}, @@ -41,7 +41,7 @@ ZipArchive::~ZipArchive() cleanup(); } -ZipArchive& ZipArchive::operator=(ZipArchive&& rhs) +ZipArchive& ZipArchive::operator=(ZipArchive&& rhs) noexcept { cleanup(); @@ -78,7 +78,7 @@ fud::FudStatus ZipArchive::populate() if (numEntriesResult < 0) { return FudStatus::Failure; } - size_t numEntries = static_cast<size_t>(numEntriesResult); + auto numEntries = static_cast<size_t>(numEntriesResult); struct NameIndex { std::string name; @@ -91,7 +91,8 @@ fud::FudStatus ZipArchive::populate() m_pages.reserve(numEntries); for (size_t idx = 0; idx < numEntries; ++idx) { - struct zip_stat stats; + using zipStat = struct zip_stat; + zipStat stats{}; auto status = zip_stat_index(m_archive, idx, 0, &stats); if (status < 0) { |