mirror of
https://github.com/ImageMagick/ImageMagick.git
synced 2026-05-25 11:24:54 +02:00
eliminate compiler warnings
This commit is contained in:
+10
-9
@@ -428,7 +428,7 @@ static Image *ReadHDRImage(const ImageInfo *image_info,ExceptionInfo *exception)
|
||||
p=pixels;
|
||||
for (i=0; i < 4; i++)
|
||||
{
|
||||
end=&pixels[(i+1)*image->columns];
|
||||
end=&pixels[(i+1)*(ssize_t) image->columns];
|
||||
while (p < end)
|
||||
{
|
||||
count=ReadBlob(image,2*sizeof(*pixel),pixel);
|
||||
@@ -469,9 +469,9 @@ static Image *ReadHDRImage(const ImageInfo *image_info,ExceptionInfo *exception)
|
||||
if (image->compression == RLECompression)
|
||||
{
|
||||
pixel[0]=pixels[x];
|
||||
pixel[1]=pixels[x+image->columns];
|
||||
pixel[2]=pixels[x+2*image->columns];
|
||||
pixel[3]=pixels[x+3*image->columns];
|
||||
pixel[1]=pixels[x+(ssize_t) image->columns];
|
||||
pixel[2]=pixels[x+2*(ssize_t) image->columns];
|
||||
pixel[3]=pixels[x+3*(ssize_t) image->columns];
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -645,7 +645,7 @@ static size_t HDRWriteRunlengthPixels(Image *image,unsigned char *pixels)
|
||||
break;
|
||||
if (WriteBlob(image,(size_t) count*sizeof(*pixel),&pixels[p]) < 1)
|
||||
break;
|
||||
p+=count;
|
||||
p+=(size_t) count;
|
||||
}
|
||||
if (runlength >= MinimumRunlength)
|
||||
{
|
||||
@@ -802,9 +802,9 @@ static MagickBooleanType WriteHDRImage(const ImageInfo *image_info,Image *image,
|
||||
if ((image->columns >= 8) && (image->columns <= 0x7ffff))
|
||||
{
|
||||
pixels[x]=pixel[0];
|
||||
pixels[x+image->columns]=pixel[1];
|
||||
pixels[x+2*image->columns]=pixel[2];
|
||||
pixels[x+3*image->columns]=pixel[3];
|
||||
pixels[x+(ssize_t) image->columns]=pixel[1];
|
||||
pixels[x+2*(ssize_t) image->columns]=pixel[2];
|
||||
pixels[x+3*(ssize_t) image->columns]=pixel[3];
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -818,7 +818,8 @@ static MagickBooleanType WriteHDRImage(const ImageInfo *image_info,Image *image,
|
||||
if ((image->columns >= 8) && (image->columns <= 0x7ffff))
|
||||
{
|
||||
for (i=0; i < 4; i++)
|
||||
length=HDRWriteRunlengthPixels(image,&pixels[i*image->columns]);
|
||||
length=HDRWriteRunlengthPixels(image,
|
||||
&pixels[i*(ssize_t) image->columns]);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
+3
-3
@@ -300,7 +300,7 @@ static MagickBooleanType WriteHISTOGRAMImage(const ImageInfo *image_info,
|
||||
{
|
||||
y=CastDoubleToLong(ceil((double) histogram_image->rows-scale*
|
||||
histogram[x].red-0.5));
|
||||
r=q+y*GetPixelChannels(histogram_image);
|
||||
r=q+y*(ssize_t) GetPixelChannels(histogram_image);
|
||||
for ( ; y < (ssize_t) histogram_image->rows; y++)
|
||||
{
|
||||
SetPixelRed(histogram_image,QuantumRange,r);
|
||||
@@ -311,7 +311,7 @@ static MagickBooleanType WriteHISTOGRAMImage(const ImageInfo *image_info,
|
||||
{
|
||||
y=CastDoubleToLong(ceil((double) histogram_image->rows-scale*
|
||||
histogram[x].green-0.5));
|
||||
r=q+y*GetPixelChannels(histogram_image);
|
||||
r=q+y*(ssize_t) GetPixelChannels(histogram_image);
|
||||
for ( ; y < (ssize_t) histogram_image->rows; y++)
|
||||
{
|
||||
SetPixelGreen(histogram_image,QuantumRange,r);
|
||||
@@ -322,7 +322,7 @@ static MagickBooleanType WriteHISTOGRAMImage(const ImageInfo *image_info,
|
||||
{
|
||||
y=CastDoubleToLong(ceil((double) histogram_image->rows-scale*
|
||||
histogram[x].blue-0.5));
|
||||
r=q+y*GetPixelChannels(histogram_image);
|
||||
r=q+y*(ssize_t) GetPixelChannels(histogram_image);
|
||||
for ( ; y < (ssize_t) histogram_image->rows; y++)
|
||||
{
|
||||
SetPixelBlue(histogram_image,QuantumRange,r);
|
||||
|
||||
+4
-3
@@ -277,8 +277,8 @@ static MagickBooleanType WriteHTMLImage(const ImageInfo *image_info,
|
||||
(void) CopyMagickString(url,image_info->magick,MagickPathExtent);
|
||||
(void) ConcatenateMagickString(url,":",MagickPathExtent);
|
||||
url[strlen(url)+p-image->filename]='\0';
|
||||
(void) ConcatenateMagickString(url,image->filename,
|
||||
p-image->filename+2);
|
||||
(void) ConcatenateMagickString(url,image->filename,(size_t)
|
||||
(p-image->filename+2));
|
||||
(void) CopyMagickString(image->filename,p,MagickPathExtent);
|
||||
}
|
||||
}
|
||||
@@ -373,7 +373,8 @@ static MagickBooleanType WriteHTMLImage(const ImageInfo *image_info,
|
||||
(void) FormatLocaleString(buffer,MagickPathExtent,"\" shape="
|
||||
"\"rect\" coords=\"%.20g,%.20g,%.20g,%.20g\" alt=\"\" />\n",
|
||||
(double) geometry.x,(double) geometry.y,(double) (geometry.x+
|
||||
geometry.width-1),(double) (geometry.y+geometry.height-1));
|
||||
(ssize_t) geometry.width-1),(double) (geometry.y+(ssize_t)
|
||||
geometry.height-1));
|
||||
(void) WriteBlobString(image,buffer);
|
||||
if (*(p+1) != '\0')
|
||||
{
|
||||
|
||||
+4
-6
@@ -101,14 +101,12 @@ static Image *ReadINLINEImage(const ImageInfo *image_info,
|
||||
MagickBooleanType
|
||||
status;
|
||||
|
||||
size_t
|
||||
i;
|
||||
|
||||
size_t
|
||||
quantum;
|
||||
|
||||
ssize_t
|
||||
count;
|
||||
count,
|
||||
i;
|
||||
|
||||
unsigned char
|
||||
*inline_image;
|
||||
@@ -165,8 +163,8 @@ static Image *ReadINLINEImage(const ImageInfo *image_info,
|
||||
inline_image=(unsigned char *) RelinquishMagickMemory(inline_image);
|
||||
break;
|
||||
}
|
||||
inline_image=(unsigned char *) ResizeQuantumMemory(inline_image,i+count+
|
||||
quantum+1,sizeof(*inline_image));
|
||||
inline_image=(unsigned char *) ResizeQuantumMemory(inline_image,(size_t)
|
||||
(i+count+(ssize_t) quantum+1),sizeof(*inline_image));
|
||||
}
|
||||
if (inline_image == (unsigned char *) NULL)
|
||||
{
|
||||
|
||||
+5
-11
@@ -108,18 +108,9 @@ static Image *ReadMAPImage(const ImageInfo *image_info,ExceptionInfo *exception)
|
||||
Quantum
|
||||
index;
|
||||
|
||||
ssize_t
|
||||
x;
|
||||
|
||||
Quantum
|
||||
*q;
|
||||
|
||||
ssize_t
|
||||
i;
|
||||
|
||||
unsigned char
|
||||
*p;
|
||||
|
||||
size_t
|
||||
depth,
|
||||
packet_size,
|
||||
@@ -127,10 +118,13 @@ static Image *ReadMAPImage(const ImageInfo *image_info,ExceptionInfo *exception)
|
||||
|
||||
ssize_t
|
||||
count,
|
||||
i,
|
||||
x,
|
||||
y;
|
||||
|
||||
unsigned char
|
||||
*colormap,
|
||||
*p,
|
||||
*pixels;
|
||||
|
||||
/*
|
||||
@@ -239,8 +233,8 @@ static Image *ReadMAPImage(const ImageInfo *image_info,ExceptionInfo *exception)
|
||||
p++;
|
||||
if (image->colors > 256)
|
||||
{
|
||||
index=ConstrainColormapIndex(image,((size_t) index << 8)+(*p),
|
||||
exception);
|
||||
index=ConstrainColormapIndex(image,(ssize_t) (((size_t) index << 8)+
|
||||
(ssize_t) (*p)),exception);
|
||||
p++;
|
||||
}
|
||||
SetPixelIndex(image,index,q);
|
||||
|
||||
+17
-17
@@ -325,7 +325,7 @@ static void ReadBlobFloatsLSB(Image * image, size_t len, float *data)
|
||||
len -= sizeof(float);
|
||||
}
|
||||
if (len > 0)
|
||||
(void) SeekBlob(image, len, SEEK_CUR);
|
||||
(void) SeekBlob(image, (MagickOffsetType) len, SEEK_CUR);
|
||||
}
|
||||
|
||||
static void ReadBlobFloatsMSB(Image * image, size_t len, float *data)
|
||||
@@ -336,7 +336,7 @@ static void ReadBlobFloatsMSB(Image * image, size_t len, float *data)
|
||||
len -= sizeof(float);
|
||||
}
|
||||
if (len > 0)
|
||||
(void) SeekBlob(image, len, SEEK_CUR);
|
||||
(void) SeekBlob(image, (MagickOffsetType) len, SEEK_CUR);
|
||||
}
|
||||
|
||||
/* This function reads one block of doubles*/
|
||||
@@ -348,7 +348,7 @@ static void ReadBlobDoublesLSB(Image * image, size_t len, double *data)
|
||||
len -= sizeof(double);
|
||||
}
|
||||
if (len > 0)
|
||||
(void) SeekBlob(image, len, SEEK_CUR);
|
||||
(void) SeekBlob(image, (MagickOffsetType) len, SEEK_CUR);
|
||||
}
|
||||
|
||||
static void ReadBlobDoublesMSB(Image * image, size_t len, double *data)
|
||||
@@ -359,7 +359,7 @@ static void ReadBlobDoublesMSB(Image * image, size_t len, double *data)
|
||||
len -= sizeof(double);
|
||||
}
|
||||
if (len > 0)
|
||||
(void) SeekBlob(image, len, SEEK_CUR);
|
||||
(void) SeekBlob(image, (MagickOffsetType) len, SEEK_CUR);
|
||||
}
|
||||
|
||||
/* Calculate minimum and maximum from a given block of data */
|
||||
@@ -421,7 +421,7 @@ float *fltrow;
|
||||
}
|
||||
}
|
||||
}
|
||||
(void) SeekBlob(image, filepos, SEEK_SET);
|
||||
(void) SeekBlob(image, (MagickOffsetType) filepos, SEEK_SET);
|
||||
}
|
||||
|
||||
|
||||
@@ -491,7 +491,7 @@ Image *image2;
|
||||
void *cache_block, *decompress_block;
|
||||
z_stream zip_info;
|
||||
FILE *mat_file;
|
||||
size_t magick_size;
|
||||
ssize_t magick_size;
|
||||
size_t extent;
|
||||
int file;
|
||||
|
||||
@@ -704,7 +704,7 @@ static Image *ReadMATImageV4(const ImageInfo *image_info,Image *image,
|
||||
{
|
||||
Swap(image->columns,image->rows);
|
||||
if(HDR.imagf==1) ldblk *= 2;
|
||||
SeekBlob(image, HDR.nCols*ldblk, SEEK_CUR);
|
||||
SeekBlob(image, (MagickOffsetType) HDR.nCols*ldblk, SEEK_CUR);
|
||||
if ((image->columns == 0) || (image->rows == 0))
|
||||
return(image->previous == (Image *) NULL ? DestroyImageList(image)
|
||||
: image);
|
||||
@@ -761,7 +761,7 @@ static Image *ReadMATImageV4(const ImageInfo *image_info,Image *image,
|
||||
count=ReadBlob(image,depth/8*image->columns,(char *) pixels);
|
||||
if (count == -1)
|
||||
break;
|
||||
q=QueueAuthenticPixels(image,0,image->rows-y-1,image->columns,1,
|
||||
q=QueueAuthenticPixels(image,0,(ssize_t) image->rows-y-1,image->columns,1,
|
||||
exception);
|
||||
if (q == (Quantum *) NULL)
|
||||
break;
|
||||
@@ -978,7 +978,7 @@ MATLAB_KO:
|
||||
Frames = 1;
|
||||
if(filepos > (MagickOffsetType) GetBlobSize(image) || filepos < 0)
|
||||
break;
|
||||
if(SeekBlob(image,filepos,SEEK_SET) != filepos) break;
|
||||
if(SeekBlob(image,(MagickOffsetType) filepos,SEEK_SET) != filepos) break;
|
||||
/* printf("pos=%X\n",TellBlob(image)); */
|
||||
|
||||
MATLAB_HDR.DataType = ReadBlobXXXLong(image);
|
||||
@@ -1113,7 +1113,7 @@ MATLAB_KO:
|
||||
case 0:
|
||||
size = ReadBlobXXXLong(image2); /* Object name string size */
|
||||
size = 4 * (((size_t) size + 3 + 1) / 4);
|
||||
(void) SeekBlob(image2, size, SEEK_CUR);
|
||||
(void) SeekBlob(image2, (MagickOffsetType) size, SEEK_CUR);
|
||||
break;
|
||||
case 1:
|
||||
case 2:
|
||||
@@ -1259,7 +1259,7 @@ RestoreMSCWarning
|
||||
quantum_info=DestroyQuantumInfo(quantum_info);
|
||||
ThrowReaderException(ResourceLimitError,"MemoryAllocationFailed");
|
||||
}
|
||||
(void) memset(BImgBuff,0,ldblk*sizeof(double));
|
||||
(void) memset(BImgBuff,0,(size_t) ldblk*sizeof(double));
|
||||
|
||||
MinVal = 0;
|
||||
MaxVal = 0;
|
||||
@@ -1284,7 +1284,7 @@ RestoreMSCWarning
|
||||
" MAT set image pixels returns unexpected NULL on a row %u.", (unsigned)(MATLAB_HDR.SizeY-i-1));
|
||||
goto done_reading; /* Skip image rotation, when cannot set image pixels */
|
||||
}
|
||||
if(ReadBlob(image2,ldblk,(unsigned char *)BImgBuff) != (ssize_t) ldblk)
|
||||
if(ReadBlob(image2,(size_t) ldblk,(unsigned char *) BImgBuff) != (ssize_t) ldblk)
|
||||
{
|
||||
if (logging) (void)LogMagickEvent(CoderEvent,GetMagickModule(),
|
||||
" MAT cannot read scanrow %u from a file.", (unsigned)(MATLAB_HDR.SizeY-i-1));
|
||||
@@ -1345,7 +1345,7 @@ ExitLoop:
|
||||
if (CellType==miDOUBLE)
|
||||
for (i = 0; i < (ssize_t) MATLAB_HDR.SizeY; i++)
|
||||
{
|
||||
ReadBlobDoublesXXX(image2, ldblk, (double *)BImgBuff);
|
||||
ReadBlobDoublesXXX(image2, (size_t) ldblk, (double *)BImgBuff);
|
||||
if (EOFBlob(image) != MagickFalse)
|
||||
break;
|
||||
InsertComplexDoubleRow(image, (double *)BImgBuff, i, MinVal, MaxVal,
|
||||
@@ -1355,7 +1355,7 @@ ExitLoop:
|
||||
if (CellType==miSINGLE)
|
||||
for (i = 0; i < (ssize_t) MATLAB_HDR.SizeY; i++)
|
||||
{
|
||||
ReadBlobFloatsXXX(image2, ldblk, (float *)BImgBuff);
|
||||
ReadBlobFloatsXXX(image2, (size_t) ldblk, (float *)BImgBuff);
|
||||
if (EOFBlob(image) != MagickFalse)
|
||||
break;
|
||||
InsertComplexFloatRow(image,(float *)BImgBuff,i,MinVal,MaxVal,
|
||||
@@ -1482,7 +1482,7 @@ END_OF_READING:
|
||||
Fix scene numbers
|
||||
*/
|
||||
for (p=image; p != (Image *) NULL; p=p->next)
|
||||
p->scene=scene++;
|
||||
p->scene=(size_t) scene++;
|
||||
}
|
||||
|
||||
if(clone_info != NULL) /* cleanup garbage file from compression */
|
||||
@@ -1677,8 +1677,8 @@ static MagickBooleanType WriteMATImage(const ImageInfo *image_info,Image *image,
|
||||
padding=((unsigned char)(data_size-1) & 0x7) ^ 0x7;
|
||||
|
||||
(void) WriteBlobLSBLong(image,miMATRIX);
|
||||
(void) WriteBlobLSBLong(image,(unsigned int) data_size+padding+
|
||||
((is_gray != MagickFalse) ? 48 : 56));
|
||||
(void) WriteBlobLSBLong(image,(unsigned int) ((ssize_t) data_size+padding+
|
||||
((is_gray != MagickFalse) ? 48 : 56)));
|
||||
(void) WriteBlobLSBLong(image,0x6); /* 0x88 */
|
||||
(void) WriteBlobLSBLong(image,0x8); /* 0x8C */
|
||||
(void) WriteBlobLSBLong(image,0x6); /* 0x90 */
|
||||
|
||||
+17
-19
@@ -316,12 +316,6 @@ static ssize_t parse8BIM(Image *ifile, Image *ofile)
|
||||
state,
|
||||
next;
|
||||
|
||||
unsigned char
|
||||
dataset;
|
||||
|
||||
unsigned int
|
||||
recnum;
|
||||
|
||||
MagickOffsetType
|
||||
savedpos,
|
||||
currentpos;
|
||||
@@ -336,6 +330,12 @@ static ssize_t parse8BIM(Image *ifile, Image *ofile)
|
||||
TokenInfo
|
||||
*token_info;
|
||||
|
||||
unsigned char
|
||||
dataset;
|
||||
|
||||
unsigned int
|
||||
recnum;
|
||||
|
||||
dataset = 0;
|
||||
recnum = 0;
|
||||
line = (char *) AcquireQuantumMemory(inputlen,sizeof(*line));
|
||||
@@ -418,7 +418,7 @@ static ssize_t parse8BIM(Image *ifile, Image *ofile)
|
||||
if ((ssize_t) codes_length > len)
|
||||
len=0;
|
||||
else
|
||||
len-=codes_length;
|
||||
len-=(ssize_t) codes_length;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -728,7 +728,7 @@ static ssize_t parse8BIMW(Image *ifile, Image *ofile)
|
||||
if ((ssize_t) codes_length > len)
|
||||
len=0;
|
||||
else
|
||||
len-=codes_length;
|
||||
len-=(ssize_t) codes_length;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1618,22 +1618,20 @@ static size_t GetIPTCStream(unsigned char **info,size_t length)
|
||||
int
|
||||
c;
|
||||
|
||||
ssize_t
|
||||
i;
|
||||
size_t
|
||||
extent,
|
||||
info_length,
|
||||
tag_length;
|
||||
|
||||
unsigned char
|
||||
*p;
|
||||
|
||||
size_t
|
||||
extent,
|
||||
info_length;
|
||||
ssize_t
|
||||
i;
|
||||
|
||||
unsigned int
|
||||
marker;
|
||||
|
||||
size_t
|
||||
tag_length;
|
||||
|
||||
p=(*info);
|
||||
extent=length;
|
||||
if ((*p == 0x1c) && (*(p+1) == 0x02))
|
||||
@@ -1656,7 +1654,7 @@ static size_t GetIPTCStream(unsigned char **info,size_t length)
|
||||
if ((size_t) c >= extent)
|
||||
break;
|
||||
p+=c;
|
||||
extent-=c;
|
||||
extent=(size_t) ((ssize_t) extent-c);
|
||||
if (extent < 4)
|
||||
break;
|
||||
tag_length=(((size_t) *p) << 24) | (((size_t) *(p+1)) << 16) |
|
||||
@@ -1759,13 +1757,13 @@ iptc_find:
|
||||
/*
|
||||
Short format.
|
||||
*/
|
||||
tag_length=((long) c) << 8;
|
||||
tag_length=(size_t) (c << 8);
|
||||
c=(*p++);
|
||||
length--;
|
||||
if (length == 0)
|
||||
break;
|
||||
info_length++;
|
||||
tag_length|=(long) c;
|
||||
tag_length|=(unsigned int) c;
|
||||
}
|
||||
if (tag_length > (length+1))
|
||||
break;
|
||||
|
||||
+61
-60
@@ -569,13 +569,13 @@ static void MSLPushImage(MSLInfo *msl_info,Image *image)
|
||||
msl_info->n++;
|
||||
n=msl_info->n;
|
||||
msl_info->image_info=(ImageInfo **) ResizeQuantumMemory(msl_info->image_info,
|
||||
(n+1),sizeof(*msl_info->image_info));
|
||||
(size_t) (n+1),sizeof(*msl_info->image_info));
|
||||
msl_info->draw_info=(DrawInfo **) ResizeQuantumMemory(msl_info->draw_info,
|
||||
(n+1),sizeof(*msl_info->draw_info));
|
||||
(size_t) (n+1),sizeof(*msl_info->draw_info));
|
||||
msl_info->attributes=(Image **) ResizeQuantumMemory(msl_info->attributes,
|
||||
(n+1),sizeof(*msl_info->attributes));
|
||||
msl_info->image=(Image **) ResizeQuantumMemory(msl_info->image,(n+1),
|
||||
sizeof(*msl_info->image));
|
||||
(size_t) (n+1),sizeof(*msl_info->attributes));
|
||||
msl_info->image=(Image **) ResizeQuantumMemory(msl_info->image,
|
||||
(size_t) (n+1),sizeof(*msl_info->image));
|
||||
if ((msl_info->image_info == (ImageInfo **) NULL) ||
|
||||
(msl_info->draw_info == (DrawInfo **) NULL) ||
|
||||
(msl_info->attributes == (Image **) NULL) ||
|
||||
@@ -645,16 +645,9 @@ static void MSLStartElement(void *context,const xmlChar *tag,
|
||||
Image
|
||||
*image;
|
||||
|
||||
int
|
||||
MagickStatusType
|
||||
flags;
|
||||
|
||||
ssize_t
|
||||
option,
|
||||
j,
|
||||
n,
|
||||
x,
|
||||
y;
|
||||
|
||||
MSLInfo
|
||||
*msl_info;
|
||||
|
||||
@@ -662,7 +655,13 @@ static void MSLStartElement(void *context,const xmlChar *tag,
|
||||
geometry;
|
||||
|
||||
ssize_t
|
||||
i;
|
||||
i,
|
||||
j,
|
||||
n,
|
||||
option,
|
||||
x,
|
||||
y;
|
||||
|
||||
|
||||
size_t
|
||||
height,
|
||||
@@ -988,7 +987,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
|
||||
}
|
||||
if (LocaleCompare(keyword,"strokewidth") == 0)
|
||||
{
|
||||
draw_info->stroke_width=StringToLong(value);
|
||||
draw_info->stroke_width=(size_t) StringToLong(value);
|
||||
break;
|
||||
}
|
||||
if (LocaleCompare(keyword,"style") == 0)
|
||||
@@ -1044,7 +1043,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
|
||||
{
|
||||
if (LocaleCompare(keyword,"weight") == 0)
|
||||
{
|
||||
draw_info->weight=StringToLong(value);
|
||||
draw_info->weight=(size_t) StringToLong(value);
|
||||
break;
|
||||
}
|
||||
ThrowMSLException(OptionError,"UnrecognizedAttribute",
|
||||
@@ -1359,7 +1358,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
|
||||
{
|
||||
if (LocaleCompare(keyword,"height") == 0)
|
||||
{
|
||||
geometry.height=StringToLong(value);
|
||||
geometry.height=(size_t) StringToLong(value);
|
||||
break;
|
||||
}
|
||||
ThrowMSLException(OptionError,"UnrecognizedAttribute",
|
||||
@@ -1371,7 +1370,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
|
||||
{
|
||||
if (LocaleCompare(keyword,"width") == 0)
|
||||
{
|
||||
geometry.width=StringToLong(value);
|
||||
geometry.width=(size_t) StringToLong(value);
|
||||
break;
|
||||
}
|
||||
ThrowMSLException(OptionError,"UnrecognizedAttribute",
|
||||
@@ -1591,7 +1590,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
|
||||
{
|
||||
if (LocaleCompare(keyword,"height") == 0)
|
||||
{
|
||||
geometry.height=StringToLong(value);
|
||||
geometry.height=(size_t) StringToLong(value);
|
||||
break;
|
||||
}
|
||||
ThrowMSLException(OptionError,"UnrecognizedAttribute",
|
||||
@@ -1603,7 +1602,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
|
||||
{
|
||||
if (LocaleCompare(keyword,"width") == 0)
|
||||
{
|
||||
geometry.width=StringToLong(value);
|
||||
geometry.width=(size_t) StringToLong(value);
|
||||
break;
|
||||
}
|
||||
ThrowMSLException(OptionError,"UnrecognizedAttribute",
|
||||
@@ -1995,7 +1994,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
|
||||
for (r=0; r < (ssize_t) composite_image->rows ; r++)
|
||||
{
|
||||
q=GetCacheViewAuthenticPixels(composite_view,0,r,
|
||||
(ssize_t) composite_image->columns,1,exception);
|
||||
composite_image->columns,1,exception);
|
||||
for (k=0; k < (ssize_t) composite_image->columns; k++)
|
||||
{
|
||||
if (GetPixelAlpha(composite_image,q) == OpaqueAlpha)
|
||||
@@ -2225,7 +2224,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
|
||||
{
|
||||
if (LocaleCompare(keyword,"height") == 0)
|
||||
{
|
||||
geometry.height=StringToLong(value);
|
||||
geometry.height=(size_t) StringToLong(value);
|
||||
break;
|
||||
}
|
||||
ThrowMSLException(OptionError,"UnrecognizedAttribute",
|
||||
@@ -2237,7 +2236,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
|
||||
{
|
||||
if (LocaleCompare(keyword,"width") == 0)
|
||||
{
|
||||
geometry.width=StringToLong(value);
|
||||
geometry.width=(size_t) StringToLong(value);
|
||||
break;
|
||||
}
|
||||
ThrowMSLException(OptionError,"UnrecognizedAttribute",
|
||||
@@ -2644,7 +2643,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
|
||||
}
|
||||
if (LocaleCompare(keyword,"strokewidth") == 0)
|
||||
{
|
||||
draw_info->stroke_width=StringToLong(value);
|
||||
draw_info->stroke_width=(size_t) StringToLong(value);
|
||||
break;
|
||||
}
|
||||
if (LocaleCompare(keyword,"style") == 0)
|
||||
@@ -2702,7 +2701,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
|
||||
{
|
||||
if (LocaleCompare(keyword,"weight") == 0)
|
||||
{
|
||||
draw_info->weight=StringToLong(value);
|
||||
draw_info->weight=(size_t) StringToLong(value);
|
||||
break;
|
||||
}
|
||||
ThrowMSLException(OptionError,"UnrecognizedAttribute",
|
||||
@@ -3151,7 +3150,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
|
||||
{
|
||||
if (LocaleCompare(keyword,"height") == 0)
|
||||
{
|
||||
frame_info.height=StringToLong(value);
|
||||
frame_info.height=(size_t) StringToLong(value);
|
||||
break;
|
||||
}
|
||||
ThrowMSLException(OptionError,"UnrecognizedAttribute",
|
||||
@@ -3187,7 +3186,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
|
||||
{
|
||||
if (LocaleCompare(keyword,"width") == 0)
|
||||
{
|
||||
frame_info.width=StringToLong(value);
|
||||
frame_info.width=(size_t) StringToLong(value);
|
||||
break;
|
||||
}
|
||||
ThrowMSLException(OptionError,"UnrecognizedAttribute",
|
||||
@@ -3204,8 +3203,10 @@ static void MSLStartElement(void *context,const xmlChar *tag,
|
||||
}
|
||||
frame_info.x=(ssize_t) frame_info.width;
|
||||
frame_info.y=(ssize_t) frame_info.height;
|
||||
frame_info.width=msl_info->image[n]->columns+2*frame_info.x;
|
||||
frame_info.height=msl_info->image[n]->rows+2*frame_info.y;
|
||||
frame_info.width=(size_t) ((ssize_t) msl_info->image[n]->columns+2*
|
||||
frame_info.x);
|
||||
frame_info.height=(size_t) ((ssize_t) msl_info->image[n]->rows+2*
|
||||
frame_info.y);
|
||||
frame_image=FrameImage(msl_info->image[n],&frame_info,
|
||||
msl_info->image[n]->compose,msl_info->exception);
|
||||
if (frame_image == (Image *) NULL)
|
||||
@@ -3382,7 +3383,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
|
||||
{
|
||||
msl_info->number_groups++;
|
||||
msl_info->group_info=(MSLGroupInfo *) ResizeQuantumMemory(
|
||||
msl_info->group_info,msl_info->number_groups+1UL,
|
||||
msl_info->group_info,(size_t) (msl_info->number_groups+1),
|
||||
sizeof(*msl_info->group_info));
|
||||
break;
|
||||
}
|
||||
@@ -4538,7 +4539,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
|
||||
{
|
||||
if (LocaleCompare(keyword,"colors") == 0)
|
||||
{
|
||||
quantize_info.number_colors=StringToLong(value);
|
||||
quantize_info.number_colors=(size_t) StringToLong(value);
|
||||
break;
|
||||
}
|
||||
if (LocaleCompare(keyword,"colorspace") == 0)
|
||||
@@ -4594,7 +4595,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
|
||||
{
|
||||
if (LocaleCompare(keyword,"treedepth") == 0)
|
||||
{
|
||||
quantize_info.tree_depth=StringToLong(value);
|
||||
quantize_info.tree_depth=(size_t) StringToLong(value);
|
||||
break;
|
||||
}
|
||||
ThrowMSLException(OptionError,"UnrecognizedAttribute",
|
||||
@@ -4836,7 +4837,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
|
||||
}
|
||||
if (LocaleCompare(keyword,"strokewidth") == 0)
|
||||
{
|
||||
draw_info->stroke_width=StringToLong(value);
|
||||
draw_info->stroke_width=(size_t) StringToLong(value);
|
||||
break;
|
||||
}
|
||||
if (LocaleCompare(keyword,"style") == 0)
|
||||
@@ -4892,7 +4893,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
|
||||
{
|
||||
if (LocaleCompare(keyword,"weight") == 0)
|
||||
{
|
||||
draw_info->weight=StringToLong(value);
|
||||
draw_info->weight=(size_t) StringToLong(value);
|
||||
break;
|
||||
}
|
||||
ThrowMSLException(OptionError,"UnrecognizedAttribute",
|
||||
@@ -5033,7 +5034,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
|
||||
{
|
||||
if (LocaleCompare(keyword,"height") == 0)
|
||||
{
|
||||
geometry.height=StringToLong(value);
|
||||
geometry.height=(size_t) StringToLong(value);
|
||||
break;
|
||||
}
|
||||
ThrowMSLException(OptionError,"UnrecognizedAttribute",
|
||||
@@ -5062,7 +5063,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
|
||||
{
|
||||
if (LocaleCompare(keyword,"width") == 0)
|
||||
{
|
||||
geometry.width=StringToLong(value);
|
||||
geometry.width=(size_t) StringToLong(value);
|
||||
break;
|
||||
}
|
||||
ThrowMSLException(OptionError,"UnrecognizedAttribute",
|
||||
@@ -5247,13 +5248,15 @@ static void MSLStartElement(void *context,const xmlChar *tag,
|
||||
{
|
||||
x=region.x;
|
||||
if ((width == 0) && (region.x > 0))
|
||||
width=msl_info->image[n]->columns+region.x;
|
||||
width=(size_t) ((ssize_t) msl_info->image[n]->columns+
|
||||
region.x);
|
||||
}
|
||||
if ((flags & YValue) != 0)
|
||||
{
|
||||
y=region.y;
|
||||
if ((height == 0) && (region.y > 0))
|
||||
height=msl_info->image[n]->rows+region.y;
|
||||
height=(size_t) ((ssize_t) msl_info->image[n]->rows+
|
||||
region.y);
|
||||
}
|
||||
}
|
||||
break;
|
||||
@@ -5266,8 +5269,8 @@ static void MSLStartElement(void *context,const xmlChar *tag,
|
||||
{
|
||||
if (LocaleCompare(keyword,"height") == 0)
|
||||
{
|
||||
height = StringToLong( value );
|
||||
break;
|
||||
height=(size_t) StringToLong(value);
|
||||
break;
|
||||
}
|
||||
ThrowMSLException(OptionError,"UnrecognizedAttribute",keyword);
|
||||
break;
|
||||
@@ -5277,7 +5280,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
|
||||
{
|
||||
if (LocaleCompare(keyword,"width") == 0)
|
||||
{
|
||||
width = StringToLong( value );
|
||||
width=(size_t) StringToLong(value);
|
||||
break;
|
||||
}
|
||||
ThrowMSLException(OptionError,"UnrecognizedAttribute",keyword);
|
||||
@@ -5479,7 +5482,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
|
||||
{
|
||||
if (LocaleCompare(keyword,"height") == 0)
|
||||
{
|
||||
geometry.height=StringToUnsignedLong(value);
|
||||
geometry.height=(size_t) StringToUnsignedLong(value);
|
||||
break;
|
||||
}
|
||||
ThrowMSLException(OptionError,"UnrecognizedAttribute",
|
||||
@@ -5491,7 +5494,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
|
||||
{
|
||||
if (LocaleCompare(keyword,"width") == 0)
|
||||
{
|
||||
geometry.width=StringToLong(value);
|
||||
geometry.width=(size_t) StringToLong(value);
|
||||
break;
|
||||
}
|
||||
ThrowMSLException(OptionError,"UnrecognizedAttribute",
|
||||
@@ -5847,7 +5850,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
|
||||
{
|
||||
if (LocaleCompare(keyword,"height") == 0)
|
||||
{
|
||||
geometry.height=StringToUnsignedLong(value);
|
||||
geometry.height=(size_t) StringToUnsignedLong(value);
|
||||
break;
|
||||
}
|
||||
ThrowMSLException(OptionError,"UnrecognizedAttribute",
|
||||
@@ -5859,7 +5862,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
|
||||
{
|
||||
if (LocaleCompare(keyword,"width") == 0)
|
||||
{
|
||||
geometry.width=StringToLong(value);
|
||||
geometry.width=(size_t) StringToLong(value);
|
||||
break;
|
||||
}
|
||||
ThrowMSLException(OptionError,"UnrecognizedAttribute",
|
||||
@@ -5924,7 +5927,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
|
||||
{
|
||||
if (LocaleCompare(keyword,"height") == 0)
|
||||
{
|
||||
geometry.height=StringToUnsignedLong(value);
|
||||
geometry.height=(size_t) StringToUnsignedLong(value);
|
||||
break;
|
||||
}
|
||||
ThrowMSLException(OptionError,"UnrecognizedAttribute",
|
||||
@@ -5936,7 +5939,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
|
||||
{
|
||||
if (LocaleCompare(keyword,"width") == 0)
|
||||
{
|
||||
geometry.width=StringToLong(value);
|
||||
geometry.width=(size_t) StringToLong(value);
|
||||
break;
|
||||
}
|
||||
ThrowMSLException(OptionError,"UnrecognizedAttribute",
|
||||
@@ -6157,7 +6160,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
|
||||
|
||||
if (value[len-1] == '%') {
|
||||
char tmp[100];
|
||||
(void) CopyMagickString(tmp,value,len);
|
||||
(void) CopyMagickString(tmp,value,(size_t) len);
|
||||
opac = StringToLong( tmp );
|
||||
opac = (int)(QuantumRange * ((float)opac/100));
|
||||
} else
|
||||
@@ -6525,7 +6528,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
|
||||
{
|
||||
if (LocaleCompare(keyword,"height") == 0)
|
||||
{
|
||||
height = StringToLong( value );
|
||||
height = (size_t) StringToLong( value );
|
||||
break;
|
||||
}
|
||||
ThrowMSLException(OptionError,"UnrecognizedAttribute",keyword);
|
||||
@@ -6536,7 +6539,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
|
||||
{
|
||||
if (LocaleCompare(keyword,"width") == 0)
|
||||
{
|
||||
width = StringToLong( value );
|
||||
width = (size_t) StringToLong( value );
|
||||
break;
|
||||
}
|
||||
ThrowMSLException(OptionError,"UnrecognizedAttribute",keyword);
|
||||
@@ -7526,14 +7529,14 @@ static void MSLCharacters(void *context,const xmlChar *c,int length)
|
||||
msl_info=(MSLInfo *) context;
|
||||
if (msl_info->content != (char *) NULL)
|
||||
msl_info->content=(char *) ResizeQuantumMemory(msl_info->content,
|
||||
strlen(msl_info->content)+length+MagickPathExtent,
|
||||
strlen(msl_info->content)+(size_t) length+MagickPathExtent,
|
||||
sizeof(*msl_info->content));
|
||||
else
|
||||
{
|
||||
msl_info->content=(char *) NULL;
|
||||
if (~(size_t) length >= (MagickPathExtent-1))
|
||||
msl_info->content=(char *) AcquireQuantumMemory(length+MagickPathExtent,
|
||||
sizeof(*msl_info->content));
|
||||
msl_info->content=(char *) AcquireQuantumMemory((size_t) (length+
|
||||
MagickPathExtent),sizeof(*msl_info->content));
|
||||
if (msl_info->content != (char *) NULL)
|
||||
*msl_info->content='\0';
|
||||
}
|
||||
@@ -7541,7 +7544,7 @@ static void MSLCharacters(void *context,const xmlChar *c,int length)
|
||||
return;
|
||||
p=msl_info->content+strlen(msl_info->content);
|
||||
for (i=0; i < length; i++)
|
||||
*p++=c[i];
|
||||
*p++=(char) c[i];
|
||||
*p='\0';
|
||||
}
|
||||
|
||||
@@ -8039,9 +8042,6 @@ ModuleExport size_t RegisterMSLImage(void)
|
||||
static MagickBooleanType SetMSLAttributes(MSLInfo *msl_info,const char *keyword,
|
||||
const char *value)
|
||||
{
|
||||
Image
|
||||
*attributes;
|
||||
|
||||
DrawInfo
|
||||
*draw_info;
|
||||
|
||||
@@ -8052,12 +8052,13 @@ static MagickBooleanType SetMSLAttributes(MSLInfo *msl_info,const char *keyword,
|
||||
geometry_info;
|
||||
|
||||
Image
|
||||
*attributes,
|
||||
*image;
|
||||
|
||||
ImageInfo
|
||||
*image_info;
|
||||
|
||||
int
|
||||
MagickStatusType
|
||||
flags;
|
||||
|
||||
ssize_t
|
||||
@@ -8262,10 +8263,10 @@ static MagickBooleanType SetMSLAttributes(MSLInfo *msl_info,const char *keyword,
|
||||
{
|
||||
if (LocaleCompare(keyword,"quality") == 0)
|
||||
{
|
||||
image_info->quality=StringToLong(value);
|
||||
image_info->quality=(size_t) StringToLong(value);
|
||||
if (image == (Image *) NULL)
|
||||
break;
|
||||
image->quality=StringToLong(value);
|
||||
image->quality=(size_t) StringToLong(value);
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user