Skip to content

Commit

Permalink
FIX: 'for' loop initial declarations
Browse files Browse the repository at this point in the history
  • Loading branch information
Oldes committed Jan 13, 2022
1 parent 9ed043e commit a8fbea0
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions src/core/u-image-resize.c
Original file line number Diff line number Diff line change
Expand Up @@ -498,7 +498,7 @@ HorizontalFilter(const REBSER *source, REBSER *destination, REBSER *data_set,
for (x=0; x < (long) IMG_WIDE(destination); x++) {
REBDEC center;
REBDEC density = 0.0;
REBINT n, start, stop;
REBINT n, start, stop, i, j;

center = (REBDEC) (x+0.5)/x_factor;
start = (REBINT) MAX(center-support+0.5,0);
Expand All @@ -513,13 +513,12 @@ HorizontalFilter(const REBSER *source, REBSER *destination, REBSER *data_set,
if ((density != 0.0) && (density != 1.0)) {
// Normalize.
density = 1.0 / density;
for (i32 i=0; i < n; i++)
for (i=0; i < n; i++)
contribution[i].weight*=density;
}

for (y=0; y < (long) IMG_HIGH(destination); y++) {
REBDEC weight;
REBINT j, i;
DoublePixelPacket pixel = zero;

if (has_alpha) {
Expand Down Expand Up @@ -586,7 +585,7 @@ VerticalFilter(const REBSER *source, REBSER *destination, REBSER *data_set,
for (y=0; y < (long) IMG_HIGH(destination); y++) {
REBDEC center;
REBDEC density = 0.0;
REBINT n, start, stop;
REBINT n, start, stop, i, j;
ContributionInfo *contribution = (ContributionInfo*)SERIES_DATA(data_set);

center = (REBDEC)(y+0.5) / y_factor;
Expand All @@ -601,12 +600,11 @@ VerticalFilter(const REBSER *source, REBSER *destination, REBSER *data_set,
if ((density != 0.0) && (density != 1.0)) {
// Normalize.
density = 1.0 / density;
for (i32 i=0; i < n; i++)
for (i=0; i < n; i++)
contribution[i].weight *= density;
}
for (x=0; x < (long) IMG_WIDE(destination); x++) {
REBDEC weight;
REBINT j, i;
DoublePixelPacket pixel = zero;

if (has_alpha) {
Expand Down

0 comments on commit a8fbea0

Please sign in to comment.