From 318fce37dc86f54817039b5a1c6f9ca81689eeb0 Mon Sep 17 00:00:00 2001 From: Cristy Date: Sat, 3 Mar 2018 15:04:05 -0500 Subject: [PATCH] ... --- MagickCore/vision.c | 31 +++++++++++++++++-------------- coders/pdf.c | 4 ++-- coders/ps.c | 2 +- 3 files changed, 20 insertions(+), 17 deletions(-) diff --git a/MagickCore/vision.c b/MagickCore/vision.c index 500bf8d01..8b0c2f9ec 100644 --- a/MagickCore/vision.c +++ b/MagickCore/vision.c @@ -564,19 +564,20 @@ MagickExport Image *ConnectedComponentsImage(const Image *image, { while ((isspace((int) ((unsigned char) *c)) != 0) || (*c == ',')) c++; - first=strtol(c,&c,10); + first=(ssize_t) strtol(c,&c,10); if (first < 0) - first+=(long) component_image->colors; + first+=(ssize_t) component_image->colors; last=first; while (isspace((int) ((unsigned char) *c)) != 0) c++; if (*c == '-') { - last=strtol(c+1,&c,10); + last=(ssize_t) strtol(c+1,&c,10); if (last < 0) - last+=(long) component_image->colors; + last+=(ssize_t) component_image->colors; } - for (step=first > last ? -1 : 1; first != (last+step); first+=step) + step=(ssize_t) (first > last ? -1 : 1); + for ( ; first != (last+step); first+=step) object[first].census++; } for (i=0; i < (ssize_t) component_image->colors; i++) @@ -584,7 +585,7 @@ MagickExport Image *ConnectedComponentsImage(const Image *image, if (object[i].census != 0) continue; component_image->alpha_trait=BlendPixelTrait; - component_image->colormap[i].alpha=TransparentAlpha; + component_image->colormap[i].alpha=(MagickRealType) TransparentAlpha; } } artifact=GetImageArtifact(image,"connected-components:remove"); @@ -597,22 +598,24 @@ MagickExport Image *ConnectedComponentsImage(const Image *image, { while ((isspace((int) ((unsigned char) *c)) != 0) || (*c == ',')) c++; - first=strtol(c,&c,10); + first=(ssize_t) strtol(c,&c,10); if (first < 0) - first+=(long) component_image->colors; + first+=(ssize_t) component_image->colors; last=first; while (isspace((int) ((unsigned char) *c)) != 0) c++; if (*c == '-') { - last=strtol(c+1,&c,10); + last=(ssize_t) strtol(c+1,&c,10); if (last < 0) - last+=(long) component_image->colors; + last+=(ssize_t) component_image->colors; } - for (step=first > last ? -1 : 1; first != (last+step); first+=step) + step=(ssize_t) (first > last ? -1 : 1); + for ( ; first != (last+step); first+=step) { component_image->alpha_trait=BlendPixelTrait; - component_image->colormap[first].alpha=TransparentAlpha; + component_image->colormap[first].alpha=(MagickRealType) + TransparentAlpha; } } } @@ -645,8 +648,8 @@ MagickExport Image *ConnectedComponentsImage(const Image *image, if (status == MagickFalse) continue; - p=GetCacheViewVirtualPixels(component_view,0,y, - component_image->columns,1,exception); + p=GetCacheViewVirtualPixels(component_view,0,y,component_image->columns, + 1,exception); if (p == (const Quantum *) NULL) { status=MagickFalse; diff --git a/coders/pdf.c b/coders/pdf.c index 71ef08e8a..b38d8f274 100644 --- a/coders/pdf.c +++ b/coders/pdf.c @@ -269,14 +269,14 @@ static MagickBooleanType InvokePDFDelegate(const MagickBooleanType verbose, SetArgsStart(command,args_start); if (status == -101) /* quit */ (void) FormatLocaleString(message,MagickPathExtent, - "[ghostscript library %.2f]%s: %s",(double)revision.revision / 100, + "[ghostscript library %.2f]%s: %s",(double)revision.revision/100.0, args_start,errors); else { (void) ThrowMagickException(exception,GetMagickModule(), DelegateError,"PDFDelegateFailed", "`[ghostscript library %.2f]%s': %s", - (double)revision.revision / 100,args_start,errors); + (double)revision.revision/100.0,args_start,errors); if (errors != (char *) NULL) errors=DestroyString(errors); (void) LogMagickEvent(CoderEvent,GetMagickModule(), diff --git a/coders/ps.c b/coders/ps.c index f85952878..dd1434e68 100644 --- a/coders/ps.c +++ b/coders/ps.c @@ -259,7 +259,7 @@ static MagickBooleanType InvokePostscriptDelegate( SetArgsStart(command,args_start); if (status == -101) /* quit */ (void) FormatLocaleString(message,MagickPathExtent, - "[ghostscript library %.2f]%s: %s",(double)revision.revision / 100, + "[ghostscript library %.2f]%s: %s",(double) revision.revision/100.0, args_start,errors); else { -- 2.40.0