Mechanical refactor and code cleanup iteration#560
Merged
JanPetterMG merged 17 commits intomainfrom May 2, 2026
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request continues the mechanical refactor and static-analysis cleanup pass across the firmware codebase.
The changes are mostly non-functional, but a few small correctness and robustness fixes are included where the cleanup exposed unsafe casts, wraparound-prone loops, or brittle string handling.
Key changes
static inlinedeclaration order in headers.std::string_viewcomparisons.NOLINTannotations where conversions are intentional.lroundf()instead ofroundf()followed by integer casts for weather and thermometer values.uint8_t-sized ranges.PixelSequenceMode, draw-coordinate casts, and branch-clone suppressions.MetaballsMode::handle()to reduce nesting and make the microphone guard an early return.UINT8_MAX.hypotf(), clearer pitch-ratio calculations, and correct row/column bounds.CircleModeradius calculation and drawing so the effect better reflects the display geometry.std::string_view::data()to Server-Sent Events by materializing a null-terminated string first.Impact
This should reduce static-analysis noise and make the affected code easier to read and maintain without changing the public API or configuration format.
The main behavior-adjacent changes are limited to safer rendering/math internals, more robust action parsing, and corrected display geometry handling.