From af018af03af70126e82817602ede9a1b15e76f9c Mon Sep 17 00:00:00 2001 From: jpirnay Date: Fri, 17 Apr 2026 15:59:58 +0200 Subject: [PATCH] style fixes --- src/activities/home/HomeActivity.cpp | 2 +- src/activities/reader/EpubReaderMenuActivity.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/activities/home/HomeActivity.cpp b/src/activities/home/HomeActivity.cpp index 4f3450a3..f9950571 100644 --- a/src/activities/home/HomeActivity.cpp +++ b/src/activities/home/HomeActivity.cpp @@ -293,7 +293,7 @@ void HomeActivity::loop() { onSelectBook(recentBooks[selectorIndex].path); } else { const int menuIdx = selectorIndex - recentsCount; - if (menuIdx >= 0 && menuIdx < static_cast(menuEntries.size())) { + if (menuIdx < static_cast(menuEntries.size())) { dispatchMenuAction(menuEntries[menuIdx].action); } } diff --git a/src/activities/reader/EpubReaderMenuActivity.cpp b/src/activities/reader/EpubReaderMenuActivity.cpp index 7d7558f4..e7d66f84 100644 --- a/src/activities/reader/EpubReaderMenuActivity.cpp +++ b/src/activities/reader/EpubReaderMenuActivity.cpp @@ -56,7 +56,7 @@ void EpubReaderMenuActivity::buildMenuItems(bool hasFootnotes, bool hasStarredPa menuItems.push_back(SettingInfo::DynamicEnumCtx( StrId::STR_EMBEDDED_STYLE, {StrId::STR_DEFAULT_VALUE, StrId::STR_STATE_ON, StrId::STR_STATE_OFF}, self, [](void* ctx) -> uint8_t { - auto* s = static_cast(ctx); + const auto* s = static_cast(ctx); if (s->pendingEmbeddedStyleOverride < 0) return 0; if (s->pendingEmbeddedStyleOverride > 0) return 1; return 2; @@ -77,7 +77,7 @@ void EpubReaderMenuActivity::buildMenuItems(bool hasFootnotes, bool hasStarredPa {StrId::STR_DEFAULT_VALUE, StrId::STR_IMAGES_DISPLAY, StrId::STR_IMAGES_PLACEHOLDER, StrId::STR_IMAGES_SUPPRESS}, self, [](void* ctx) -> uint8_t { - auto* s = static_cast(ctx); + const auto* s = static_cast(ctx); return (s->pendingImageRenderingOverride < 0) ? 0 : (s->pendingImageRenderingOverride + 1); }, [](void* ctx, uint8_t v) {