From b53ac3d52cc9c685b2dd2b33d94958d929b41343 Mon Sep 17 00:00:00 2001 From: Zach Nelson Date: Mon, 25 May 2026 11:39:28 -0500 Subject: [PATCH] chore: Minor cleanup flagged by newer gcc (#2140) ## Summary Minor cleanup flagged by newer gcc: - Removed unused variables - Removed unimplemented function declaration - `static` -> `inline` to avoid per-TU duplication --- ### AI Usage Did you use AI tools to help write this code? _**NO**_ --- lib/FsHelpers/FsHelpers.cpp | 2 -- lib/GfxRenderer/GfxRenderer.cpp | 2 -- lib/Serialization/Serialization.h | 16 ++++++++-------- src/components/themes/BaseTheme.cpp | 3 --- 4 files changed, 8 insertions(+), 15 deletions(-) diff --git a/lib/FsHelpers/FsHelpers.cpp b/lib/FsHelpers/FsHelpers.cpp index 891190fd..a73f8901 100644 --- a/lib/FsHelpers/FsHelpers.cpp +++ b/lib/FsHelpers/FsHelpers.cpp @@ -59,8 +59,6 @@ void sortFileList(std::vector& strs) { // Check if both are at the start of a number if (isdigit(*s1) && isdigit(*s2)) { // Skip leading zeros and track them - const char* start1 = s1; - const char* start2 = s2; while (*s1 == '0') s1++; while (*s2 == '0') s2++; diff --git a/lib/GfxRenderer/GfxRenderer.cpp b/lib/GfxRenderer/GfxRenderer.cpp index 57a8a937..a294531a 100644 --- a/lib/GfxRenderer/GfxRenderer.cpp +++ b/lib/GfxRenderer/GfxRenderer.cpp @@ -12,8 +12,6 @@ namespace { -const char* resolveVisualText(const char* text, std::string& visualBuffer, int paragraphLevel); - /** * Resolves the requested style to the best available style in the given SD card font. * Falls back gracefully when the font lacks the requested variant. diff --git a/lib/Serialization/Serialization.h b/lib/Serialization/Serialization.h index 1308822f..878a2b92 100644 --- a/lib/Serialization/Serialization.h +++ b/lib/Serialization/Serialization.h @@ -5,45 +5,45 @@ namespace serialization { template -static void writePod(std::ostream& os, const T& value) { +void writePod(std::ostream& os, const T& value) { os.write(reinterpret_cast(&value), sizeof(T)); } template -static void writePod(FsFile& file, const T& value) { +void writePod(FsFile& file, const T& value) { file.write(reinterpret_cast(&value), sizeof(T)); } template -static void readPod(std::istream& is, T& value) { +void readPod(std::istream& is, T& value) { is.read(reinterpret_cast(&value), sizeof(T)); } template -static void readPod(FsFile& file, T& value) { +void readPod(FsFile& file, T& value) { file.read(reinterpret_cast(&value), sizeof(T)); } -static void writeString(std::ostream& os, const std::string& s) { +inline void writeString(std::ostream& os, const std::string& s) { const uint32_t len = s.size(); writePod(os, len); os.write(s.data(), len); } -static void writeString(FsFile& file, const std::string& s) { +inline void writeString(FsFile& file, const std::string& s) { const uint32_t len = s.size(); writePod(file, len); file.write(reinterpret_cast(s.data()), len); } -static void readString(std::istream& is, std::string& s) { +inline void readString(std::istream& is, std::string& s) { uint32_t len; readPod(is, len); s.resize(len); is.read(&s[0], len); } -static void readString(FsFile& file, std::string& s) { +inline void readString(FsFile& file, std::string& s) { uint32_t len; readPod(file, len); s.resize(len); diff --git a/src/components/themes/BaseTheme.cpp b/src/components/themes/BaseTheme.cpp index de3f5450..beee312b 100644 --- a/src/components/themes/BaseTheme.cpp +++ b/src/components/themes/BaseTheme.cpp @@ -269,7 +269,6 @@ void BaseTheme::drawList(const GfxRenderer& renderer, Rect rect, int itemCount, if (selectedIndex >= 0) { renderer.fillRect(rect.x, rect.y + selectedIndex % pageItems * rowHeight - 2, rect.width, rowHeight); } - constexpr int maxValueWidth = 200; constexpr int minValueGap = 10; // Draw all items @@ -358,8 +357,6 @@ void BaseTheme::drawHeader(const GfxRenderer& renderer, Rect rect, const char* t } void BaseTheme::drawSubHeader(const GfxRenderer& renderer, Rect rect, const char* label, const char* rightLabel) const { - constexpr int underlineHeight = 2; // Height of selection underline - constexpr int underlineGap = 4; // Gap between text and underline constexpr int maxListValueWidth = 200; int currentX = rect.x + BaseMetrics::values.contentSidePadding;