]> granicus.if.org Git - imagemagick/blobdiff - coders/palm.c
(no commit message)
[imagemagick] / coders / palm.c
index 15b920c69949fce5f4573ebb265de34b6950f2d7..9a0b45f9057afe166c0ee40d52ac560f2ef9d5b3 100644 (file)
@@ -227,7 +227,7 @@ static int FindColor(PixelPacket *pixel)
 %
 */
 
-static inline ssize_t MagickMax(const ssize_t x,const ssize_t y)
+static inline size_t MagickMax(const size_t x,const size_t y)
 {
   if (x > y)
     return(x);
@@ -439,8 +439,12 @@ static Image *ReadPALMImage(const ImageInfo *image_info,
           }
         else
           if (compressionType == PALM_COMPRESSION_SCANLINE)
-            {  
+            {
+              size_t
+                one;
+
               /* TODO move out of loop! */
+              one=1;
               image->compression=FaxCompression;
               for (i=0; i < (ssize_t) bytes_per_row; i+=8)
               {
@@ -448,7 +452,7 @@ static Image *ReadPALMImage(const ImageInfo *image_info,
                 byte=1UL*MagickMin((ssize_t) bytes_per_row-i,8);
                 for (bit=0; bit < byte; bit++)
                 {
-                  if ((y == 0) || (count & (1 << (7 - bit))))
+                  if ((y == 0) || (count & (one << (7 - bit))))
                     one_row[i+bit]=(unsigned char) ReadBlobByte(image);
                   else
                     one_row[i+bit]=lastrow[i+bit];
@@ -879,7 +883,7 @@ static MagickBooleanType WritePALMImage(const ImageInfo *image_info,
                 MagickMax(1*image->colors-1,1));
             byte|=color << bit;
             if (bit != 0)
-              bit-=(ssize_t) bits_per_pixel;
+              bit-=(unsigned char) bits_per_pixel;
             else
               {
                 *ptr++=byte;