sw_engine: fixed declaration of 'i' shadows a previous local

Some gcc versions and configurations was giving an error: error:
"declaration of 'i' shadows a previous local"
This patch should fix these errors
This commit is contained in:
Michal Maciola 2022-01-14 14:06:39 +01:00 committed by Hermet Park
parent 43e5644e8b
commit a0895cc91b

View file

@ -1157,12 +1157,12 @@ static bool _rasterTranslucentLinearGradientRle(SwSurface* surface, const SwRleD
auto dst = &surface->buffer[span->y * surface->stride + span->x]; auto dst = &surface->buffer[span->y * surface->stride + span->x];
fillFetchLinear(fill, buffer, span->y, span->x, span->len); fillFetchLinear(fill, buffer, span->y, span->x, span->len);
if (span->coverage == 255) { if (span->coverage == 255) {
for (uint32_t i = 0; i < span->len; ++i, ++dst) { for (uint32_t x = 0; x < span->len; ++x, ++dst) {
*dst = buffer[i] + ALPHA_BLEND(*dst, _ialpha(buffer[i])); *dst = buffer[x] + ALPHA_BLEND(*dst, _ialpha(buffer[x]));
} }
} else { } else {
for (uint32_t i = 0; i < span->len; ++i, ++dst) { for (uint32_t x = 0; x < span->len; ++x, ++dst) {
auto tmp = ALPHA_BLEND(buffer[i], span->coverage); auto tmp = ALPHA_BLEND(buffer[x], span->coverage);
*dst = tmp + ALPHA_BLEND(*dst, _ialpha(tmp)); *dst = tmp + ALPHA_BLEND(*dst, _ialpha(tmp));
} }
} }
@ -1186,8 +1186,8 @@ static bool _rasterSolidLinearGradientRle(SwSurface* surface, const SwRleData* r
} else { } else {
fillFetchLinear(fill, buf, span->y, span->x, span->len); fillFetchLinear(fill, buf, span->y, span->x, span->len);
auto dst = &surface->buffer[span->y * surface->stride + span->x]; auto dst = &surface->buffer[span->y * surface->stride + span->x];
for (uint32_t i = 0; i < span->len; ++i) { for (uint32_t x = 0; x < span->len; ++x) {
dst[i] = INTERPOLATE(span->coverage, buf[i], dst[i]); dst[x] = INTERPOLATE(span->coverage, buf[x], dst[x]);
} }
} }
} }
@ -1350,12 +1350,12 @@ static bool _rasterTranslucentRadialGradientRle(SwSurface* surface, const SwRleD
auto dst = &surface->buffer[span->y * surface->stride + span->x]; auto dst = &surface->buffer[span->y * surface->stride + span->x];
fillFetchRadial(fill, buffer, span->y, span->x, span->len); fillFetchRadial(fill, buffer, span->y, span->x, span->len);
if (span->coverage == 255) { if (span->coverage == 255) {
for (uint32_t i = 0; i < span->len; ++i, ++dst) { for (uint32_t x = 0; x < span->len; ++x, ++dst) {
*dst = buffer[i] + ALPHA_BLEND(*dst, _ialpha(buffer[i])); *dst = buffer[x] + ALPHA_BLEND(*dst, _ialpha(buffer[x]));
} }
} else { } else {
for (uint32_t i = 0; i < span->len; ++i, ++dst) { for (uint32_t x = 0; x < span->len; ++x, ++dst) {
auto tmp = ALPHA_BLEND(buffer[i], span->coverage); auto tmp = ALPHA_BLEND(buffer[x], span->coverage);
*dst = tmp + ALPHA_BLEND(*dst, _ialpha(tmp)); *dst = tmp + ALPHA_BLEND(*dst, _ialpha(tmp));
} }
} }
@ -1380,8 +1380,8 @@ static bool _rasterSolidRadialGradientRle(SwSurface* surface, const SwRleData* r
} else { } else {
fillFetchRadial(fill, buf, span->y, span->x, span->len); fillFetchRadial(fill, buf, span->y, span->x, span->len);
auto ialpha = 255 - span->coverage; auto ialpha = 255 - span->coverage;
for (uint32_t i = 0; i < span->len; ++i, ++dst) { for (uint32_t x = 0; x < span->len; ++x, ++dst) {
*dst = ALPHA_BLEND(buf[i], span->coverage) + ALPHA_BLEND(*dst, ialpha); *dst = ALPHA_BLEND(buf[x], span->coverage) + ALPHA_BLEND(*dst, ialpha);
} }
} }
} }