diff options
Diffstat (limited to 'coders/histogram.c')
-rw-r--r-- | coders/histogram.c | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/coders/histogram.c b/coders/histogram.c index 1f2a31a9b..40a7198e7 100644 --- a/coders/histogram.c +++ b/coders/histogram.c @@ -17,7 +17,7 @@ % July 1992 % % % % % -% Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization % +% Copyright 1999-2021 ImageMagick Studio LLC, a non-profit organization % % dedicated to making software imaging solutions freely available. % % % % You may not use this file except in compliance with the License. You may % @@ -199,14 +199,14 @@ static MagickBooleanType WriteHISTOGRAMImage(const ImageInfo *image_info, RectangleInfo geometry; - register const Quantum + const Quantum *p; - register Quantum + Quantum *q, *r; - register ssize_t + ssize_t x; size_t @@ -295,7 +295,8 @@ static MagickBooleanType WriteHISTOGRAMImage(const ImageInfo *image_info, break; if ((GetPixelRedTraits(image) & UpdatePixelTrait) != 0) { - y=(ssize_t) ceil(histogram_image->rows-scale*histogram[x].red-0.5); + y=CastDoubleToLong(ceil(histogram_image->rows-scale* + histogram[x].red-0.5)); r=q+y*GetPixelChannels(histogram_image); for ( ; y < (ssize_t) histogram_image->rows; y++) { @@ -305,7 +306,8 @@ static MagickBooleanType WriteHISTOGRAMImage(const ImageInfo *image_info, } if ((GetPixelGreenTraits(image) & UpdatePixelTrait) != 0) { - y=(ssize_t) ceil(histogram_image->rows-scale*histogram[x].green-0.5); + y=CastDoubleToLong(ceil(histogram_image->rows-scale* + histogram[x].green-0.5)); r=q+y*GetPixelChannels(histogram_image); for ( ; y < (ssize_t) histogram_image->rows; y++) { @@ -315,7 +317,8 @@ static MagickBooleanType WriteHISTOGRAMImage(const ImageInfo *image_info, } if ((GetPixelBlueTraits(image) & UpdatePixelTrait) != 0) { - y=(ssize_t) ceil(histogram_image->rows-scale*histogram[x].blue-0.5); + y=CastDoubleToLong(ceil(histogram_image->rows-scale* + histogram[x].blue-0.5)); r=q+y*GetPixelChannels(histogram_image); for ( ; y < (ssize_t) histogram_image->rows; y++) { |