From: dirk Date: Tue, 20 Oct 2015 21:01:53 +0000 (+0200) Subject: Fixed various warnings reported by Visual Studio 2015 and did some minor refactoring. X-Git-Tag: 7.0.1-0~536^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b81f0abf7970b3c3e43ba0c95266a1c252806425;p=imagemagick Fixed various warnings reported by Visual Studio 2015 and did some minor refactoring. --- diff --git a/MagickCore/coder.c b/MagickCore/coder.c index 8a09bc8d7..32a15ffb5 100644 --- a/MagickCore/coder.c +++ b/MagickCore/coder.c @@ -875,7 +875,7 @@ static MagickBooleanType LoadCoderCache(SplayTreeInfo *coder_cache, { char path[MagickPathExtent], - *fileXml; + *file_xml; GetPathComponent(filename,HeadPath,path); if (*path != '\0') @@ -885,12 +885,12 @@ static MagickBooleanType LoadCoderCache(SplayTreeInfo *coder_cache, (void) CopyMagickString(path,token,MagickPathExtent); else (void) ConcatenateMagickString(path,token,MagickPathExtent); - fileXml=FileToXML(path,~0UL); - if (fileXml != (char *) NULL) + file_xml=FileToXML(path,~0UL); + if (file_xml != (char *) NULL) { - status&=LoadCoderCache(coder_cache,fileXml,path,depth+1, + status&=LoadCoderCache(coder_cache,file_xml,path,depth+1, exception); - fileXml=(char *) RelinquishMagickMemory(fileXml); + file_xml=DestroyString(file_xml); } } } diff --git a/MagickCore/color.c b/MagickCore/color.c index 7ee846edc..d77f24ae2 100644 --- a/MagickCore/color.c +++ b/MagickCore/color.c @@ -2049,7 +2049,7 @@ static MagickBooleanType LoadColorCache(LinkedListInfo *color_cache, { char path[MagickPathExtent], - *fileXml; + *file_xml; GetPathComponent(filename,HeadPath,path); if (*path != '\0') @@ -2059,12 +2059,12 @@ static MagickBooleanType LoadColorCache(LinkedListInfo *color_cache, (void) CopyMagickString(path,token,MagickPathExtent); else (void) ConcatenateMagickString(path,token,MagickPathExtent); - fileXml=FileToXML(path,~0UL); - if (fileXml != (char *) NULL) + file_xml=FileToXML(path,~0UL); + if (file_xml != (char *) NULL) { - status&=LoadColorCache(color_cache,fileXml,path,depth+1, + status&=LoadColorCache(color_cache,file_xml,path,depth+1, exception); - fileXml=(char *) RelinquishMagickMemory(fileXml); + file_xml=DestroyString(file_xml); } } } diff --git a/MagickCore/configure.c b/MagickCore/configure.c index d51e227ae..3671488c6 100755 --- a/MagickCore/configure.c +++ b/MagickCore/configure.c @@ -1208,7 +1208,7 @@ static MagickBooleanType LoadConfigureCache(LinkedListInfo *configure_cache, { char path[MagickPathExtent], - *fileXml; + *file_xml; GetPathComponent(filename,HeadPath,path); if (*path != '\0') @@ -1218,12 +1218,12 @@ static MagickBooleanType LoadConfigureCache(LinkedListInfo *configure_cache, (void) CopyMagickString(path,token,MagickPathExtent); else (void) ConcatenateMagickString(path,token,MagickPathExtent); - fileXml=FileToXML(path,~0UL); - if (fileXml != (char *) NULL) + file_xml=FileToXML(path,~0UL); + if (file_xml != (char *) NULL) { - status&=LoadConfigureCache(configure_cache,fileXml,path, + status&=LoadConfigureCache(configure_cache,file_xml,path, depth+1,exception); - fileXml=(char *) RelinquishMagickMemory(fileXml); + file_xml=DestroyString(file_xml); } } } diff --git a/MagickCore/delegate.c b/MagickCore/delegate.c index 8047042be..dffd6ba36 100644 --- a/MagickCore/delegate.c +++ b/MagickCore/delegate.c @@ -1574,9 +1574,9 @@ static MagickBooleanType LoadDelegateCache(LinkedListInfo *delegate_cache, file_xml=FileToXML(path,~0UL); if (file_xml != (char *) NULL) { - status&=LoadDelegateCache(delegate_cache, file_xml,path, + status&=LoadDelegateCache(delegate_cache,file_xml,path, depth+1,exception); - file_xml=(char *) RelinquishMagickMemory(file_xml); + file_xml=DestroyString(file_xml); } } } diff --git a/MagickCore/locale.c b/MagickCore/locale.c index 5dc8c6de6..ae5f1e28d 100644 --- a/MagickCore/locale.c +++ b/MagickCore/locale.c @@ -1248,7 +1248,7 @@ static MagickBooleanType LoadLocaleCache(SplayTreeInfo *locale_cache, { char path[MagickPathExtent], - *xml; + *file_xml; *path='\0'; GetPathComponent(filename,HeadPath,path); @@ -1259,12 +1259,12 @@ static MagickBooleanType LoadLocaleCache(SplayTreeInfo *locale_cache, (void) CopyMagickString(path,token,MagickPathExtent); else (void) ConcatenateMagickString(path,token,MagickPathExtent); - xml=FileToXML(path,~0UL); - if (xml != (char *) NULL) + file_xml=FileToXML(path,~0UL); + if (file_xml != (char *) NULL) { - status&=LoadLocaleCache(locale_cache,xml,path,locale, + status&=LoadLocaleCache(locale_cache,file_xml,path,locale, depth+1,exception); - xml=(char *) RelinquishMagickMemory(xml); + file_xml=DestroyString(file_xml); } } } diff --git a/MagickCore/log.c b/MagickCore/log.c index 673fb5010..eacd775d2 100644 --- a/MagickCore/log.c +++ b/MagickCore/log.c @@ -1492,7 +1492,7 @@ static MagickBooleanType LoadLogCache(LinkedListInfo *log_cache,const char *xml, { char path[MagickPathExtent], - *xml; + *file_xml; GetPathComponent(filename,HeadPath,path); if (*path != '\0') @@ -1502,12 +1502,12 @@ static MagickBooleanType LoadLogCache(LinkedListInfo *log_cache,const char *xml, (void) CopyMagickString(path,token,MagickPathExtent); else (void) ConcatenateMagickString(path,token,MagickPathExtent); - xml=FileToXML(path,~0UL); - if (xml != (char *) NULL) + file_xml=FileToXML(path,~0UL); + if (file_xml != (char *) NULL) { - status&=LoadLogCache(log_cache,xml,path,depth+1, + status&=LoadLogCache(log_cache,file_xml,path,depth+1, exception); - xml=DestroyString(xml); + file_xml=DestroyString(file_xml); } } } diff --git a/MagickCore/magic.c b/MagickCore/magic.c index 299e424c7..14d03f229 100644 --- a/MagickCore/magic.c +++ b/MagickCore/magic.c @@ -898,7 +898,7 @@ static MagickBooleanType LoadMagicCache(LinkedListInfo *magic_cache, { char path[MagickPathExtent], - *xml; + *file_xml; GetPathComponent(filename,HeadPath,path); if (*path != '\0') @@ -908,12 +908,12 @@ static MagickBooleanType LoadMagicCache(LinkedListInfo *magic_cache, (void) CopyMagickString(path,token,MagickPathExtent); else (void) ConcatenateMagickString(path,token,MagickPathExtent); - xml=FileToXML(path,~0UL); + file_xml=FileToXML(path,~0UL); if (xml != (char *) NULL) { - status&=LoadMagicCache(magic_cache,xml,path,depth+1, + status&=LoadMagicCache(magic_cache,file_xml,path,depth+1, exception); - xml=(char *) RelinquishMagickMemory(xml); + file_xml=DestroyString(file_xml); } } } diff --git a/MagickCore/mime.c b/MagickCore/mime.c index 865ad21c5..430b95bdf 100644 --- a/MagickCore/mime.c +++ b/MagickCore/mime.c @@ -835,7 +835,7 @@ static MagickBooleanType LoadMimeCache(LinkedListInfo *mime_cache, { char path[MagickPathExtent], - *xml; + *file_xml; GetPathComponent(filename,HeadPath,path); if (*path != '\0') @@ -845,11 +845,11 @@ static MagickBooleanType LoadMimeCache(LinkedListInfo *mime_cache, (void) CopyMagickString(path,attribute,MagickPathExtent); else (void) ConcatenateMagickString(path,attribute,MagickPathExtent); - xml=FileToXML(path,~0UL); - if (xml != (char *) NULL) + file_xml=FileToXML(path,~0UL); + if (file_xml != (char *) NULL) { - status&=LoadMimeCache(mime_cache,xml,path,depth+1,exception); - xml=DestroyString(xml); + status&=LoadMimeCache(mime_cache,file_xml,path,depth+1,exception); + file_xml=DestroyString(file_xml); } } } diff --git a/MagickCore/policy.c b/MagickCore/policy.c index f3d1be3d1..7f0ac5fed 100644 --- a/MagickCore/policy.c +++ b/MagickCore/policy.c @@ -806,7 +806,7 @@ static MagickBooleanType LoadPolicyCache(LinkedListInfo *policy_cache, { char path[MagickPathExtent], - *xml; + *file_xml; GetPathComponent(filename,HeadPath,path); if (*path != '\0') @@ -816,12 +816,12 @@ static MagickBooleanType LoadPolicyCache(LinkedListInfo *policy_cache, (void) CopyMagickString(path,token,MagickPathExtent); else (void) ConcatenateMagickString(path,token,MagickPathExtent); - xml=FileToXML(path,~0UL); - if (xml != (char *) NULL) + file_xml=FileToXML(path,~0UL); + if (file_xml != (char *) NULL) { - status&=LoadPolicyCache(policy_cache,xml,path,depth+1, + status&=LoadPolicyCache(policy_cache,file_xml,path,depth+1, exception); - xml=(char *) RelinquishMagickMemory(xml); + file_xml=DestroyString(file_xml); } } } diff --git a/MagickCore/xml-tree.c b/MagickCore/xml-tree.c index d18907012..668942428 100644 --- a/MagickCore/xml-tree.c +++ b/MagickCore/xml-tree.c @@ -1483,13 +1483,15 @@ static char *ParseEntities(char *xml,char **entities,int state) else { char - *xml; + *extent_xml; - xml=(char *) AcquireQuantumMemory(extent,sizeof(*xml)); - if (xml != (char *) NULL) + extent_xml=(char *) AcquireQuantumMemory(extent, + sizeof(*extent_xml)); + if (extent_xml != (char *) NULL) { - (void) CopyMagickString(xml,p,extent*sizeof(*xml)); - p=xml; + (void) CopyMagickString(extent_xml,p,extent* + sizeof(*extent_xml)); + p= extent_xml; } } if (p == (char *) NULL)