Skip to content

Commit

Permalink
Declare variables at start of function
Browse files Browse the repository at this point in the history
  • Loading branch information
radarhere committed Jun 22, 2024
1 parent 44da8b6 commit 5bdda4c
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/libImaging/Geometry.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
Imaging
ImagingFlipLeftRight(Imaging imOut, Imaging imIn) {
ImagingSectionCookie cookie;
// int x, y, xr;
int x, y, xr;

if (!imOut || !imIn || strcmp(imIn->mode, imOut->mode) != 0) {
return (Imaging)ImagingError_ModeError();
Expand All @@ -29,12 +29,11 @@ ImagingFlipLeftRight(Imaging imOut, Imaging imIn) {
ImagingCopyPalette(imOut, imIn);

ImagingSectionEnter(&cookie);
for (int y = 0; y < imIn->ysize; ++y) {
for (y = 0; y < imIn->ysize; ++y) {
char *in = imIn->image[y];
char *out = imOut->image[y];
int xr = imIn->linesize - imIn->pixelsize;
for (int x = 0; x < imIn->linesize;
x += imIn->pixelsize, xr -= imIn->pixelsize) {
xr = imIn->linesize - imIn->pixelsize;
for (x = 0; x < imIn->linesize; x += imIn->pixelsize, xr -= imIn->pixelsize) {
memcpy(out + xr, in + x, imIn->pixelsize);
}
}
Expand Down

0 comments on commit 5bdda4c

Please sign in to comment.