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]`
This commit is contained in:
@@ -202,7 +202,7 @@ void EInkParallelDisplay::display(void)
|
|||||||
|
|
||||||
// Get pointers to internal buffers
|
// Get pointers to internal buffers
|
||||||
uint8_t *cur = epaper->currentBuffer();
|
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
|
// Track changed row range while converting
|
||||||
int newTop = h; // min changed row (initialized to out-of-range)
|
int newTop = h; // min changed row (initialized to out-of-range)
|
||||||
|
|||||||
@@ -98,7 +98,7 @@ void setupNicheGraphics()
|
|||||||
buttons->setTwoWayRockerPressHandlers(
|
buttons->setTwoWayRockerPressHandlers(
|
||||||
[inkhud]() {
|
[inkhud]() {
|
||||||
bool systemHandlingInput = false;
|
bool systemHandlingInput = false;
|
||||||
for (InkHUD::SystemApplet *sa : inkhud->systemApplets) {
|
for (const InkHUD::SystemApplet *sa : inkhud->systemApplets) {
|
||||||
if (sa->handleInput) {
|
if (sa->handleInput) {
|
||||||
systemHandlingInput = true;
|
systemHandlingInput = true;
|
||||||
break;
|
break;
|
||||||
@@ -112,7 +112,7 @@ void setupNicheGraphics()
|
|||||||
},
|
},
|
||||||
[inkhud]() {
|
[inkhud]() {
|
||||||
bool systemHandlingInput = false;
|
bool systemHandlingInput = false;
|
||||||
for (InkHUD::SystemApplet *sa : inkhud->systemApplets) {
|
for (const InkHUD::SystemApplet *sa : inkhud->systemApplets) {
|
||||||
if (sa->handleInput) {
|
if (sa->handleInput) {
|
||||||
systemHandlingInput = true;
|
systemHandlingInput = true;
|
||||||
break;
|
break;
|
||||||
|
|||||||
Reference in New Issue
Block a user