]> granicus.if.org Git - imagemagick/commitdiff
(no commit message)
authorcristy <urban-warrior@git.imagemagick.org>
Mon, 17 Mar 2014 00:12:14 +0000 (00:12 +0000)
committercristy <urban-warrior@git.imagemagick.org>
Mon, 17 Mar 2014 00:12:14 +0000 (00:12 +0000)
MagickCore/delegate.c
MagickCore/locale.c
MagickCore/mime.c
MagickCore/type.c

index d83953a35e09354ee68991a4245106e2293b1e2e..160a842de9a15474971a4f3a7a085c6499142b3d 100644 (file)
@@ -171,12 +171,8 @@ static MagickBooleanType
 static LinkedListInfo *AcquireDelegateCache(const char *filename,
   ExceptionInfo *exception)
 {
-  const StringInfo
-    *option;
-
   LinkedListInfo
-    *delegate_cache,
-    *options;
+    *delegate_cache;
 
   MagickStatusType
     status;
@@ -185,17 +181,25 @@ static LinkedListInfo *AcquireDelegateCache(const char *filename,
   if (delegate_cache == (LinkedListInfo *) NULL)
     ThrowFatalException(ResourceLimitFatalError,"MemoryAllocationFailed");
   status=MagickTrue;
-  options=GetConfigureOptions(filename,exception);
-  option=(const StringInfo *) GetNextValueInLinkedList(options);
 #if !defined(MAGICKCORE_ZERO_CONFIGURATION_SUPPORT)
-  while (option != (const StringInfo *) NULL)
   {
-    status&=LoadDelegateCache((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&=LoadDelegateCache((const char *) GetStringInfoDatum(option),
+        GetStringInfoPath(option),0,exception);
+      option=(const StringInfo *) GetNextValueInLinkedList(options);
+    }
+    options=DestroyConfigureOptions(options);
   }
 #endif
-  options=DestroyConfigureOptions(options);
   if (IfMagickTrue(IsLinkedListEmpty(delegate_cache)))
     status&=LoadDelegateCache(DelegateMap,"built-in",0,exception);
   return(delegate_cache);
index 3715cafc5e098d49c25532b5d6c62be0b7b3d28d..65557fdc55c65d22922bf2514710a5e524a92768 100644 (file)
@@ -189,12 +189,6 @@ static void *DestroyLocaleNode(void *locale_info)
 static SplayTreeInfo *AcquireLocaleSplayTree(const char *filename,
   const char *locale,ExceptionInfo *exception)
 {
-  const StringInfo
-    *option;
-
-  LinkedListInfo
-    *options;
-
   MagickStatusType
     status;
 
@@ -206,30 +200,36 @@ static SplayTreeInfo *AcquireLocaleSplayTree(const char *filename,
   if (locale_cache == (SplayTreeInfo *) NULL)
     ThrowFatalException(ResourceLimitFatalError,"MemoryAllocationFailed");
   status=MagickTrue;
-  options=GetLocaleOptions(filename,exception);
-  option=(const StringInfo *) GetNextValueInLinkedList(options);
 #if !defined(MAGICKCORE_ZERO_CONFIGURATION_SUPPORT)
-  while (option != (const StringInfo *) NULL)
   {
-    status&=LoadLocaleCache((const char *) GetStringInfoDatum(option),
-      GetStringInfoPath(option),locale,0,exception);
+    const StringInfo
+      *option;
+
+    LinkedListInfo
+      *options;
+
+    options=GetLocaleOptions(filename,exception);
     option=(const StringInfo *) GetNextValueInLinkedList(options);
-  }
-#endif
-  options=DestroyLocaleOptions(options);
-#if !defined(MAGICKCORE_ZERO_CONFIGURATION_SUPPORT)
-  if (GetNumberOfNodesInSplayTree(locale_cache) == 0)
+    while (option != (const StringInfo *) NULL)
     {
-      options=GetLocaleOptions("english.xml",exception);
+      status&=LoadLocaleCache((const char *) GetStringInfoDatum(option),
+        GetStringInfoPath(option),locale,0,exception);
       option=(const StringInfo *) GetNextValueInLinkedList(options);
-      while (option != (const StringInfo *) NULL)
+    }
+    options=DestroyLocaleOptions(options);
+    if (GetNumberOfNodesInSplayTree(locale_cache) == 0)
       {
-        status&=LoadLocaleCache((const char *) GetStringInfoDatum(option),
-          GetStringInfoPath(option),locale,0,exception);
+        options=GetLocaleOptions("english.xml",exception);
         option=(const StringInfo *) GetNextValueInLinkedList(options);
+        while (option != (const StringInfo *) NULL)
+        {
+          status&=LoadLocaleCache((const char *) GetStringInfoDatum(option),
+            GetStringInfoPath(option),locale,0,exception);
+          option=(const StringInfo *) GetNextValueInLinkedList(options);
+        }
+        options=DestroyLocaleOptions(options);
       }
-      options=DestroyLocaleOptions(options);
-    }
+  }
 #endif
   if (GetNumberOfNodesInSplayTree(locale_cache) == 0)
     status&=LoadLocaleCache(LocaleMap,"built-in",locale,0,exception);
index ada6eb7789f59f596b586fa35a0aabf12256026f..981ede4c68f3760e4e9025311133e700f0eae7e0 100644 (file)
@@ -156,15 +156,8 @@ static MagickBooleanType
 MagickExport LinkedListInfo *AcquireMimeCache(const char *filename,
   ExceptionInfo *exception)
 {
-#if defined(MAGICKCORE_ZERO_CONFIGURATION_SUPPORT)
-  return(LoadMimeCache(MimeMap,"built-in",0,exception));
-#else
-  const StringInfo
-    *option;
-
   LinkedListInfo
-    *mime_cache,
-    *options;
+    *mime_cache;
 
   MagickStatusType
     status;
@@ -173,22 +166,28 @@ MagickExport LinkedListInfo *AcquireMimeCache(const char *filename,
   if (mime_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&=LoadMimeCache((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&=LoadMimeCache((const char *) GetStringInfoDatum(option),
+        GetStringInfoPath(option),0,exception);
+      option=(const StringInfo *) GetNextValueInLinkedList(options);
+    }
+    options=DestroyConfigureOptions(options);
   }
-  options=DestroyConfigureOptions(options);
-  if ((mime_cache == (LinkedListInfo *) NULL) ||
-      (IsLinkedListEmpty(mime_cache) != MagickFalse))
+#endif
+  if (IsLinkedListEmpty(mime_cache) != MagickFalse)
     status&=LoadMimeCache(MimeMap,"built-in",0,exception);
-  else
-    ClearMagickException(exception);
   return(mime_cache);
-#endif
 }
 \f
 /*
index b51c3670db10843531e38e0ee171b2fa26cbe28e..73a71f6885a4b7d9f859f7321c9cde9e90fa9080 100644 (file)
@@ -184,16 +184,6 @@ static void *DestroyTypeNode(void *type_info)
 static SplayTreeInfo *AcquireTypeCache(const char *filename,
   ExceptionInfo *exception)
 {
-  char
-    *font_path,
-    path[MaxTextExtent];
-
-  const StringInfo
-    *option;
-
-  LinkedListInfo
-    *options;
-
   MagickStatusType
     status;
 
@@ -205,39 +195,49 @@ static SplayTreeInfo *AcquireTypeCache(const char *filename,
   if (type_cache == (SplayTreeInfo *) NULL)
     ThrowFatalException(ResourceLimitFatalError,"MemoryAllocationFailed");
   status=MagickTrue;
-  *path='\0';
-  options=GetConfigureOptions(filename,exception);
-  option=(const StringInfo *) GetNextValueInLinkedList(options);
 #if !defined(MAGICKCORE_ZERO_CONFIGURATION_SUPPORT)
-  while (option != (const StringInfo *) NULL)
   {
-    (void) CopyMagickString(path,GetStringInfoPath(option),MaxTextExtent);
-    status&=LoadTypeCache((const char *) GetStringInfoDatum(option),
-      GetStringInfoPath(option),0,exception);
+    char
+      *font_path,
+      path[MaxTextExtent];
+
+    const StringInfo
+      *option;
+
+    LinkedListInfo
+      *options;
+
+    *path='\0';
+    options=GetConfigureOptions(filename,exception);
     option=(const StringInfo *) GetNextValueInLinkedList(options);
-  }
-#endif
-  options=DestroyConfigureOptions(options);
-  font_path=GetEnvironmentValue("MAGICK_FONT_PATH");
-#if !defined(MAGICKCORE_ZERO_CONFIGURATION_SUPPORT)
-  if (font_path != (char *) NULL)
+    while (option != (const StringInfo *) NULL)
     {
-      char
-        *option;
-
-      /*
-        Search MAGICK_FONT_PATH.
-      */
-      (void) FormatLocaleString(path,MaxTextExtent,"%s%s%s",font_path,
-        DirectorySeparator,filename);
-      option=FileToString(path,~0UL,exception);
-      if (option != (void *) NULL)
-        {
-          status&=LoadTypeCache(option,path,0,exception);
-          option=DestroyString(option);
-        }
-      font_path=DestroyString(font_path);
+      (void) CopyMagickString(path,GetStringInfoPath(option),MaxTextExtent);
+      status&=LoadTypeCache((const char *) GetStringInfoDatum(option),
+        GetStringInfoPath(option),0,exception);
+      option=(const StringInfo *) GetNextValueInLinkedList(options);
     }
+    options=DestroyConfigureOptions(options);
+    font_path=GetEnvironmentValue("MAGICK_FONT_PATH");
+    if (font_path != (char *) NULL)
+      {
+        char
+          *option;
+
+        /*
+          Search MAGICK_FONT_PATH.
+        */
+        (void) FormatLocaleString(path,MaxTextExtent,"%s%s%s",font_path,
+          DirectorySeparator,filename);
+        option=FileToString(path,~0UL,exception);
+        if (option != (void *) NULL)
+          {
+            status&=LoadTypeCache(option,path,0,exception);
+            option=DestroyString(option);
+          }
+        font_path=DestroyString(font_path);
+      }
+  }
 #endif
   if (GetNumberOfNodesInSplayTree(type_cache) == 0)
     status&=LoadTypeCache(TypeMap,"built-in",0,exception);