]> granicus.if.org Git - imagemagick/commitdiff
Added missing checks for MAGICKCORE_ZERO_CONFIGURATION_SUPPORT.
authordirk <dirk@git.imagemagick.org>
Sun, 17 Jul 2016 17:32:43 +0000 (19:32 +0200)
committerdirk <dirk@git.imagemagick.org>
Sun, 17 Jul 2016 17:32:43 +0000 (19:32 +0200)
MagickCore/coder.c
MagickCore/color.c
MagickCore/configure.c
MagickCore/log.c
MagickCore/magic.c
MagickCore/opencl.c
MagickCore/policy.c
MagickCore/threshold.c

index d8907f0518b16c70d8fbba926879e77fe4c1c2bd..bb2a3d2b21c33add87537042412c541bb79ed1ef 100644 (file)
@@ -322,12 +322,6 @@ static void *DestroyCoderNode(void *coder_info)
 static SplayTreeInfo *AcquireCoderCache(const char *filename,
   ExceptionInfo *exception)
 {
-  const StringInfo
-    *option;
-
-  LinkedListInfo
-    *options;
-
   MagickStatusType
     status;
 
@@ -335,25 +329,35 @@ static SplayTreeInfo *AcquireCoderCache(const char *filename,
     i;
 
   SplayTreeInfo
-    *coder_cache;
+    *cache;
 
   /*
     Load external coder map.
   */
-  coder_cache=NewSplayTree(CompareSplayTreeString,RelinquishMagickMemory,
+  cache=NewSplayTree(CompareSplayTreeString,RelinquishMagickMemory,
     DestroyCoderNode);
-  if (coder_cache == (SplayTreeInfo *) NULL)
+  if (cache == (SplayTreeInfo *) NULL)
     ThrowFatalException(ResourceLimitFatalError,"MemoryAllocationFailed");
   status=MagickTrue;
-  options=GetConfigureOptions(filename,exception);
-  option=(const StringInfo *) GetNextValueInLinkedList(options);
-  while (option != (const StringInfo *) NULL)
+#if !defined(MAGICKCORE_ZERO_CONFIGURATION_SUPPORT)
   {
-    status&=LoadCoderCache(coder_cache,(const char *)
-      GetStringInfoDatum(option),GetStringInfoPath(option),0,exception);
+    const StringInfo
+      *option;
+
+    LinkedListInfo
+      *options;
+
+    options=GetConfigureOptions(filename,exception);
     option=(const StringInfo *) GetNextValueInLinkedList(options);
+    while (option != (const StringInfo *) NULL)
+    {
+      status&=LoadCoderCache(cache,(const char *) GetStringInfoDatum(option),
+        GetStringInfoPath(option),0,exception);
+      option=(const StringInfo *) GetNextValueInLinkedList(options);
+    }
+    options=DestroyConfigureOptions(options);
   }
-  options=DestroyConfigureOptions(options);
+#endif
   /*
     Load built-in coder map.
   */
@@ -379,13 +383,13 @@ static SplayTreeInfo *AcquireCoderCache(const char *filename,
     coder_info->name=(char *) p->name;
     coder_info->exempt=MagickTrue;
     coder_info->signature=MagickCoreSignature;
-    status&=AddValueToSplayTree(coder_cache,ConstantString(coder_info->magick),
+    status&=AddValueToSplayTree(cache,ConstantString(coder_info->magick),
       coder_info);
     if (status == MagickFalse)
       (void) ThrowMagickException(exception,GetMagickModule(),
         ResourceLimitError,"MemoryAllocationFailed","`%s'",coder_info->name);
   }
-  return(coder_cache);
+  return(cache);
 }
 \f
 /*
@@ -788,9 +792,8 @@ MagickExport MagickBooleanType ListCoderInfo(FILE *file,
 %
 %  The format of the LoadCoderCache coder is:
 %
-%      MagickBooleanType LoadCoderCache(SplayTreeInfo *coder_cache,
-%        const char *xml,const char *filename,const size_t depth,
-%        ExceptionInfo *exception)
+%      MagickBooleanType LoadCoderCache(SplayTreeInfo *cache,const char *xml,
+%        const char *filename,const size_t depth,ExceptionInfo *exception)
 %
 %  A description of each parameter follows:
 %
@@ -803,9 +806,8 @@ MagickExport MagickBooleanType ListCoderInfo(FILE *file,
 %    o exception: return any errors or warnings in this structure.
 %
 */
-static MagickBooleanType LoadCoderCache(SplayTreeInfo *coder_cache,
-  const char *xml,const char *filename,const size_t depth,
-  ExceptionInfo *exception)
+static MagickBooleanType LoadCoderCache(SplayTreeInfo *cache,const char *xml,
+  const char *filename,const size_t depth,ExceptionInfo *exception)
 {
   char
     keyword[MagickPathExtent],
@@ -895,7 +897,7 @@ static MagickBooleanType LoadCoderCache(SplayTreeInfo *coder_cache,
                   file_xml=FileToXML(path,~0UL);
                   if (file_xml != (char *) NULL)
                     {
-                      status&=LoadCoderCache(coder_cache,file_xml,path,depth+1,
+                      status&=LoadCoderCache(cache,file_xml,path,depth+1,
                         exception);
                       file_xml=DestroyString(file_xml);
                     }
@@ -922,8 +924,8 @@ static MagickBooleanType LoadCoderCache(SplayTreeInfo *coder_cache,
       continue;
     if (LocaleCompare(keyword,"/>") == 0)
       {
-        status=AddValueToSplayTree(coder_cache,ConstantString(
-          coder_info->magick),coder_info);
+        status=AddValueToSplayTree(cache,ConstantString(coder_info->magick),
+          coder_info);
         if (status == MagickFalse)
           (void) ThrowMagickException(exception,GetMagickModule(),
             ResourceLimitError,"MemoryAllocationFailed","`%s'",
index 4c5ec1379d349ae1b951eb587aa931a266b95060..c036f2d799289206c239a838cd850a248f48f6af 100644 (file)
@@ -828,12 +828,8 @@ static MagickBooleanType
 static LinkedListInfo *AcquireColorCache(const char *filename,
   ExceptionInfo *exception)
 {
-  const StringInfo
-    *option;
-
   LinkedListInfo
-    *color_cache,
-    *options;
+    *cache;
 
   MagickStatusType
     status;
@@ -844,19 +840,29 @@ static LinkedListInfo *AcquireColorCache(const char *filename,
   /*
     Load external color map.
   */
-  color_cache=NewLinkedList(0);
-  if (color_cache == (LinkedListInfo *) NULL)
+  cache=NewLinkedList(0);
+  if (cache == (LinkedListInfo *) NULL)
     ThrowFatalException(ResourceLimitFatalError,"MemoryAllocationFailed");
   status=MagickTrue;
-  options=GetConfigureOptions(filename,exception);
-  option=(const StringInfo *) GetNextValueInLinkedList(options);
-  while (option != (const StringInfo *) NULL)
+#if !defined(MAGICKCORE_ZERO_CONFIGURATION_SUPPORT)
   {
-    status&=LoadColorCache(color_cache,(const char *)
-      GetStringInfoDatum(option),GetStringInfoPath(option),0,exception);
+    const StringInfo
+      *option;
+
+    LinkedListInfo
+      *options;
+
+    options=GetConfigureOptions(filename,exception);
     option=(const StringInfo *) GetNextValueInLinkedList(options);
+    while (option != (const StringInfo *) NULL)
+    {
+      status&=LoadColorCache(cache,(const char *) GetStringInfoDatum(option),
+        GetStringInfoPath(option),0,exception);
+      option=(const StringInfo *) GetNextValueInLinkedList(options);
+    }
+    options=DestroyConfigureOptions(options);
   }
-  options=DestroyConfigureOptions(options);
+#endif
   /*
     Load built-in color map.
   */
@@ -887,15 +893,14 @@ static LinkedListInfo *AcquireColorCache(const char *filename,
     color_info->compliance=(ComplianceType) p->compliance;
     color_info->exempt=MagickTrue;
     color_info->signature=MagickCoreSignature;
-    status&=AppendValueToLinkedList(color_cache,color_info);
+    status&=AppendValueToLinkedList(cache,color_info);
     if (status == MagickFalse)
       (void) ThrowMagickException(exception,GetMagickModule(),
         ResourceLimitError,"MemoryAllocationFailed","`%s'",color_info->name);
   }
-  return(color_cache);
+  return(cache);
 }
-
-
+\f
 /*
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 %                                                                             %
@@ -1976,9 +1981,8 @@ MagickExport MagickBooleanType ListColorInfo(FILE *file,
 %
 %  The format of the LoadColorCache method is:
 %
-%      MagickBooleanType LoadColorCache(LinkedListInfo *color_cache,
-%        const char *xml,const char *filename,const size_t depth,
-%        ExceptionInfo *exception)
+%      MagickBooleanType LoadColorCache(LinkedListInfo *cache,const char *xml,
+%        const char *filename,const size_t depth,ExceptionInfo *exception)
 %
 %  A description of each parameter follows:
 %
@@ -1991,9 +1995,8 @@ MagickExport MagickBooleanType ListColorInfo(FILE *file,
 %    o exception: return any errors or warnings in this structure.
 %
 */
-static MagickBooleanType LoadColorCache(LinkedListInfo *color_cache,
-  const char *xml,const char *filename,const size_t depth,
-  ExceptionInfo *exception)
+static MagickBooleanType LoadColorCache(LinkedListInfo *cache,const char *xml,
+  const char *filename,const size_t depth,ExceptionInfo *exception)
 {
   char
     keyword[MagickPathExtent],
@@ -2083,7 +2086,7 @@ static MagickBooleanType LoadColorCache(LinkedListInfo *color_cache,
                   file_xml=FileToXML(path,~0UL);
                   if (file_xml != (char *) NULL)
                     {
-                      status&=LoadColorCache(color_cache,file_xml,path,depth+1,
+                      status&=LoadColorCache(cache,file_xml,path,depth+1,
                         exception);
                       file_xml=DestroyString(file_xml);
                     }
@@ -2110,7 +2113,7 @@ static MagickBooleanType LoadColorCache(LinkedListInfo *color_cache,
       continue;
     if (LocaleCompare(keyword,"/>") == 0)
       {
-        status=AppendValueToLinkedList(color_cache,color_info);
+        status=AppendValueToLinkedList(cache,color_info);
         if (status == MagickFalse)
           (void) ThrowMagickException(exception,GetMagickModule(),
             ResourceLimitError,"MemoryAllocationFailed","`%s'",
index 081283b32822ed51f654ceccb7052373949732b9..d1cae883104daf234ce8c6810d7167e563add1ca 100644 (file)
@@ -150,12 +150,8 @@ static MagickBooleanType
 static LinkedListInfo *AcquireConfigureCache(const char *filename,
   ExceptionInfo *exception)
 {
-  const StringInfo
-    *option;
-
   LinkedListInfo
-    *configure_cache,
-    *options;
+    *cache;
 
   MagickStatusType
     status;
@@ -166,19 +162,29 @@ static LinkedListInfo *AcquireConfigureCache(const char *filename,
   /*
     Load external configure map.
   */
-  configure_cache=NewLinkedList(0);
-  if (configure_cache == (LinkedListInfo *) NULL)
+  cache=NewLinkedList(0);
+  if (cache == (LinkedListInfo *) NULL)
     ThrowFatalException(ResourceLimitFatalError,"MemoryAllocationFailed");
   status=MagickTrue;
-  options=GetConfigureOptions(filename,exception);
-  option=(const StringInfo *) GetNextValueInLinkedList(options);
-  while (option != (const StringInfo *) NULL)
+#if !defined(MAGICKCORE_ZERO_CONFIGURATION_SUPPORT)
   {
-    status&=LoadConfigureCache(configure_cache,(const char *)
-      GetStringInfoDatum(option),GetStringInfoPath(option),0,exception);
+    const StringInfo
+      *option;
+
+    LinkedListInfo
+      *options;
+
+    options=GetConfigureOptions(filename,exception);
     option=(const StringInfo *) GetNextValueInLinkedList(options);
+    while (option != (const StringInfo *) NULL)
+    {
+      status&=LoadConfigureCache(cache,(const char *)
+        GetStringInfoDatum(option),GetStringInfoPath(option),0,exception);
+      option=(const StringInfo *) GetNextValueInLinkedList(options);
+    }
+    options=DestroyConfigureOptions(options);
   }
-  options=DestroyConfigureOptions(options);
+#endif
   /*
     Load built-in configure map.
   */
@@ -205,13 +211,13 @@ static LinkedListInfo *AcquireConfigureCache(const char *filename,
     configure_info->value=(char *) p->value;
     configure_info->exempt=MagickTrue;
     configure_info->signature=MagickCoreSignature;
-    status&=AppendValueToLinkedList(configure_cache,configure_info);
+    status&=AppendValueToLinkedList(cache,configure_info);
     if (status == MagickFalse)
       (void) ThrowMagickException(exception,GetMagickModule(),
         ResourceLimitError,"MemoryAllocationFailed","`%s'",
         configure_info->name);
   }
-  return(configure_cache);
+  return(cache);
 }
 \f
 /*
@@ -1121,7 +1127,7 @@ MagickExport MagickBooleanType ListConfigureInfo(FILE *file,
 %
 %  The format of the LoadConfigureCache method is:
 %
-%      MagickBooleanType LoadConfigureCache(LinkedListInfo *configure_cache,
+%      MagickBooleanType LoadConfigureCache(LinkedListInfo *cache,
 %        const char *xml,const char *filename,const size_t depth,
 %        ExceptionInfo *exception)
 %
@@ -1136,7 +1142,7 @@ MagickExport MagickBooleanType ListConfigureInfo(FILE *file,
 %    o exception: return any errors or warnings in this structure.
 %
 */
-static MagickBooleanType LoadConfigureCache(LinkedListInfo *configure_cache,
+static MagickBooleanType LoadConfigureCache(LinkedListInfo *cache,
   const char *xml,const char *filename,const size_t depth,
   ExceptionInfo *exception)
 {
@@ -1226,8 +1232,8 @@ static MagickBooleanType LoadConfigureCache(LinkedListInfo *configure_cache,
                   file_xml=FileToXML(path,~0UL);
                   if (file_xml != (char *) NULL)
                     {
-                      status&=LoadConfigureCache(configure_cache,file_xml,path,
-                        depth+1,exception);
+                      status&=LoadConfigureCache(cache,file_xml,path,depth+1,
+                        exception);
                       file_xml=DestroyString(file_xml);
                     }
                 }
@@ -1254,7 +1260,7 @@ static MagickBooleanType LoadConfigureCache(LinkedListInfo *configure_cache,
       continue;
     if (LocaleCompare(keyword,"/>") == 0)
       {
-        status=AppendValueToLinkedList(configure_cache,configure_info);
+        status=AppendValueToLinkedList(cache,configure_info);
         if (status == MagickFalse)
           (void) ThrowMagickException(exception,GetMagickModule(),
             ResourceLimitError,"MemoryAllocationFailed","`%s'",
index cd858e9d29938991c04a3d5acd270a763c8eded2..56b88ca806efca753738e57e44a0a04fdedb3b61 100644 (file)
@@ -255,12 +255,8 @@ static MagickBooleanType
 static LinkedListInfo *AcquireLogCache(const char *filename,
   ExceptionInfo *exception)
 {
-  const StringInfo
-    *option;
-
   LinkedListInfo
-    *log_cache,
-    *options;
+    *cache;
 
   MagickStatusType
     status;
@@ -271,19 +267,29 @@ static LinkedListInfo *AcquireLogCache(const char *filename,
   /*
     Load external log map.
   */
-  log_cache=NewLinkedList(0);
-  if (log_cache == (LinkedListInfo *) NULL)
+  cache=NewLinkedList(0);
+  if (cache == (LinkedListInfo *) NULL)
     ThrowFatalException(ResourceLimitFatalError,"MemoryAllocationFailed");
   status=MagickTrue;
-  options=GetConfigureOptions(filename,exception);
-  option=(const StringInfo *) GetNextValueInLinkedList(options);
-  while (option != (const StringInfo *) NULL)
+#if !defined(MAGICKCORE_ZERO_CONFIGURATION_SUPPORT)
   {
-    status&=LoadLogCache(log_cache,(const char *) GetStringInfoDatum(option),
-      GetStringInfoPath(option),0,exception);
+    const StringInfo
+      *option;
+
+    LinkedListInfo
+      *options;
+
+    options=GetConfigureOptions(filename,exception);
     option=(const StringInfo *) GetNextValueInLinkedList(options);
+    while (option != (const StringInfo *) NULL)
+    {
+      status&=LoadLogCache(cache,(const char *) GetStringInfoDatum(option),
+        GetStringInfoPath(option),0,exception);
+      option=(const StringInfo *) GetNextValueInLinkedList(options);
+    }
+    options=DestroyConfigureOptions(options);
   }
-  options=DestroyConfigureOptions(options);
+#endif
   /*
     Load built-in log map.
   */
@@ -311,12 +317,12 @@ static LinkedListInfo *AcquireLogCache(const char *filename,
     log_info->filename=ConstantString(p->filename);
     log_info->format=ConstantString(p->format);
     log_info->signature=MagickCoreSignature;
-    status&=AppendValueToLinkedList(log_cache,log_info);
+    status&=AppendValueToLinkedList(cache,log_info);
     if (status == MagickFalse)
       (void) ThrowMagickException(exception,GetMagickModule(),
         ResourceLimitError,"MemoryAllocationFailed","`%s'",log_info->name);
   }
-  return(log_cache);
+  return(cache);
 }
 \f
 /*
@@ -1406,7 +1412,7 @@ MagickBooleanType LogMagickEvent(const LogEventType type,const char *module,
 %
 %  The format of the LoadLogCache method is:
 %
-%      MagickBooleanType LoadLogCache(LinkedListInfo *log_cache,const char *xml,
+%      MagickBooleanType LoadLogCache(LinkedListInfo *cache,const char *xml,
 %        const char *filename,const size_t depth,ExceptionInfo *exception)
 %
 %  A description of each parameter follows:
@@ -1420,7 +1426,7 @@ MagickBooleanType LogMagickEvent(const LogEventType type,const char *module,
 %    o exception: return any errors or warnings in this structure.
 %
 */
-static MagickBooleanType LoadLogCache(LinkedListInfo *log_cache,const char *xml,
+static MagickBooleanType LoadLogCache(LinkedListInfo *cache,const char *xml,
   const char *filename,const size_t depth,ExceptionInfo *exception)
 {
   char
@@ -1508,7 +1514,7 @@ static MagickBooleanType LoadLogCache(LinkedListInfo *log_cache,const char *xml,
                   file_xml=FileToXML(path,~0UL);
                   if (file_xml != (char *) NULL)
                     {
-                      status&=LoadLogCache(log_cache,file_xml,path,depth+1,
+                      status&=LoadLogCache(cache,file_xml,path,depth+1,
                         exception);
                       file_xml=DestroyString(file_xml);
                     }
@@ -1535,7 +1541,7 @@ static MagickBooleanType LoadLogCache(LinkedListInfo *log_cache,const char *xml,
       continue;
     if (LocaleCompare(keyword,"</logmap>") == 0)
       {
-        status=AppendValueToLinkedList(log_cache,log_info);
+        status=AppendValueToLinkedList(cache,log_info);
         if (status == MagickFalse)
           (void) ThrowMagickException(exception,GetMagickModule(),
             ResourceLimitError,"MemoryAllocationFailed","`%s'",filename);
@@ -1627,7 +1633,7 @@ static MagickBooleanType LoadLogCache(LinkedListInfo *log_cache,const char *xml,
     }
   }
   token=DestroyString(token);
-  if (log_cache == (LinkedListInfo *) NULL)
+  if (cache == (LinkedListInfo *) NULL)
     return(MagickFalse);
   return(status != 0 ? MagickTrue : MagickFalse);
 }
index a9767220af0d447b43721518bbb25fb9dd59ffbd..331bba9da91f791858c1aa7be5a7e2c92ef29096 100644 (file)
@@ -261,15 +261,8 @@ static int CompareMagickInfoSize(const void *a,const void *b)
 static LinkedListInfo *AcquireMagicCache(const char *filename,
   ExceptionInfo *exception)
 {
-  char
-    path[MagickPathExtent];
-
-  const StringInfo
-    *option;
-
   LinkedListInfo
-    *magic_cache,
-    *options;
+    *cache;
 
   MagickStatusType
     status;
@@ -280,21 +273,34 @@ static LinkedListInfo *AcquireMagicCache(const char *filename,
   /*
     Load external magic map.
   */
-  magic_cache=NewLinkedList(0);
-  if (magic_cache == (LinkedListInfo *) NULL)
+  cache=NewLinkedList(0);
+  if (cache == (LinkedListInfo *) NULL)
     ThrowFatalException(ResourceLimitFatalError,"MemoryAllocationFailed");
   status=MagickTrue;
-  *path='\0';
-  options=GetConfigureOptions(filename,exception);
-  option=(const StringInfo *) GetNextValueInLinkedList(options);
-  while (option != (const StringInfo *) NULL)
+#if !defined(MAGICKCORE_ZERO_CONFIGURATION_SUPPORT)
   {
-    (void) CopyMagickString(path,GetStringInfoPath(option),MagickPathExtent);
-    status&=LoadMagicCache(magic_cache,(const char *)
-      GetStringInfoDatum(option),GetStringInfoPath(option),0,exception);
+    char
+      path[MagickPathExtent];
+
+    const StringInfo
+      *option;
+
+    LinkedListInfo
+      *options;
+
+    *path='\0';
+    options=GetConfigureOptions(filename,exception);
     option=(const StringInfo *) GetNextValueInLinkedList(options);
+    while (option != (const StringInfo *) NULL)
+    {
+      (void) CopyMagickString(path,GetStringInfoPath(option),MagickPathExtent);
+      status&=LoadMagicCache(cache,(const char *)
+        GetStringInfoDatum(option),GetStringInfoPath(option),0,exception);
+      option=(const StringInfo *) GetNextValueInLinkedList(options);
+    }
+    options=DestroyConfigureOptions(options);
   }
-  options=DestroyConfigureOptions(options);
+#endif
   /*
     Load built-in magic map.
   */
@@ -323,13 +329,13 @@ static LinkedListInfo *AcquireMagicCache(const char *filename,
     magic_info->length=p->length;
     magic_info->exempt=MagickTrue;
     magic_info->signature=MagickCoreSignature;
-    status&=InsertValueInSortedLinkedList(magic_cache,CompareMagickInfoSize,
+    status&=InsertValueInSortedLinkedList(cache,CompareMagickInfoSize,
       NULL,magic_info);
     if (status == MagickFalse)
       (void) ThrowMagickException(exception,GetMagickModule(),
         ResourceLimitError,"MemoryAllocationFailed","`%s'",magic_info->name);
   }
-  return(magic_cache);
+  return(cache);
 }
 \f
 /*
@@ -808,9 +814,8 @@ MagickExport MagickBooleanType ListMagicInfo(FILE *file,
 %
 %  The format of the LoadMagicCache method is:
 %
-%      MagickBooleanType LoadMagicCache(LinkedListInfo *magic_cache,
-%        const char *xml,const char *filename,const size_t depth,
-%        ExceptionInfo *exception)
+%      MagickBooleanType LoadMagicCache(LinkedListInfo *cache,const char *xml,
+%        const char *filename,const size_t depth,ExceptionInfo *exception)
 %
 %  A description of each parameter follows:
 %
@@ -823,9 +828,8 @@ MagickExport MagickBooleanType ListMagicInfo(FILE *file,
 %    o exception: return any errors or warnings in this structure.
 %
 */
-static MagickBooleanType LoadMagicCache(LinkedListInfo *magic_cache,
-  const char *xml,const char *filename,const size_t depth,
-  ExceptionInfo *exception)
+static MagickBooleanType LoadMagicCache(LinkedListInfo *cache,const char *xml,
+  const char *filename,const size_t depth,ExceptionInfo *exception)
 {
   char
     keyword[MagickPathExtent],
@@ -915,7 +919,7 @@ static MagickBooleanType LoadMagicCache(LinkedListInfo *magic_cache,
                   file_xml=FileToXML(path,~0UL);
                   if (xml != (char *) NULL)
                     {
-                      status&=LoadMagicCache(magic_cache,file_xml,path,depth+1,
+                      status&=LoadMagicCache(cache,file_xml,path,depth+1,
                         exception);
                       file_xml=DestroyString(file_xml);
                     }
@@ -942,7 +946,7 @@ static MagickBooleanType LoadMagicCache(LinkedListInfo *magic_cache,
       continue;
     if (LocaleCompare(keyword,"/>") == 0)
       {
-        status=InsertValueInSortedLinkedList(magic_cache,CompareMagickInfoSize,
+        status=InsertValueInSortedLinkedList(cache,CompareMagickInfoSize,
           NULL,magic_info);
         if (status == MagickFalse)
           (void) ThrowMagickException(exception,GetMagickModule(),
index a68e767352a576d026fed8548937a889b070a206..790ad7c2c9cabc6903a12b50b96709a44bb01f39 100644 (file)
@@ -908,7 +908,9 @@ static MagickBooleanType LoadOpenCLBenchmarks(MagickCLEnv clEnv,
     We don't run the benchmark when we can not write out a device profile. The
     first GPU device will be used.
   */
+#if !defined(MAGICKCORE_ZERO_CONFIGURATION_SUPPORT)
   if (CanWriteProfileToFile(filename) == MagickFalse)
+#endif
     {
       for (i = 0; i < clEnv->number_devices; i++)
         clEnv->devices[i]->score=1.0;
index f2ced8b938773d64289d6e933b748fb1636378b1..bd551ce9d358c8f8468b30ad87d7acaf21251b31 100644 (file)
@@ -163,12 +163,8 @@ static MagickBooleanType
 static LinkedListInfo *AcquirePolicyCache(const char *filename,
   ExceptionInfo *exception)
 {
-  const StringInfo
-    *option;
-
   LinkedListInfo
-    *options,
-    *policy_cache;
+    *cache;
 
   MagickStatusType
     status;
@@ -179,19 +175,29 @@ static LinkedListInfo *AcquirePolicyCache(const char *filename,
   /*
     Load external policy map.
   */
-  policy_cache=NewLinkedList(0);
-  if (policy_cache == (LinkedListInfo *) NULL)
+  cache=NewLinkedList(0);
+  if (cache == (LinkedListInfo *) NULL)
     ThrowFatalException(ResourceLimitFatalError,"MemoryAllocationFailed");
   status=MagickTrue;
-  options=GetConfigureOptions(filename,exception);
-  option=(const StringInfo *) GetNextValueInLinkedList(options);
-  while (option != (const StringInfo *) NULL)
+#if !defined(MAGICKCORE_ZERO_CONFIGURATION_SUPPORT)
   {
-    status&=LoadPolicyCache(policy_cache,(const char *)
-      GetStringInfoDatum(option),GetStringInfoPath(option),0,exception);
+    const StringInfo
+      *option;
+
+    LinkedListInfo
+      *options;
+
+    options=GetConfigureOptions(filename,exception);
     option=(const StringInfo *) GetNextValueInLinkedList(options);
+    while (option != (const StringInfo *) NULL)
+    {
+      status&=LoadPolicyCache(cache,(const char *)
+        GetStringInfoDatum(option),GetStringInfoPath(option),0,exception);
+      option=(const StringInfo *) GetNextValueInLinkedList(options);
+    }
+    options=DestroyConfigureOptions(options);
   }
-  options=DestroyConfigureOptions(options);
+#endif
   /*
     Load built-in policy map.
   */
@@ -220,12 +226,12 @@ static LinkedListInfo *AcquirePolicyCache(const char *filename,
     policy_info->value=(char *) p->value;
     policy_info->exempt=MagickTrue;
     policy_info->signature=MagickCoreSignature;
-    status&=AppendValueToLinkedList(policy_cache,policy_info);
+    status&=AppendValueToLinkedList(cache,policy_info);
     if (status == MagickFalse)
       (void) ThrowMagickException(exception,GetMagickModule(),
         ResourceLimitError,"MemoryAllocationFailed","`%s'",policy_info->name);
   }
-  return(policy_cache);
+  return(cache);
 }
 \f
 /*
@@ -717,9 +723,8 @@ MagickExport MagickBooleanType ListPolicyInfo(FILE *file,
 %
 %  The format of the LoadPolicyCache method is:
 %
-%      MagickBooleanType LoadPolicyCache(LinkedListInfo *policy_cache,
-%        const char *xml,const char *filename,const size_t depth,
-%        ExceptionInfo *exception)
+%      MagickBooleanType LoadPolicyCache(LinkedListInfo *cache,const char *xml,
+%        const char *filename,const size_t depth,ExceptionInfo *exception)
 %
 %  A description of each parameter follows:
 %
@@ -732,9 +737,8 @@ MagickExport MagickBooleanType ListPolicyInfo(FILE *file,
 %    o exception: return any errors or warnings in this structure.
 %
 */
-static MagickBooleanType LoadPolicyCache(LinkedListInfo *policy_cache,
-  const char *xml,const char *filename,const size_t depth,
-  ExceptionInfo *exception)
+static MagickBooleanType LoadPolicyCache(LinkedListInfo *cache,const char *xml,
+  const char *filename,const size_t depth,ExceptionInfo *exception)
 {
   char
     keyword[MagickPathExtent],
@@ -824,7 +828,7 @@ static MagickBooleanType LoadPolicyCache(LinkedListInfo *policy_cache,
                   file_xml=FileToXML(path,~0UL);
                   if (file_xml != (char *) NULL)
                     {
-                      status&=LoadPolicyCache(policy_cache,file_xml,path,
+                      status&=LoadPolicyCache(cache,file_xml,path,
                         depth+1,exception);
                       file_xml=DestroyString(file_xml);
                     }
@@ -851,7 +855,7 @@ static MagickBooleanType LoadPolicyCache(LinkedListInfo *policy_cache,
       continue;
     if (LocaleCompare(keyword,"/>") == 0)
       {
-        status=AppendValueToLinkedList(policy_cache,policy_info);
+        status=AppendValueToLinkedList(cache,policy_info);
         if (status == MagickFalse)
           (void) ThrowMagickException(exception,GetMagickModule(),
             ResourceLimitError,"MemoryAllocationFailed","`%s'",
index a6b191b51088e9841c65a99798008ed2ccf98fae..200b25f8dc897b4657fe8d7ba3ebb8626ed90263 100644 (file)
@@ -854,29 +854,33 @@ MagickExport ThresholdMap *DestroyThresholdMap(ThresholdMap *map)
 MagickExport ThresholdMap *GetThresholdMap(const char *map_id,
   ExceptionInfo *exception)
 {
-  const StringInfo
-    *option;
-
-  LinkedListInfo
-    *options;
-
   ThresholdMap
     *map;
 
   map=GetThresholdMapFile(MinimalThresholdMap,"built-in",map_id,exception);
   if (map != (ThresholdMap *) NULL)
     return(map);
-  options=GetConfigureOptions(ThresholdsFilename,exception);
-  option=(const StringInfo *) GetNextValueInLinkedList(options);
-  while (option != (const StringInfo *) NULL)
+#if !defined(MAGICKCORE_ZERO_CONFIGURATION_SUPPORT)
   {
-    map=GetThresholdMapFile((const char *) GetStringInfoDatum(option),
-      GetStringInfoPath(option),map_id,exception);
-    if (map != (ThresholdMap *) NULL)
-      break;
+    const StringInfo
+      *option;
+
+    LinkedListInfo
+      *options;
+
+    options=GetConfigureOptions(ThresholdsFilename,exception);
     option=(const StringInfo *) GetNextValueInLinkedList(options);
+    while (option != (const StringInfo *) NULL)
+    {
+      map=GetThresholdMapFile((const char *) GetStringInfoDatum(option),
+        GetStringInfoPath(option),map_id,exception);
+      if (map != (ThresholdMap *) NULL)
+        break;
+      option=(const StringInfo *) GetNextValueInLinkedList(options);
+    }
+    options=DestroyConfigureOptions(options);
   }
-  options=DestroyConfigureOptions(options);
+#endif
   return(map);
 }
 \f