diff --git a/src/book.cpp b/src/book.cpp index 6a173ba9c..6d41a87eb 100644 --- a/src/book.cpp +++ b/src/book.cpp @@ -87,7 +87,7 @@ void Book::update(const kiwix::Reader& reader) m_origId = reader.getOrigId(); m_articleCount = reader.getArticleCount(); m_mediaCount = reader.getMediaCount(); - m_size = reader.getFileSize() << 10; + m_size = static_cast(reader.getFileSize()) << 10; reader.getFavicon(m_favicon, m_faviconMimeType); } diff --git a/src/library.cpp b/src/library.cpp index ef1a65d1a..34650c2f8 100644 --- a/src/library.cpp +++ b/src/library.cpp @@ -145,10 +145,10 @@ bool Library::writeToFile(const std::string& path) { bookNode.append_attribute("url") = book.getUrl().c_str(); } - if (!book.getArticleCount()) + if (book.getArticleCount()) bookNode.append_attribute("articleCount") = to_string(book.getArticleCount()).c_str(); - if (!book.getMediaCount()) + if (book.getMediaCount()) bookNode.append_attribute("mediaCount") = to_string(book.getMediaCount()).c_str(); if (book.getSize()) { diff --git a/src/reader.cpp b/src/reader.cpp index 00ac9a48e..abe704de6 100644 --- a/src/reader.cpp +++ b/src/reader.cpp @@ -851,7 +851,7 @@ bool Reader::isCorrupted() const unsigned int Reader::getFileSize() const { zim::File* file = this->getZimFileHandler(); - zim::offset_type size = 0; + zim::size_type size = 0; if (file != NULL) { size = file->getFilesize();