mirror of
https://github.com/meshtastic/firmware.git
synced 2026-03-30 13:03:52 -04:00
fix a lot of low level cppcheck warnings (#9623)
* simplify the observer pattern, since all the called functions are const getters. * use arduino macro over std: for numerical values and refactor local variables in drawScrollbar() * oh, so Cppcheck actually complained about const pointers not being const. * slowly getting out of ifdef hell * fix inkHUD warnings as well * last 2 check warnings * git checks should fail on low defects from now on
This commit is contained in:
@@ -1209,14 +1209,13 @@ int32_t CannedMessageModule::runOnce()
|
||||
this->cursor = 0;
|
||||
|
||||
// Tell Screen to jump straight to the TextMessage frame
|
||||
UIFrameEvent e;
|
||||
e.action = UIFrameEvent::Action::SWITCH_TO_TEXTMESSAGE;
|
||||
this->notifyObservers(&e);
|
||||
|
||||
// Now deactivate this module
|
||||
this->runState = CANNED_MESSAGE_RUN_STATE_INACTIVE;
|
||||
|
||||
return INT32_MAX; // don’t fall back into canned list
|
||||
return INT32_MAX; // don't fall back into canned list
|
||||
} else {
|
||||
this->runState = CANNED_MESSAGE_RUN_STATE_INACTIVE;
|
||||
}
|
||||
@@ -1237,14 +1236,13 @@ int32_t CannedMessageModule::runOnce()
|
||||
this->cursor = 0;
|
||||
|
||||
// Tell Screen to jump straight to the TextMessage frame
|
||||
UIFrameEvent e;
|
||||
e.action = UIFrameEvent::Action::SWITCH_TO_TEXTMESSAGE;
|
||||
this->notifyObservers(&e);
|
||||
|
||||
// Now deactivate this module
|
||||
this->runState = CANNED_MESSAGE_RUN_STATE_INACTIVE;
|
||||
|
||||
return INT32_MAX; // don’t fall back into canned list
|
||||
return INT32_MAX; // don't fall back into canned list
|
||||
}
|
||||
} else {
|
||||
this->runState = CANNED_MESSAGE_RUN_STATE_INACTIVE;
|
||||
@@ -1255,11 +1253,10 @@ int32_t CannedMessageModule::runOnce()
|
||||
this->freetext = "";
|
||||
this->cursor = 0;
|
||||
|
||||
UIFrameEvent e;
|
||||
e.action = UIFrameEvent::Action::REGENERATE_FRAMESET;
|
||||
this->notifyObservers(&e);
|
||||
|
||||
// Immediately stop, don’t linger on canned screen
|
||||
// Immediately stop, don't linger on canned screen
|
||||
return INT32_MAX;
|
||||
}
|
||||
// Highlight [Select Destination] initially when entering the message list
|
||||
@@ -2070,7 +2067,7 @@ void CannedMessageModule::drawFrame(OLEDDisplay *display, OLEDDisplayUiState *st
|
||||
// Draw lines with emotes
|
||||
int rowHeight = FONT_HEIGHT_SMALL;
|
||||
int yLine = inputY;
|
||||
for (auto &line : lines) {
|
||||
for (const auto &line : lines) {
|
||||
int nextX = x;
|
||||
for (const auto &token : line) {
|
||||
if (token.first) {
|
||||
|
||||
Reference in New Issue
Block a user