1
0
mirror of https://github.com/esphome/esphome.git synced 2025-10-08 04:43:46 +01:00

[animation] Fix clang-tidy sign comparison errors (#11042)

This commit is contained in:
J. Nick Koston
2025-10-06 09:07:44 -05:00
committed by GitHub
parent c68017ddb4
commit 5cf0046601

View File

@@ -26,12 +26,12 @@ uint32_t Animation::get_animation_frame_count() const { return this->animation_f
int Animation::get_current_frame() const { return this->current_frame_; } int Animation::get_current_frame() const { return this->current_frame_; }
void Animation::next_frame() { void Animation::next_frame() {
this->current_frame_++; this->current_frame_++;
if (loop_count_ && this->current_frame_ == loop_end_frame_ && if (loop_count_ && static_cast<uint32_t>(this->current_frame_) == loop_end_frame_ &&
(this->loop_current_iteration_ < loop_count_ || loop_count_ < 0)) { (this->loop_current_iteration_ < loop_count_ || loop_count_ < 0)) {
this->current_frame_ = loop_start_frame_; this->current_frame_ = loop_start_frame_;
this->loop_current_iteration_++; this->loop_current_iteration_++;
} }
if (this->current_frame_ >= animation_frame_count_) { if (static_cast<uint32_t>(this->current_frame_) >= animation_frame_count_) {
this->loop_current_iteration_ = 1; this->loop_current_iteration_ = 1;
this->current_frame_ = 0; this->current_frame_ = 0;
} }