From c9f5cc8270d23f1ccfd25806c16be69fbcb6863c Mon Sep 17 00:00:00 2001 From: dirk Date: Sun, 17 Jul 2016 18:59:02 +0200 Subject: [PATCH] Fixed compiler warning. --- MagickCore/delegate.c | 23 +++++++++++------------ MagickCore/locale.c | 30 ++++++++++++++---------------- MagickCore/mime.c | 28 +++++++++++++--------------- 3 files changed, 38 insertions(+), 43 deletions(-) diff --git a/MagickCore/delegate.c b/MagickCore/delegate.c index 7fd5b4f8e..8edee1d51 100644 --- a/MagickCore/delegate.c +++ b/MagickCore/delegate.c @@ -179,13 +179,13 @@ static LinkedListInfo *AcquireDelegateCache(const char *filename, ExceptionInfo *exception) { LinkedListInfo - *delegate_cache; + *cache; MagickStatusType status; - delegate_cache=NewLinkedList(0); - if (delegate_cache == (LinkedListInfo *) NULL) + cache=NewLinkedList(0); + if (cache == (LinkedListInfo *) NULL) ThrowFatalException(ResourceLimitFatalError,"MemoryAllocationFailed"); status=MagickTrue; #if !defined(MAGICKCORE_ZERO_CONFIGURATION_SUPPORT) @@ -200,17 +200,16 @@ static LinkedListInfo *AcquireDelegateCache(const char *filename, option=(const StringInfo *) GetNextValueInLinkedList(options); while (option != (const StringInfo *) NULL) { - status&=LoadDelegateCache(delegate_cache,(const char *) + status&=LoadDelegateCache(cache,(const char *) GetStringInfoDatum(option),GetStringInfoPath(option),0,exception); option=(const StringInfo *) GetNextValueInLinkedList(options); } options=DestroyConfigureOptions(options); } #endif - if (IsLinkedListEmpty(delegate_cache) != MagickFalse) - status&=LoadDelegateCache(delegate_cache,DelegateMap,"built-in",0, - exception); - return(delegate_cache); + if (IsLinkedListEmpty(cache) != MagickFalse) + status&=LoadDelegateCache(cache,DelegateMap,"built-in",0,exception); + return(cache); } /* @@ -1975,7 +1974,7 @@ MagickExport MagickBooleanType ListDelegateInfo(FILE *file, % % The format of the LoadDelegateCache method is: % -% MagickBooleanType LoadDelegateCache(LinkedListInfo *delegate_cache, +% MagickBooleanType LoadDelegateCache(LinkedListInfo *cache, % const char *xml,const char *filename,const size_t depth, % ExceptionInfo *exception) % @@ -1990,7 +1989,7 @@ MagickExport MagickBooleanType ListDelegateInfo(FILE *file, % o exception: return any errors or warnings in this structure. % */ -static MagickBooleanType LoadDelegateCache(LinkedListInfo *delegate_cache, +static MagickBooleanType LoadDelegateCache(LinkedListInfo *cache, const char *xml,const char *filename,const size_t depth, ExceptionInfo *exception) { @@ -2082,7 +2081,7 @@ 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(cache,file_xml,path, depth+1,exception); file_xml=DestroyString(file_xml); } @@ -2110,7 +2109,7 @@ static MagickBooleanType LoadDelegateCache(LinkedListInfo *delegate_cache, continue; if (LocaleCompare(keyword,"/>") == 0) { - status=AppendValueToLinkedList(delegate_cache,delegate_info); + status=AppendValueToLinkedList(cache,delegate_info); if (status == MagickFalse) (void) ThrowMagickException(exception,GetMagickModule(), ResourceLimitError,"MemoryAllocationFailed","`%s'", diff --git a/MagickCore/locale.c b/MagickCore/locale.c index 4182bbed6..9ee5ae7c6 100644 --- a/MagickCore/locale.c +++ b/MagickCore/locale.c @@ -189,9 +189,9 @@ static SplayTreeInfo *AcquireLocaleSplayTree(const char *filename, status; SplayTreeInfo - *locale_cache; + *cache; - locale_cache=NewSplayTree(CompareSplayTreeString,(void *(*)(void *)) NULL, + cache=NewSplayTree(CompareSplayTreeString,(void *(*)(void *)) NULL, DestroyLocaleNode); if (locale_cache == (SplayTreeInfo *) NULL) ThrowFatalException(ResourceLimitFatalError,"MemoryAllocationFailed"); @@ -208,19 +208,19 @@ static SplayTreeInfo *AcquireLocaleSplayTree(const char *filename, option=(const StringInfo *) GetNextValueInLinkedList(options); while (option != (const StringInfo *) NULL) { - status&=LoadLocaleCache(locale_cache,(const char *) + status&=LoadLocaleCache(cache,(const char *) GetStringInfoDatum(option),GetStringInfoPath(option),locale,0, exception); option=(const StringInfo *) GetNextValueInLinkedList(options); } options=DestroyLocaleOptions(options); - if (GetNumberOfNodesInSplayTree(locale_cache) == 0) + if (GetNumberOfNodesInSplayTree(cache) == 0) { options=GetLocaleOptions("english.xml",exception); option=(const StringInfo *) GetNextValueInLinkedList(options); while (option != (const StringInfo *) NULL) { - status&=LoadLocaleCache(locale_cache,(const char *) + status&=LoadLocaleCache(cache,(const char *) GetStringInfoDatum(option),GetStringInfoPath(option),locale,0, exception); option=(const StringInfo *) GetNextValueInLinkedList(options); @@ -229,10 +229,10 @@ static SplayTreeInfo *AcquireLocaleSplayTree(const char *filename, } } #endif - if (GetNumberOfNodesInSplayTree(locale_cache) == 0) - status&=LoadLocaleCache(locale_cache,LocaleMap,"built-in",locale,0, + if (GetNumberOfNodesInSplayTree(cache) == 0) + status&=LoadLocaleCache(cache,LocaleMap,"built-in",locale,0, exception); - return(locale_cache); + return(cache); } #if defined(MAGICKCORE_LOCALE_SUPPORT) @@ -1094,9 +1094,8 @@ MagickExport MagickBooleanType ListLocaleInfo(FILE *file, % % The format of the LoadLocaleCache method is: % -% MagickBooleanType LoadLocaleCache(SplayTreeInfo *locale_cache, -% const char *xml,const char *filename,const size_t depth, -% ExceptionInfo *exception) +% MagickBooleanType LoadLocaleCache(SplayTreeInfo *cache,const char *xml, +% const char *filename,const size_t depth,ExceptionInfo *exception) % % A description of each parameter follows: % @@ -1149,9 +1148,8 @@ static void LocaleFatalErrorHandler( exit(1); } -static MagickBooleanType LoadLocaleCache(SplayTreeInfo *locale_cache, - const char *xml,const char *filename,const char *locale,const size_t depth, - ExceptionInfo *exception) +static MagickBooleanType LoadLocaleCache(SplayTreeInfo *cache,const char *xml, + const char *filename,const char *locale,const size_t depth,ExceptionInfo *exception) { char keyword[MagickLocaleExtent], @@ -1268,7 +1266,7 @@ static MagickBooleanType LoadLocaleCache(SplayTreeInfo *locale_cache, file_xml=FileToXML(path,~0UL); if (file_xml != (char *) NULL) { - status&=LoadLocaleCache(locale_cache,file_xml,path,locale, + status&=LoadLocaleCache(cache,file_xml,path,locale, depth+1,exception); file_xml=DestroyString(file_xml); } @@ -1336,7 +1334,7 @@ static MagickBooleanType LoadLocaleCache(SplayTreeInfo *locale_cache, locale_info->tag=ConstantString(tag); locale_info->message=ConstantString(message); locale_info->signature=MagickCoreSignature; - status=AddValueToSplayTree(locale_cache,locale_info->tag,locale_info); + status=AddValueToSplayTree(cache,locale_info->tag,locale_info); if (status == MagickFalse) (void) ThrowMagickException(exception,GetMagickModule(), ResourceLimitError,"MemoryAllocationFailed","`%s'", diff --git a/MagickCore/mime.c b/MagickCore/mime.c index 68dacff1f..5c1a6f753 100644 --- a/MagickCore/mime.c +++ b/MagickCore/mime.c @@ -158,13 +158,13 @@ MagickExport LinkedListInfo *AcquireMimeCache(const char *filename, ExceptionInfo *exception) { LinkedListInfo - *mime_cache; + *cache; MagickStatusType status; - mime_cache=NewLinkedList(0); - if (mime_cache == (LinkedListInfo *) NULL) + cache=NewLinkedList(0); + if (cache == (LinkedListInfo *) NULL) ThrowFatalException(ResourceLimitFatalError,"MemoryAllocationFailed"); status=MagickTrue; #if !defined(MAGICKCORE_ZERO_CONFIGURATION_SUPPORT) @@ -179,16 +179,16 @@ MagickExport LinkedListInfo *AcquireMimeCache(const char *filename, option=(const StringInfo *) GetNextValueInLinkedList(options); while (option != (const StringInfo *) NULL) { - status&=LoadMimeCache(mime_cache,(const char *) + status&=LoadMimeCache(cache,(const char *) GetStringInfoDatum(option),GetStringInfoPath(option),0,exception); option=(const StringInfo *) GetNextValueInLinkedList(options); } options=DestroyConfigureOptions(options); } #endif - if (IsLinkedListEmpty(mime_cache) != MagickFalse) - status&=LoadMimeCache(mime_cache,MimeMap,"built-in",0,exception); - return(mime_cache); + if (IsLinkedListEmpty(cache) != MagickFalse) + status&=LoadMimeCache(cache,MimeMap,"built-in",0,exception); + return(cache); } /* @@ -775,9 +775,8 @@ MagickExport MagickBooleanType ListMimeInfo(FILE *file,ExceptionInfo *exception) % % The format of the LoadMimeCache method is: % -% MagickBooleanType LoadMimeCache(LinkedListInfo *mime_cache, -% const char *xml,const char *filename,const size_t depth, -% ExceptionInfo *exception) +% MagickBooleanType LoadMimeCache(LinkedListInfo *cache,const char *xml, +% const char *filename,const size_t depth,ExceptionInfo *exception) % % A description of each parameter follows: % @@ -790,9 +789,8 @@ MagickExport MagickBooleanType ListMimeInfo(FILE *file,ExceptionInfo *exception) % o exception: return any errors or warnings in this structure. % */ -static MagickBooleanType LoadMimeCache(LinkedListInfo *mime_cache, - const char *xml,const char *filename,const size_t depth, - ExceptionInfo *exception) +static MagickBooleanType LoadMimeCache(LinkedListInfo *cache,const char *xml, + const char *filename,const size_t depth,ExceptionInfo *exception) { const char *attribute; @@ -848,7 +846,7 @@ static MagickBooleanType LoadMimeCache(LinkedListInfo *mime_cache, file_xml=FileToXML(path,~0UL); if (file_xml != (char *) NULL) { - status&=LoadMimeCache(mime_cache,file_xml,path,depth+1,exception); + status&=LoadMimeCache(cache,file_xml,path,depth+1,exception); file_xml=DestroyString(file_xml); } } @@ -961,7 +959,7 @@ static MagickBooleanType LoadMimeCache(LinkedListInfo *mime_cache, attribute=GetXMLTreeAttribute(mime,"type"); if (attribute != (const char *) NULL) mime_info->type=ConstantString(attribute); - status=AppendValueToLinkedList(mime_cache,mime_info); + status=AppendValueToLinkedList(cache,mime_info); if (status == MagickFalse) (void) ThrowMagickException(exception,GetMagickModule(), ResourceLimitError,"MemoryAllocationFailed","`%s'",filename); -- 2.40.0