Skip to content

Commit

Permalink
fix many warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
profezzorn committed Dec 30, 2024
1 parent db8fdbc commit f0e2ba0
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
6 changes: 5 additions & 1 deletion display/layer_controller.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
};
Expand Down Expand Up @@ -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

12 changes: 6 additions & 6 deletions display/rgb565frame.h
Original file line number Diff line number Diff line change
Expand Up @@ -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<size_t>(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);
Expand Down Expand Up @@ -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;
}
Expand All @@ -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);
}
Expand Down Expand Up @@ -534,7 +534,7 @@ class RGB565Frame : public SizedLayeredScreenControl<WIDTH, HEIGHT> {
MountSDCard();
frame_start_ = Cyclint<uint32_t>(micros());

for (layer = 0; layer < LAYERS; layer++) {
for (layer = 0; layer < (int)LAYERS; layer++) {
while (!layers[layer].SelectFrame(frame_start_)) YIELD();
}

Expand Down Expand Up @@ -590,7 +590,7 @@ class RGB565Frame : public SizedLayeredScreenControl<WIDTH, HEIGHT> {
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());
}
Expand All @@ -610,7 +610,7 @@ class RGB565Frame : public SizedLayeredScreenControl<WIDTH, HEIGHT> {
}

LayerControl* getLayer(int layer) override {
if (layer < 0 || layer >= LAYERS) return nullptr;
if (layer < 0 || layer >= (int)LAYERS) return nullptr;
return layers + layer;
}

Expand Down

0 comments on commit f0e2ba0

Please sign in to comment.