Use anonymous namespaces for local consts

This commit is contained in:
Dave Allie 2025-12-17 23:19:10 +11:00
parent a9b4d99ac4
commit c0dc6b9067
No known key found for this signature in database
GPG Key ID: F2FDDB3AD8D0276F
6 changed files with 12 additions and 2 deletions

View File

@ -3,7 +3,9 @@
#include <HardwareSerial.h>
#include <Serialization.h>
namespace {
constexpr uint8_t PAGE_FILE_VERSION = 3;
}
void PageLine::render(GfxRenderer& renderer, const int fontId) { block->render(renderer, fontId, xPos, yPos); }

View File

@ -9,7 +9,9 @@
#include "Page.h"
#include "parsers/ChapterHtmlSlimParser.h"
namespace {
constexpr uint8_t SECTION_FILE_VERSION = 5;
}
void Section::onPageComplete(std::unique_ptr<Page> page) {
const auto filePath = cachePath + "/page_" + std::to_string(pageCount) + ".bin";

View File

@ -10,9 +10,11 @@
// Initialize the static instance
CrossPointSettings CrossPointSettings::instance;
namespace {
constexpr uint8_t SETTINGS_FILE_VERSION = 1;
constexpr uint8_t SETTINGS_COUNT = 2;
constexpr char SETTINGS_FILE[] = "/sd/.crosspoint/settings.bin";
} // namespace
bool CrossPointSettings::saveToFile() const {
// Make sure the directory exists

View File

@ -6,8 +6,10 @@
#include <fstream>
namespace {
constexpr uint8_t STATE_FILE_VERSION = 1;
constexpr char STATE_FILE[] = "/sd/.crosspoint/state.bin";
} // namespace
CrossPointState CrossPointState::instance;

View File

@ -5,6 +5,10 @@
#include "config.h"
namespace {
constexpr int menuItemCount = 2;
}
void HomeActivity::taskTrampoline(void* param) {
auto* self = static_cast<HomeActivity*>(param);
self->displayTaskLoop();

View File

@ -15,8 +15,6 @@ class HomeActivity final : public Activity {
const std::function<void()> onReaderOpen;
const std::function<void()> onSettingsOpen;
static constexpr int menuItemCount = 2;
static void taskTrampoline(void* param);
[[noreturn]] void displayTaskLoop();
void render() const;