From a1d6c6db62853c852b5526a36da5c7e2e8ed49dd Mon Sep 17 00:00:00 2001 From: Austin Date: Sun, 12 Apr 2026 20:38:44 -0400 Subject: [PATCH] Fix display method to use const qualifier for previousBuffer pointer (#10146) Addresses cppcheck `src/graphics/EInkParallelDisplay.cpp:205: [low:style] Variable 'prev' can be declared as pointer to const [constVariablePointer]` --- src/graphics/EInkParallelDisplay.cpp | 2 +- variants/esp32s3/mini-epaper-s3/nicheGraphics.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/graphics/EInkParallelDisplay.cpp b/src/graphics/EInkParallelDisplay.cpp index b870e111b..293f57e81 100644 --- a/src/graphics/EInkParallelDisplay.cpp +++ b/src/graphics/EInkParallelDisplay.cpp @@ -202,7 +202,7 @@ void EInkParallelDisplay::display(void) // Get pointers to internal buffers uint8_t *cur = epaper->currentBuffer(); - uint8_t *prev = epaper->previousBuffer(); // may be NULL on first init + const uint8_t *prev = epaper->previousBuffer(); // may be NULL on first init // Track changed row range while converting int newTop = h; // min changed row (initialized to out-of-range) diff --git a/variants/esp32s3/mini-epaper-s3/nicheGraphics.h b/variants/esp32s3/mini-epaper-s3/nicheGraphics.h index 86da4b8ce..0cbd6a192 100644 --- a/variants/esp32s3/mini-epaper-s3/nicheGraphics.h +++ b/variants/esp32s3/mini-epaper-s3/nicheGraphics.h @@ -98,7 +98,7 @@ void setupNicheGraphics() buttons->setTwoWayRockerPressHandlers( [inkhud]() { bool systemHandlingInput = false; - for (InkHUD::SystemApplet *sa : inkhud->systemApplets) { + for (const InkHUD::SystemApplet *sa : inkhud->systemApplets) { if (sa->handleInput) { systemHandlingInput = true; break; @@ -112,7 +112,7 @@ void setupNicheGraphics() }, [inkhud]() { bool systemHandlingInput = false; - for (InkHUD::SystemApplet *sa : inkhud->systemApplets) { + for (const InkHUD::SystemApplet *sa : inkhud->systemApplets) { if (sa->handleInput) { systemHandlingInput = true; break;