Skip to content

Commit

Permalink
declare variables before loop
Browse files Browse the repository at this point in the history
  • Loading branch information
Yay295 committed Jul 5, 2023
1 parent d3a9226 commit 8b23215
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/_imaging.c
Original file line number Diff line number Diff line change
Expand Up @@ -3747,17 +3747,19 @@ _compare_pixels(

if (mask == 0xffffffff) {
// If we aren't masking anything we can use memcmp.
for (int y = 0; y < ysize; y++) {
int y;
for (y = 0; y < ysize; y++) {
if (memcmp(pixels_a[y], pixels_b[y], linesize)) {
return 1;
}
}
} else {
const int xsize = linesize / 4;
for (int y = 0; y < ysize; y++) {
int y, x;
for (y = 0; y < ysize; y++) {
UINT32 *line_a = (UINT32*)pixels_a[y];
UINT32 *line_b = (UINT32*)pixels_b[y];
for (int x = 0; x < xsize; x++, line_a++, line_b++) {
for (x = 0; x < xsize; x++, line_a++, line_b++) {
if ((*line_a & mask) != (*line_b & mask)) {
return 1;
}
Expand Down

0 comments on commit 8b23215

Please sign in to comment.