Skip to content

Commit

Permalink
Core: Fix GCC warning about comparing integers of different signedness.
Browse files Browse the repository at this point in the history
  • Loading branch information
kaixiong committed Feb 24, 2023
1 parent 9a775ab commit 37de3dc
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion libvisual/libvisual/lv_alpha_blend.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,9 @@ namespace LV {
auto src2_ptr = reinterpret_cast<rgb16_t const*> (src2.data ());

auto size {static_cast<int> (std::min (dst.size (), src1.size ()))};
auto pixel_count {size / sizeof (rgb16_t)};

for (auto i = 0; i < size / sizeof (rgb16_t); i++) {
for (std::size_t i {0}; i < pixel_count; i++) {
dst_ptr[i].r = (alpha * (src2_ptr[i].r - src1_ptr[i].r)) / 255 + src1_ptr[i].r;
dst_ptr[i].g = (alpha * (src2_ptr[i].g - src1_ptr[i].g)) / 255 + src1_ptr[i].g;
dst_ptr[i].b = (alpha * (src2_ptr[i].b - src1_ptr[i].b)) / 255 + src1_ptr[i].b;
Expand Down

0 comments on commit 37de3dc

Please sign in to comment.