1
0
mirror of https://github.com/esphome/esphome.git synced 2025-10-09 13:23:47 +01:00

[online_image] Fix clang-tidy sign comparison errors (#11041)

This commit is contained in:
J. Nick Koston
2025-10-06 09:07:04 -05:00
committed by GitHub
parent cfd241ff29
commit c68017ddb4
2 changed files with 6 additions and 3 deletions

View File

@@ -117,7 +117,8 @@ int HOT BmpDecoder::decode(uint8_t *buffer, size_t size) {
this->paint_index_++; this->paint_index_++;
this->current_index_ += 3; this->current_index_ += 3;
index += 3; index += 3;
if (x == this->width_ - 1 && this->padding_bytes_ > 0) { size_t last_col = static_cast<size_t>(this->width_) - 1;
if (x == last_col && this->padding_bytes_ > 0) {
index += this->padding_bytes_; index += this->padding_bytes_;
this->current_index_ += this->padding_bytes_; this->current_index_ += this->padding_bytes_;
} }

View File

@@ -25,8 +25,10 @@ static int draw_callback(JPEGDRAW *jpeg) {
// to avoid crashing. // to avoid crashing.
App.feed_wdt(); App.feed_wdt();
size_t position = 0; size_t position = 0;
for (size_t y = 0; y < jpeg->iHeight; y++) { size_t height = static_cast<size_t>(jpeg->iHeight);
for (size_t x = 0; x < jpeg->iWidth; x++) { size_t width = static_cast<size_t>(jpeg->iWidth);
for (size_t y = 0; y < height; y++) {
for (size_t x = 0; x < width; x++) {
auto rg = decode_value(jpeg->pPixels[position++]); auto rg = decode_value(jpeg->pPixels[position++]);
auto ba = decode_value(jpeg->pPixels[position++]); auto ba = decode_value(jpeg->pPixels[position++]);
Color color(rg[1], rg[0], ba[1], ba[0]); Color color(rg[1], rg[0], ba[1], ba[0]);