summaryrefslogtreecommitdiff
path: root/coders/txt.c
diff options
context:
space:
mode:
Diffstat (limited to 'coders/txt.c')
-rw-r--r--coders/txt.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/coders/txt.c b/coders/txt.c
index 58b004f0e..b9bd08ce5 100644
--- a/coders/txt.c
+++ b/coders/txt.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 %
@@ -273,7 +273,7 @@ static Image *ReadTEXTImage(const ImageInfo *image_info,
draw_info=DestroyDrawInfo(draw_info);
ThrowReaderException(TypeError,"UnableToGetTypeMetrics");
}
- page.y=(ssize_t) ceil((double) page.y+metrics.ascent-0.5);
+ page.y=CastDoubleToLong(ceil((double) page.y+metrics.ascent-0.5));
(void) FormatLocaleString(geometry,MagickPathExtent,"%gx%g%+g%+g",(double)
image->columns,(double) image->rows,(double) page.x,(double) page.y);
(void) CloneString(&draw_info->geometry,geometry);
@@ -403,11 +403,11 @@ static Image *ReadTXTImage(const ImageInfo *image_info,ExceptionInfo *exception)
QuantumAny
range;
- register ssize_t
+ ssize_t
i,
x;
- register Quantum
+ Quantum
*q;
ssize_t
@@ -458,7 +458,7 @@ static Image *ReadTXTImage(const ImageInfo *image_info,ExceptionInfo *exception)
image->rows=height;
if ((max_value == 0.0) || (max_value > 18446744073709551615.0))
ThrowReaderException(CorruptImageError,"ImproperImageHeader");
- for (depth=1; (GetQuantumRange(depth)+1.0) < max_value; depth++) ;
+ for (depth=1; ((double) GetQuantumRange(depth)+1) < max_value; depth++) ;
image->depth=depth;
status=SetImageExtent(image,image->columns,image->rows,exception);
if (status != MagickFalse)
@@ -574,8 +574,8 @@ static Image *ReadTXTImage(const ImageInfo *image_info,ExceptionInfo *exception)
MagickMax(black+0.5,0.0),range);
pixel.alpha=(MagickRealType) ScaleAnyToQuantum((QuantumAny)
MagickMax(alpha+0.5,0.0),range);
- q=GetAuthenticPixels(image,(ssize_t) x_offset,(ssize_t) y_offset,1,1,
- exception);
+ q=GetAuthenticPixels(image,CastDoubleToLong(x_offset),
+ CastDoubleToLong(y_offset),1,1,exception);
if (q == (Quantum *) NULL)
{
status=MagickFalse;
@@ -734,10 +734,10 @@ static MagickBooleanType WriteTXTImage(const ImageInfo *image_info,Image *image,
PixelInfo
pixel;
- register const Quantum
+ const Quantum
*p;
- register ssize_t
+ ssize_t
x;
size_t