From a73836c5948c3526906d7cf204d40f157a5f3447 Mon Sep 17 00:00:00 2001 From: jpirnay Date: Fri, 24 Apr 2026 18:08:37 +0200 Subject: [PATCH] cppcheck complains --- lib/EpdFont/FontDecompressor.h | 2 +- src/activities/reader/EpubReaderActivity.cpp | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/EpdFont/FontDecompressor.h b/lib/EpdFont/FontDecompressor.h index cdf24b9a..e4bf5c05 100644 --- a/lib/EpdFont/FontDecompressor.h +++ b/lib/EpdFont/FontDecompressor.h @@ -67,7 +67,7 @@ class FontDecompressor { // Scratch buffer for compacting a single glyph after a getBitmap() miss. // Valid until the next getBitmap() call. - uint8_t _hotGlyphBuf[HOT_GLYPH_BUF_SIZE]; + uint8_t _hotGlyphBuf[HOT_GLYPH_BUF_SIZE] = {}; void freePageBuffer(); uint16_t getGroupIndex(const EpdFontData* fontData, uint32_t glyphIndex); diff --git a/src/activities/reader/EpubReaderActivity.cpp b/src/activities/reader/EpubReaderActivity.cpp index a70c8308..cca2e9b0 100644 --- a/src/activities/reader/EpubReaderActivity.cpp +++ b/src/activities/reader/EpubReaderActivity.cpp @@ -1119,7 +1119,7 @@ int EpubReaderActivity::getEffectiveReaderFontId() const { } bool EpubReaderActivity::stepPageState(const bool isForwardTurn) { - if (!epub || !section || section->pageCount <= 0) { + if (!epub || !section || section->pageCount == 0) { return false; } @@ -1565,8 +1565,8 @@ void EpubReaderActivity::renderContents(std::unique_ptr page, const int or tEnd - t0); } - if (auto* cacheManager = renderer.getFontCacheManager()) { - if (auto* decompressor = cacheManager->getDecompressor()) { + if (const auto* cacheManager = renderer.getFontCacheManager()) { + if (const auto* decompressor = cacheManager->getDecompressor()) { const auto& stats = decompressor->getStats(); lastRenderStats.fontCacheHits = stats.cacheHits; lastRenderStats.fontCacheMisses = stats.cacheMisses;