From: dirk Date: Sun, 22 Nov 2015 09:01:27 +0000 (+0100) Subject: Fixed various warnings reported by Visual Studio 2015 X-Git-Tag: 7.0.1-0~473 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b4979cb2bb20deb492cf60d6bfdffa03f38a9548;p=imagemagick Fixed various warnings reported by Visual Studio 2015 --- diff --git a/MagickWand/mogrify.c b/MagickWand/mogrify.c index a55600fdc..59329fa05 100644 --- a/MagickWand/mogrify.c +++ b/MagickWand/mogrify.c @@ -806,7 +806,7 @@ WandExport MagickBooleanType MogrifyImage(ImageInfo *image_info,const int argc, { char *text, - geometry[MagickPathExtent]; + geometry_str[MagickPathExtent]; /* Annotate image. @@ -822,9 +822,9 @@ WandExport MagickBooleanType MogrifyImage(ImageInfo *image_info,const int argc, break; (void) CloneString(&draw_info->text,text); text=DestroyString(text); - (void) FormatLocaleString(geometry,MagickPathExtent,"%+f%+f", + (void) FormatLocaleString(geometry_str,MagickPathExtent,"%+f%+f", geometry_info.xi,geometry_info.psi); - (void) CloneString(&draw_info->geometry,geometry); + (void) CloneString(&draw_info->geometry,geometry_str); draw_info->affine.sx=cos(DegreesToRadians( fmod(geometry_info.rho,360.0))); draw_info->affine.rx=sin(DegreesToRadians( @@ -953,12 +953,6 @@ WandExport MagickBooleanType MogrifyImage(ImageInfo *image_info,const int argc, brightness, contrast; - GeometryInfo - geometry_info; - - MagickStatusType - flags; - /* Brightness / contrast image. */ @@ -1217,9 +1211,6 @@ WandExport MagickBooleanType MogrifyImage(ImageInfo *image_info,const int argc, black_point, white_point; - MagickStatusType - flags; - /* Contrast stretch image. */ @@ -1958,9 +1949,6 @@ WandExport MagickBooleanType MogrifyImage(ImageInfo *image_info,const int argc, gamma, white_point; - MagickStatusType - flags; - /* Parse levels. */ @@ -2033,9 +2021,6 @@ WandExport MagickBooleanType MogrifyImage(ImageInfo *image_info,const int argc, black_point, white_point; - MagickStatusType - flags; - (void) SyncImageSettings(mogrify_info,*image,exception); flags=ParseGeometry(argv[i+1],&geometry_info); black_point=geometry_info.rho; @@ -2070,9 +2055,6 @@ WandExport MagickBooleanType MogrifyImage(ImageInfo *image_info,const int argc, } if (LocaleCompare("local-contrast",option+1) == 0) { - MagickStatusType - flags; - (void) SyncImageSettings(mogrify_info,*image,exception); flags=ParseGeometry(argv[i+1],&geometry_info); if ((flags & RhoValue) == 0) @@ -2472,18 +2454,19 @@ WandExport MagickBooleanType MogrifyImage(ImageInfo *image_info,const int argc, if (profile_image == (Image *) NULL) { StringInfo - *profile; + *file_data; profile_info=CloneImageInfo(mogrify_info); (void) CopyMagickString(profile_info->filename,argv[i+1], MagickPathExtent); - profile=FileToStringInfo(profile_info->filename,~0UL,exception); - if (profile != (StringInfo *) NULL) + file_data=FileToStringInfo(profile_info->filename,~0UL, + exception); + if (file_data != (StringInfo *) NULL) { (void) ProfileImage(*image,profile_info->magick, - GetStringInfoDatum(profile),(size_t) - GetStringInfoLength(profile),exception); - profile=DestroyStringInfo(profile); + GetStringInfoDatum(file_data), + GetStringInfoLength(file_data),exception); + file_data=DestroyStringInfo(file_data); } profile_info=DestroyImageInfo(profile_info); break; @@ -2676,7 +2659,7 @@ WandExport MagickBooleanType MogrifyImage(ImageInfo *image_info,const int argc, if (LocaleCompare("rotate",option+1) == 0) { char - *geometry; + *rotation; /* Check for conditional image rotation. @@ -2691,11 +2674,11 @@ WandExport MagickBooleanType MogrifyImage(ImageInfo *image_info,const int argc, /* Rotate image. */ - geometry=ConstantString(argv[i+1]); - (void) SubstituteString(&geometry,">",""); - (void) SubstituteString(&geometry,"<",""); - (void) ParseGeometry(geometry,&geometry_info); - geometry=DestroyString(geometry); + rotation=ConstantString(argv[i+1]); + (void) SubstituteString(&rotation,">",""); + (void) SubstituteString(&rotation,"<",""); + (void) ParseGeometry(rotation,&geometry_info); + rotation=DestroyString(rotation); mogrify_image=RotateImage(*image,geometry_info.rho,exception); break; } @@ -3937,15 +3920,12 @@ WandExport MagickBooleanType MogrifyImageCommand(ImageInfo *image_info, if ((LocaleCompare(image->filename,"-") != 0) && (IsPathWritable(image->filename) != MagickFalse)) { - register ssize_t - i; - /* Rename image file as backup. */ (void) CopyMagickString(backup_filename,image->filename, MagickPathExtent); - for (i=0; i < 6; i++) + for (j=0; j < 6; j++) { (void) ConcatenateMagickString(backup_filename,"~",MagickPathExtent); if (IsPathAccessible(backup_filename) == MagickFalse) @@ -7821,9 +7801,6 @@ WandExport MagickBooleanType MogrifyImageList(ImageInfo *image_info, } if (LocaleCompare("compare",option+1) == 0) { - const char - *option; - double distortion; @@ -8587,11 +8564,11 @@ WandExport MagickBooleanType MogrifyImageList(ImageInfo *image_info, *token; const char - *arguments; + *argument; int next, - status; + token_status; size_t length; @@ -8610,18 +8587,18 @@ WandExport MagickBooleanType MogrifyImageList(ImageInfo *image_info, if (token == (char *) NULL) break; next=0; - arguments=argv[i+1]; + argument=argv[i+1]; token_info=AcquireTokenInfo(); - status=Tokenizer(token_info,0,token,length,arguments,"","=", - "\"",'\0',&breaker,&next,"e); + token_status=Tokenizer(token_info,0,token,length,argument,"", + "=","\"",'\0',&breaker,&next,"e); token_info=DestroyTokenInfo(token_info); - if (status == 0) + if (token_status == 0) { const char - *argv; + *arg; - argv=(&(arguments[next])); - (void) InvokeDynamicImageFilter(token,&(*images),1,&argv, + arg=(&(argument[next])); + (void) InvokeDynamicImageFilter(token,&(*images),1,&arg, exception); } token=DestroyString(token); diff --git a/coders/gif.c b/coders/gif.c index 812d462cd..0030dde1b 100644 --- a/coders/gif.c +++ b/coders/gif.c @@ -981,8 +981,7 @@ static Image *ReadGIFImage(const ImageInfo *image_info,ExceptionInfo *exception) c, flag, *global_colormap, - header[MagickPathExtent], - magick[12]; + buffer[MagickPathExtent]; /* Open image file. @@ -1004,9 +1003,9 @@ static Image *ReadGIFImage(const ImageInfo *image_info,ExceptionInfo *exception) /* Determine if this a GIF file. */ - count=ReadBlob(image,6,magick); - if ((count != 6) || ((LocaleNCompare((char *) magick,"GIF87",5) != 0) && - (LocaleNCompare((char *) magick,"GIF89",5) != 0))) + count=ReadBlob(image,6,buffer); + if ((count != 6) || ((LocaleNCompare((char *) buffer,"GIF87",5) != 0) && + (LocaleNCompare((char *) buffer,"GIF89",5) != 0))) ThrowReaderException(CorruptImageError,"ImproperImageHeader"); page.width=ReadBlobLSBShort(image); page.height=ReadBlobLSBShort(image); @@ -1063,11 +1062,11 @@ static Image *ReadGIFImage(const ImageInfo *image_info,ExceptionInfo *exception) /* Read graphics control extension. */ - while (ReadBlobBlock(image,header) != 0) ; - dispose=(size_t) (header[0] >> 2); - delay=(size_t) ((header[2] << 8) | header[1]); - if ((ssize_t) (header[0] & 0x01) == 0x01) - opacity=(ssize_t) header[3]; + while (ReadBlobBlock(image,buffer) != 0) ; + dispose=(size_t) (buffer[0] >> 2); + delay=(size_t) ((buffer[2] << 8) | buffer[1]); + if ((ssize_t) (buffer[0] & 0x01) == 0x01) + opacity=(ssize_t) buffer[3]; break; } case 0xfe: @@ -1084,11 +1083,11 @@ static Image *ReadGIFImage(const ImageInfo *image_info,ExceptionInfo *exception) comments=AcquireString((char *) NULL); for (length=0; ; length+=count) { - count=(ssize_t) ReadBlobBlock(image,header); + count=(ssize_t) ReadBlobBlock(image,buffer); if (count == 0) break; - header[count]='\0'; - (void) ConcatenateString(&comments,(const char *) header); + buffer[count]='\0'; + (void) ConcatenateString(&comments,(const char *) buffer); } (void) SetImageProperty(meta_image,"comment",comments,exception); comments=DestroyString(comments); @@ -1103,13 +1102,13 @@ static Image *ReadGIFImage(const ImageInfo *image_info,ExceptionInfo *exception) Read Netscape Loop extension. */ loop=MagickFalse; - if (ReadBlobBlock(image,header) != 0) - loop=LocaleNCompare((char *) header,"NETSCAPE2.0",11) == 0 ? + if (ReadBlobBlock(image,buffer) != 0) + loop=LocaleNCompare((char *) buffer,"NETSCAPE2.0",11) == 0 ? MagickTrue : MagickFalse; if (loop != MagickFalse) { - while (ReadBlobBlock(image,header) != 0) - iterations=(size_t) ((header[2] << 8) | header[1]); + while (ReadBlobBlock(image,buffer) != 0) + iterations=(size_t) ((buffer[2] << 8) | buffer[1]); break; } else @@ -1137,13 +1136,13 @@ static Image *ReadGIFImage(const ImageInfo *image_info,ExceptionInfo *exception) /* Store GIF application extension as a generic profile. */ - icc=LocaleNCompare((char *) header,"ICCRGBG1012",11) == 0 ? + icc=LocaleNCompare((char *) buffer,"ICCRGBG1012",11) == 0 ? MagickTrue : MagickFalse; - magick=LocaleNCompare((char *) header,"ImageMagick",11) == 0 ? + magick=LocaleNCompare((char *) buffer,"ImageMagick",11) == 0 ? MagickTrue : MagickFalse; - i8bim=LocaleNCompare((char *) header,"MGK8BIM0000",11) == 0 ? + i8bim=LocaleNCompare((char *) buffer,"MGK8BIM0000",11) == 0 ? MagickTrue : MagickFalse; - iptc=LocaleNCompare((char *) header,"MGKIPTC0000",11) == 0 ? + iptc=LocaleNCompare((char *) buffer,"MGKIPTC0000",11) == 0 ? MagickTrue : MagickFalse; number_extensionss++; (void) LogMagickEvent(CoderEvent,GetMagickModule(), @@ -1188,7 +1187,7 @@ static Image *ReadGIFImage(const ImageInfo *image_info,ExceptionInfo *exception) } else (void) FormatLocaleString(name,sizeof(name),"gif:%.11s", - header); + buffer); info=(unsigned char *) RelinquishMagickMemory(info); if (magick == MagickFalse) (void) SetImageProfile(meta_image,name,profile,exception); @@ -1200,7 +1199,7 @@ static Image *ReadGIFImage(const ImageInfo *image_info,ExceptionInfo *exception) } default: { - while (ReadBlobBlock(image,header) != 0) ; + while (ReadBlobBlock(image,buffer) != 0) ; break; } } @@ -1773,9 +1772,6 @@ static MagickBooleanType WriteGIFImage(const ImageInfo *image_info,Image *image, (LocaleCompare(name,"8BIM") == 0) || (LocaleNCompare(name,"gif:",4) == 0)) { - size_t - length; - ssize_t offset;