]> granicus.if.org Git - imagemagick/commitdiff
...
authorCristy <urban-warrior@imagemagick.org>
Sat, 3 Mar 2018 20:04:05 +0000 (15:04 -0500)
committerCristy <urban-warrior@imagemagick.org>
Sat, 3 Mar 2018 20:04:05 +0000 (15:04 -0500)
MagickCore/vision.c
coders/pdf.c
coders/ps.c

index 500bf8d0121131d811cd42fab36fb81995295b7c..8b0c2f9ec0789aff2443960fefd665822d342a9d 100644 (file)
@@ -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;
index 71ef08e8a21c0f6575e3d7520069580aa499672b..b38d8f27480cc845bfc682f6f5889be9a84c7141 100644 (file)
@@ -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(),
index f8595287825e5bb8990a472b37b48232212761fb..dd1434e68a2f8f91396fdcfc897c8095a0ceb787 100644 (file)
@@ -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
         {