style: fix all cppcheck warnings
Some checks failed
CI / build (push) Failing after 3m20s

- Fix ignored return value in TxtReaderActivity
- Remove unused variables across multiple files
- Add const correctness to DictionaryMargins and EpubReaderActivity
- Replace inefficient substr patterns with resize+append
- Use STL algorithms (find_if, any_of, copy_if, transform) where applicable
- Remove dead sync placeholder code in EpubReaderChapterSelectionActivity
- Add cppcheck suppression for ValueFlow analysis limitation

Resolves all low, medium, and high severity cppcheck defects.
This commit is contained in:
cottongin
2026-01-28 09:45:42 -05:00
parent fe446d4690
commit bd95bfd44d
13 changed files with 66 additions and 102 deletions

View File

@@ -386,9 +386,7 @@ void EpubReaderActivity::loop() {
[this](QuickMenuAction action) {
// Cache values before exitActivity
EpubReaderActivity* self = this;
GfxRenderer& cachedRenderer = renderer;
MappedInputManager& cachedMappedInput = mappedInput;
Section* cachedSection = section.get();
const Section* cachedSection = section.get();
SemaphoreHandle_t cachedMutex = renderingMutex;
exitActivity();
@@ -938,7 +936,8 @@ void EpubReaderActivity::renderEndOfBookPrompt() {
// Book title (truncated if needed)
std::string bookTitle = epub->getTitle();
if (bookTitle.length() > 30) {
bookTitle = bookTitle.substr(0, 27) + "...";
bookTitle.resize(27);
bookTitle += "...";
}
renderer.drawCenteredText(UI_10_FONT_ID, 120, bookTitle.c_str());