]> granicus.if.org Git - imagemagick/commitdiff
(no commit message)
authorcristy <urban-warrior@git.imagemagick.org>
Mon, 18 May 2015 00:12:46 +0000 (00:12 +0000)
committercristy <urban-warrior@git.imagemagick.org>
Mon, 18 May 2015 00:12:46 +0000 (00:12 +0000)
MagickCore/blob.c

index 2c2d78693ecf02f651d2d83cd5b7cdc6bf0274d2..a2c7d9272a374ff9dc50bf37990e4950dc68acaf 100644 (file)
@@ -1133,7 +1133,7 @@ static inline ssize_t WriteBlobStream(Image *image,const size_t length,
   assert(image->blob->type != UndefinedStream);
   assert(data != NULL);
   if (image->blob->type != BlobStream)
-    return(WriteBlob(image,length,data));
+    return(WriteBlob(image,length,(const unsigned char *) data));
   extent=(MagickSizeType) (image->blob->offset+(MagickOffsetType) length);
   if (extent >= image->blob->extent)
     {
@@ -1529,7 +1529,7 @@ MagickExport void *ImageToBlob(const ImageInfo *image_info,
   MagickBooleanType
     status;
 
-  unsigned char
+  void
     *blob;
 
   assert(image_info != (const ImageInfo *) NULL);
@@ -1577,10 +1577,9 @@ MagickExport void *ImageToBlob(const ImageInfo *image_info,
           *length=image->blob->length;
           blob=DetachBlob(image->blob);
           if (status == MagickFalse)
-            blob=(unsigned char *) RelinquishMagickMemory(blob);
+            blob=RelinquishMagickMemory(blob);
           else
-            blob=(unsigned char *) ResizeQuantumMemory(blob,*length+1,
-              sizeof(*blob));
+            blob=ResizeQuantumMemory(blob,*length+1,sizeof(unsigned char));
         }
     }
   else
@@ -1605,8 +1604,8 @@ MagickExport void *ImageToBlob(const ImageInfo *image_info,
           blob_info->file=fdopen(file,"wb");
           if (blob_info->file != (FILE *) NULL)
             {
-              (void) FormatLocaleString(image->filename,MagickPathExtent,"%s:%s",
-                image->magick,unique);
+              (void) FormatLocaleString(image->filename,MagickPathExtent,
+                "%s:%s",image->magick,unique);
               status=WriteImage(blob_info,image,exception);
               (void) CloseBlob(image);
               (void) fclose(blob_info->file);
@@ -1705,8 +1704,8 @@ MagickExport MagickBooleanType ImageToFile(Image *image,char *filename,
       return(MagickFalse);
     }
   length=0;
-  p=ReadBlobStream(image,quantum,buffer,&count);
-  for (i=0; count > 0; p=ReadBlobStream(image,quantum,buffer,&count))
+  p=(const unsigned char *) ReadBlobStream(image,quantum,buffer,&count);
+  for (i=0; count > 0; p=(const unsigned char *) ReadBlobStream(image,quantum,buffer,&count))
   {
     length=(size_t) count;
     for (i=0; i < length; i+=count)
@@ -1782,7 +1781,7 @@ MagickExport void *ImagesToBlob(const ImageInfo *image_info,Image *images,
   MagickBooleanType
     status;
 
-  unsigned char
+  void
     *blob;
 
   assert(image_info != (const ImageInfo *) NULL);
@@ -1835,10 +1834,9 @@ MagickExport void *ImagesToBlob(const ImageInfo *image_info,Image *images,
           *length=images->blob->length;
           blob=DetachBlob(images->blob);
           if (status == MagickFalse)
-            blob=(unsigned char *) RelinquishMagickMemory(blob);
+            blob=RelinquishMagickMemory(blob);
           else
-            blob=(unsigned char *) ResizeQuantumMemory(blob,*length+1,
-              sizeof(*blob));
+            blob=ResizeQuantumMemory(blob,*length+1,sizeof(unsigned char));
         }
     }
   else
@@ -2827,7 +2825,7 @@ MagickExport ssize_t ReadBlob(Image *image,const size_t length,void *data)
     return(0);
   assert(data != (void *) NULL);
   count=0;
-  q=data;
+  q=(unsigned char *) data;
   switch (image->blob->type)
   {
     case UndefinedStream:
@@ -2949,8 +2947,8 @@ MagickExport ssize_t ReadBlob(Image *image,const size_t length,void *data)
           break;
         }
       p=image->blob->data+image->blob->offset;
-      count=(ssize_t) MagickMin((MagickOffsetType) length,image->blob->length-
-        image->blob->offset);
+      count=(ssize_t) MagickMin((MagickOffsetType) length,(MagickOffsetType)
+        image->blob->length-image->blob->offset);
       image->blob->offset+=count;
       if (count != (ssize_t) length)
         image->blob->eof=MagickTrue;
@@ -2996,7 +2994,7 @@ MagickExport int ReadBlobByte(Image *image)
 
   assert(image != (Image *) NULL);
   assert(image->signature == MagickSignature);
-  p=ReadBlobStream(image,1,buffer,&count);
+  p=(const unsigned char *) ReadBlobStream(image,1,buffer,&count);
   if (count != 1)
     return(EOF);
   return((int) (*p));
@@ -3120,7 +3118,7 @@ MagickExport unsigned int ReadBlobLong(Image *image)
   assert(image != (Image *) NULL);
   assert(image->signature == MagickSignature);
   *buffer='\0';
-  p=ReadBlobStream(image,4,buffer,&count);
+  p=(const unsigned char *) ReadBlobStream(image,4,buffer,&count);
   if (count != 4)
     return(0UL);
   if (image->endian == LSBEndian)
@@ -3178,7 +3176,7 @@ MagickExport MagickSizeType ReadBlobLongLong(Image *image)
   assert(image != (Image *) NULL);
   assert(image->signature == MagickSignature);
   *buffer='\0';
-  p=ReadBlobStream(image,8,buffer,&count);
+  p=(const unsigned char *) ReadBlobStream(image,8,buffer,&count);
   if (count != 8)
     return(MagickULLConstant(0));
   if (image->endian == LSBEndian)
@@ -3244,7 +3242,7 @@ MagickExport unsigned short ReadBlobShort(Image *image)
   assert(image != (Image *) NULL);
   assert(image->signature == MagickSignature);
   *buffer='\0';
-  p=ReadBlobStream(image,2,buffer,&count);
+  p=(const unsigned char *) ReadBlobStream(image,2,buffer,&count);
   if (count != 2)
     return((unsigned short) 0U);
   if (image->endian == LSBEndian)
@@ -3298,7 +3296,7 @@ MagickExport unsigned int ReadBlobLSBLong(Image *image)
   assert(image != (Image *) NULL);
   assert(image->signature == MagickSignature);
   *buffer='\0';
-  p=ReadBlobStream(image,4,buffer,&count);
+  p=(const unsigned char *) ReadBlobStream(image,4,buffer,&count);
   if (count != 4)
     return(0U);
   value=(unsigned int) (*p++);
@@ -3348,7 +3346,7 @@ MagickExport unsigned short ReadBlobLSBShort(Image *image)
   assert(image != (Image *) NULL);
   assert(image->signature == MagickSignature);
   *buffer='\0';
-  p=ReadBlobStream(image,2,buffer,&count);
+  p=(const unsigned char *) ReadBlobStream(image,2,buffer,&count);
   if (count != 2)
     return((unsigned short) 0U);
   value=(unsigned int) (*p++);
@@ -3396,7 +3394,7 @@ MagickExport unsigned int ReadBlobMSBLong(Image *image)
   assert(image != (Image *) NULL);
   assert(image->signature == MagickSignature);
   *buffer='\0';
-  p=ReadBlobStream(image,4,buffer,&count);
+  p=(const unsigned char *) ReadBlobStream(image,4,buffer,&count);
   if (count != 4)
     return(0UL);
   value=((unsigned int) (*p++) << 24);
@@ -3446,7 +3444,7 @@ MagickExport MagickSizeType ReadBlobMSBLongLong(Image *image)
   assert(image != (Image *) NULL);
   assert(image->signature == MagickSignature);
   *buffer='\0';
-  p=ReadBlobStream(image,8,buffer,&count);
+  p=(const unsigned char *) ReadBlobStream(image,8,buffer,&count);
   if (count != 8)
     return(MagickULLConstant(0));
   value=((MagickSizeType) (*p++)) << 56;
@@ -3500,7 +3498,7 @@ MagickExport unsigned short ReadBlobMSBShort(Image *image)
   assert(image != (Image *) NULL);
   assert(image->signature == MagickSignature);
   *buffer='\0';
-  p=ReadBlobStream(image,2,buffer,&count);
+  p=(const unsigned char *) ReadBlobStream(image,2,buffer,&count);
   if (count != 2)
     return((unsigned short) 0U);
   value=(unsigned int) ((*p++) << 8);
@@ -3554,7 +3552,7 @@ MagickExport const void *ReadBlobStream(Image *image,const size_t length,
   if (image->blob->type != BlobStream)
     {
       assert(data != NULL);
-      *count=ReadBlob(image,length,data);
+      *count=ReadBlob(image,length,(unsigned char *) data);
       return(data);
     }
   if (image->blob->offset >= (MagickOffsetType) image->blob->length)
@@ -3564,8 +3562,8 @@ MagickExport const void *ReadBlobStream(Image *image,const size_t length,
       return(data);
     }
   data=image->blob->data+image->blob->offset;
-  *count=(ssize_t) MagickMin((MagickOffsetType) length,image->blob->length-
-    image->blob->offset);
+  *count=(ssize_t) MagickMin((MagickOffsetType) length,(MagickOffsetType)
+    image->blob->length-image->blob->offset);
   image->blob->offset+=(*count);
   if (*count != (ssize_t) length)
     image->blob->eof=MagickTrue;
@@ -3615,7 +3613,7 @@ MagickExport char *ReadBlobString(Image *image,char *string)
   assert(image->signature == MagickSignature);
   for (i=0; i < (MagickPathExtent-1L); i++)
   {
-    p=ReadBlobStream(image,1,buffer,&count);
+    p=(const unsigned char *) ReadBlobStream(image,1,buffer,&count);
     if (count != 1)
       {
         if (i == 0)