From f0e2ba08eabea501c5af6d5628f26d654379d486 Mon Sep 17 00:00:00 2001 From: profezzorn Date: Mon, 30 Dec 2024 03:47:57 -0600 Subject: [PATCH] fix many warnings --- display/layer_controller.h | 6 +++++- display/rgb565frame.h | 12 ++++++------ 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/display/layer_controller.h b/display/layer_controller.h index 2490a24d3..8a76274d7 100644 --- a/display/layer_controller.h +++ b/display/layer_controller.h @@ -94,7 +94,7 @@ class LayerControl { public: virtual void LC_setVariable(int variable, VariableSource* variable_source) = 0; virtual const char* LC_get_filename() = 0; - virtual const void LC_restart() = 0; + virtual void LC_restart() = 0; virtual void LC_play(const char* filename) = 0; virtual void LC_set_time(uint32_t millis) = 0; }; @@ -577,5 +577,9 @@ class StandarColorDisplayController : public SaberBase, public Looper, public Co volatile Tristate looped_idle_ = Tristate::Unknown; }; +#undef ONCE_PER_EFFECT +#undef INIT_SCR +#undef DEF_SCR + #endif diff --git a/display/rgb565frame.h b/display/rgb565frame.h index 8eb9150ff..868634f92 100644 --- a/display/rgb565frame.h +++ b/display/rgb565frame.h @@ -155,7 +155,7 @@ class PQOILayer : public BufferedFileReader, public LayerControl { YIELD(); } TRACE(RGB565, "layer::run::copy"); - size_t to_copy = min(read_end_ - read_pos_, input_buffer_.continuous_data()); + size_t to_copy = std::min(read_end_ - read_pos_, input_buffer_.continuous_data()); PROFFIEOS_ASSERT(to_copy <= 16); memcpy(read_pos_, input_buffer_.data(), to_copy); input_buffer_.pop(to_copy); @@ -369,7 +369,7 @@ class PQOILayer : public BufferedFileReader, public LayerControl { void LC_setVariable(int variable, VariableSource* variable_source) override { TRACE(RGB565, "setVariable"); - if (variable < 0 || variable >= NELEM(variables)) { + if (variable < 0 || variable >= (int)NELEM(variables)) { STDERR << "Illegal variable!\n"; return; } @@ -378,7 +378,7 @@ class PQOILayer : public BufferedFileReader, public LayerControl { const char* LC_get_filename() override { return file_.GetFilename(); } - const void LC_restart() override { + void LC_restart() override { TRACE(RGB565, "LC_restart"); SEEK(0); } @@ -534,7 +534,7 @@ class RGB565Frame : public SizedLayeredScreenControl { MountSDCard(); frame_start_ = Cyclint(micros()); - for (layer = 0; layer < LAYERS; layer++) { + for (layer = 0; layer < (int)LAYERS; layer++) { while (!layers[layer].SelectFrame(frame_start_)) YIELD(); } @@ -590,7 +590,7 @@ class RGB565Frame : public SizedLayeredScreenControl { loop_counter_.Update(); next_frame_time_ = frame_start_ + MAX_FRAME_TIME_US; - for (int l = 0; l < LAYERS; l++) { + for (size_t l = 0; l < LAYERS; l++) { if (layers[l].is_playing()) { next_frame_time_ = std::min(next_frame_time_, layers[l].next_frame_time()); } @@ -610,7 +610,7 @@ class RGB565Frame : public SizedLayeredScreenControl { } LayerControl* getLayer(int layer) override { - if (layer < 0 || layer >= LAYERS) return nullptr; + if (layer < 0 || layer >= (int)LAYERS) return nullptr; return layers + layer; }