]> granicus.if.org Git - imagemagick/commitdiff
Removed IfMagickTrue
authordirk <dirk@git.imagemagick.org>
Tue, 5 Jan 2016 13:00:04 +0000 (14:00 +0100)
committerdirk <dirk@git.imagemagick.org>
Tue, 5 Jan 2016 13:00:04 +0000 (14:00 +0100)
MagickCore/color.c
MagickCore/constitute.c
MagickCore/delegate.c
MagickCore/display.c
MagickCore/enhance.c
MagickCore/hashmap.c
MagickCore/identify.c
MagickCore/magick-type.h
MagickCore/morphology.c
MagickCore/property.c
MagickCore/resize.c

index aa221bf2b8e7b3beb2084d1e6841c8090e14e921..1a68716634a4a0c5d53b3120e7ec9d37e150acf7 100644 (file)
@@ -1542,7 +1542,7 @@ MagickExport void GetColorTuple(const PixelInfo *pixel,
   assert(tuple != (char *) NULL);
   (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",tuple);
   *tuple='\0';
-  if (IfMagickTrue(hex))
+  if (hex != MagickFalse)
     {
       /*
         Convert pixel to hex color.
@@ -1912,7 +1912,7 @@ MagickExport MagickBooleanType ListColorInfo(FILE *file,
   path=(const char *) NULL;
   for (i=0; i < (ssize_t) number_colors; i++)
   {
-    if (IfMagickTrue(color_info[i]->stealth))
+    if (color_info[i]->stealth != MagickFalse)
       continue;
     if ((path == (const char *) NULL) ||
         (LocaleCompare(path,color_info[i]->path) != 0))
@@ -2119,11 +2119,11 @@ static MagickBooleanType LoadColorCache(LinkedListInfo *color_cache,
               compliance;
 
             compliance=color_info->compliance;
-            if (IfMagickTrue(GlobExpression(token,"*SVG*",MagickTrue)))
+            if (GlobExpression(token,"*SVG*",MagickTrue) != MagickFalse)
               compliance|=SVGCompliance;
-            if (IfMagickTrue(GlobExpression(token,"*X11*",MagickTrue)))
+            if (GlobExpression(token,"*X11*",MagickTrue) != MagickFalse)
               compliance|=X11Compliance;
-            if (IfMagickTrue(GlobExpression(token,"*XPM*",MagickTrue)))
+            if (GlobExpression(token,"*XPM*",MagickTrue) != MagickFalse)
               compliance|=XPMCompliance;
             color_info->compliance=(ComplianceType) compliance;
             break;
index 64e28ebb4fd1f19db3dd337383f82d94c9c5c1c1..15422de6dec069a0fc37af58b5f602e1c31619ab 100644 (file)
@@ -1030,7 +1030,7 @@ MagickExport MagickBooleanType WriteImage(const ImageInfo *image_info,
   (void) SyncImageProfiles(image);
   DisassociateImageStream(image);
   option=GetImageOption(image_info,"delegate:bimodal");
-  if ((IfMagickTrue(IsStringTrue(option))) &&
+  if ((IsStringTrue(option) != MagickFalse) &&
       (write_info->page == (char *) NULL) &&
       (GetPreviousImageInList(image) == (Image *) NULL) &&
       (GetNextImageInList(image) == (Image *) NULL) &&
index c8afe5831b76678fa3a3c19db997e460990b928b..d07f968261210efc1f59146740527b6701ddb7b7 100644 (file)
@@ -202,7 +202,7 @@ static LinkedListInfo *AcquireDelegateCache(const char *filename,
     options=DestroyConfigureOptions(options);
   }
 #endif
-  if (IfMagickTrue(IsLinkedListEmpty(delegate_cache)))
+  if (IsLinkedListEmpty(delegate_cache) != MagickFalse)
     status&=LoadDelegateCache(delegate_cache,DelegateMap,"built-in",0,
       exception);
   return(delegate_cache);
@@ -789,8 +789,8 @@ MagickExport const DelegateInfo **GetDelegateInfoList(const char *pattern,
   for (i=0; p != (const DelegateInfo *) NULL; )
   {
     if( IfMagickFalse(p->stealth) &&
-        ( IfMagickTrue(GlobExpression(p->decode,pattern,MagickFalse)) ||
-          IfMagickTrue(GlobExpression(p->encode,pattern,MagickFalse))) )
+        ( GlobExpression(p->decode,pattern,MagickFalse) != MagickFalse ||
+          GlobExpression(p->encode,pattern,MagickFalse) != MagickFalse) )
       delegates[i++]=p;
     p=(const DelegateInfo *) GetNextValueInLinkedList(delegate_cache);
   }
@@ -883,10 +883,10 @@ MagickExport char **GetDelegateList(const char *pattern,
   for (i=0; p != (const DelegateInfo *) NULL; )
   {
     if( IfMagickFalse(p->stealth) &&
-        IfMagickTrue(GlobExpression(p->decode,pattern,MagickFalse)) )
+        GlobExpression(p->decode,pattern,MagickFalse) != MagickFalse )
       delegates[i++]=ConstantString(p->decode);
     if( IfMagickFalse(p->stealth) &&
-        IfMagickTrue(GlobExpression(p->encode,pattern,MagickFalse)) )
+        GlobExpression(p->encode,pattern,MagickFalse) != MagickFalse )
       delegates[i++]=ConstantString(p->encode);
     p=(const DelegateInfo *) GetNextValueInLinkedList(delegate_cache);
   }
@@ -1264,7 +1264,7 @@ MagickExport MagickBooleanType InvokeDelegate(ImageInfo *image_info,
   commands=StringToList(delegate_info->commands);
   if (commands == (char **) NULL)
     {
-      if( IfMagickTrue(temporary) )
+      if (temporary != MagickFalse)
         (void) RelinquishUniqueFileResource(image->filename);
       (void) ThrowMagickException(exception,GetMagickModule(),
         ResourceLimitError,"MemoryAllocationFailed","`%s'",
@@ -1414,7 +1414,7 @@ MagickExport MagickBooleanType ListDelegateInfo(FILE *file,
   path=(const char *) NULL;
   for (i=0; i < (ssize_t) number_delegates; i++)
   {
-    if( IfMagickTrue(delegate_info[i]->stealth) )
+    if (delegate_info[i]->stealth != MagickFalse)
       continue;
     if ((path == (const char *) NULL) ||
         (LocaleCompare(path,delegate_info[i]->path) != 0))
index 25b1434442c8dfe1266848112fc3e62df50ee595..a9e921d046a958ecc7b18dbda9d4a7ce22b2fdc6 100644 (file)
@@ -1676,7 +1676,7 @@ MagickExport MagickBooleanType DisplayImages(const ImageInfo *image_info,
   assert(image_info->signature == MagickCoreSignature);
   assert(images != (Image *) NULL);
   assert(images->signature == MagickCoreSignature);
-  if (IfMagickTrue(images->debug) )
+  if (images->debug != MagickFalse )
     (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",images->filename);
   display=XOpenDisplay(image_info->server_name);
   if (display == (Display *) NULL)
@@ -1921,7 +1921,7 @@ static MagickBooleanType XAnnotateEditImage(Display *display,
   state=DefaultState;
   do
   {
-    if (IfMagickTrue(windows->info.mapped) )
+    if (windows->info.mapped != MagickFalse )
       {
         /*
           Display pointer position.
@@ -2014,7 +2014,7 @@ static MagickBooleanType XAnnotateEditImage(Display *display,
               break;
             transparent_pen=pen_number == (MaxNumberPens-2) ? MagickTrue :
               MagickFalse;
-            if (IfMagickTrue(transparent_pen) )
+            if (transparent_pen != MagickFalse )
               break;
             if (pen_number == (MaxNumberPens-1))
               {
@@ -2059,7 +2059,7 @@ static MagickBooleanType XAnnotateEditImage(Display *display,
               break;
             transparent_box=pen_number == (MaxNumberPens-2) ? MagickTrue :
               MagickFalse;
-            if (IfMagickTrue(transparent_box) )
+            if (transparent_box != MagickFalse )
               break;
             if (pen_number == (MaxNumberPens-1))
               {
@@ -2210,7 +2210,7 @@ static MagickBooleanType XAnnotateEditImage(Display *display,
         */
         x=event.xmotion.x;
         y=event.xmotion.y;
-        if (IfMagickTrue(windows->info.mapped) )
+        if (windows->info.mapped != MagickFalse )
           {
             if ((x < (int) (windows->info.x+windows->info.width)) &&
                 (y < (int) (windows->info.y+windows->info.height)))
@@ -2813,7 +2813,7 @@ static MagickBooleanType XBackgroundImage(Display *display,
   background_resources.backdrop=status != 0 ? MagickTrue : MagickFalse;
   status=XDisplayBackgroundImage(display,&background_resources,*image,
     exception);
-  if (IfMagickTrue(status))
+  if (status != MagickFalse)
     XClientMessage(display,windows->image.id,windows->im_protocols,
       windows->im_retain_colors,CurrentTime);
   XSetCursorState(display,windows,MagickFalse);
@@ -2933,7 +2933,7 @@ static MagickBooleanType XChopImage(Display *display,
   (void) ResetMagickMemory(&segment_info,0,sizeof(segment_info));
   do
   {
-    if (IfMagickTrue(windows->info.mapped) )
+    if (windows->info.mapped != MagickFalse )
       {
         /*
           Display pointer position.
@@ -3072,7 +3072,7 @@ static MagickBooleanType XChopImage(Display *display,
         */
         x=event.xmotion.x;
         y=event.xmotion.y;
-        if (IfMagickTrue(windows->info.mapped) )
+        if (windows->info.mapped != MagickFalse )
           {
             if ((x < (int) (windows->info.x+windows->info.width)) &&
                 (y < (int) (windows->info.y+windows->info.height)))
@@ -3118,7 +3118,7 @@ static MagickBooleanType XChopImage(Display *display,
           windows->image.highlight_context,&segment_info);
       }
     else
-      if (IfMagickTrue(windows->info.mapped) )
+      if (windows->info.mapped != MagickFalse )
         (void) XWithdrawWindow(display,windows->info.id,windows->info.screen);
     /*
       Wait for next event.
@@ -3375,7 +3375,7 @@ static MagickBooleanType XColorEditImage(Display *display,
   state=DefaultState;
   do
   {
-    if (IfMagickTrue(windows->info.mapped) )
+    if (windows->info.mapped != MagickFalse )
       {
         /*
           Display pointer position.
@@ -3667,7 +3667,7 @@ static MagickBooleanType XColorEditImage(Display *display,
         */
         x=event.xmotion.x;
         y=event.xmotion.y;
-        if (IfMagickTrue(windows->info.mapped) )
+        if (windows->info.mapped != MagickFalse )
           {
             if ((x < (int) (windows->info.x+windows->info.width)) &&
                 (y < (int) (windows->info.y+windows->info.height)))
@@ -4010,7 +4010,7 @@ static MagickBooleanType XCompositeImage(Display *display,
   state=DefaultState;
   do
   {
-    if (IfMagickTrue(windows->info.mapped) )
+    if (windows->info.mapped != MagickFalse )
       {
         /*
           Display pointer position.
@@ -4124,7 +4124,7 @@ static MagickBooleanType XCompositeImage(Display *display,
     {
       case ButtonPress:
       {
-        if (IfMagickTrue(image->debug) )
+        if (image->debug != MagickFalse )
           (void) LogMagickEvent(X11Event,GetMagickModule(),
             "Button Press: 0x%lx %u +%d+%d",event.xbutton.window,
             event.xbutton.button,event.xbutton.x,event.xbutton.y);
@@ -4144,7 +4144,7 @@ static MagickBooleanType XCompositeImage(Display *display,
       }
       case ButtonRelease:
       {
-        if (IfMagickTrue(image->debug) )
+        if (image->debug != MagickFalse )
           (void) LogMagickEvent(X11Event,GetMagickModule(),
             "Button Release: 0x%lx %u +%d+%d",event.xbutton.window,
             event.xbutton.button,event.xbutton.x,event.xbutton.y);
@@ -4184,7 +4184,7 @@ static MagickBooleanType XCompositeImage(Display *display,
         length=XLookupString((XKeyEvent *) &event.xkey,command,(int)
           sizeof(command),&key_symbol,(XComposeStatus *) NULL);
         *(command+length)='\0';
-        if (IfMagickTrue(image->debug) )
+        if (image->debug != MagickFalse )
           (void) LogMagickEvent(X11Event,GetMagickModule(),
             "Key press: 0x%lx (%s)",(unsigned long) key_symbol,command);
         switch ((int) key_symbol)
@@ -4226,7 +4226,7 @@ static MagickBooleanType XCompositeImage(Display *display,
         */
         x=event.xmotion.x;
         y=event.xmotion.y;
-        if (IfMagickTrue(windows->info.mapped) )
+        if (windows->info.mapped != MagickFalse )
           {
             if ((x < (int) (windows->info.x+windows->info.width)) &&
                 (y < (int) (windows->info.y+windows->info.height)))
@@ -4243,7 +4243,7 @@ static MagickBooleanType XCompositeImage(Display *display,
       }
       default:
       {
-        if (IfMagickTrue(image->debug) )
+        if (image->debug != MagickFalse )
           (void) LogMagickEvent(X11Event,GetMagickModule(),"Event type: %d",
             event.type);
         break;
@@ -4422,7 +4422,7 @@ static MagickBooleanType XConfigureImage(Display *display,
   */
   width=(unsigned int) windows->image.window_changes.width;
   height=(unsigned int) windows->image.window_changes.height;
-  if (IfMagickTrue(image->debug) )
+  if (image->debug != MagickFalse )
     (void) LogMagickEvent(X11Event,GetMagickModule(),
       "Configure Image: %dx%d=>%.20gx%.20g",windows->image.ximage->width,
       windows->image.ximage->height,(double) width,(double) height);
@@ -4483,7 +4483,7 @@ static MagickBooleanType XConfigureImage(Display *display,
   /*
     Update Magnify window configuration.
   */
-  if (IfMagickTrue(windows->magnify.mapped) )
+  if (windows->magnify.mapped != MagickFalse )
     XMakeMagnifyImage(display,windows,exception);
   windows->pan.crop_geometry=windows->image.crop_geometry;
   XBestIconSize(display,&windows->pan,image);
@@ -4681,7 +4681,7 @@ static MagickBooleanType XCropImage(Display *display,
   state=DefaultState;
   do
   {
-    if (IfMagickTrue(windows->info.mapped) )
+    if (windows->info.mapped != MagickFalse )
       {
         /*
           Display pointer position.
@@ -4828,7 +4828,7 @@ static MagickBooleanType XCropImage(Display *display,
         */
         x=event.xmotion.x;
         y=event.xmotion.y;
-        if (IfMagickTrue(windows->info.mapped) )
+        if (windows->info.mapped != MagickFalse )
           {
             if ((x < (int) (windows->info.x+windows->info.width)) &&
                 (y < (int) (windows->info.y+windows->info.height)))
@@ -4889,7 +4889,7 @@ static MagickBooleanType XCropImage(Display *display,
             windows->image.highlight_context,&highlight_info);
         }
       else
-        if (IfMagickTrue(windows->info.mapped) )
+        if (windows->info.mapped != MagickFalse )
           (void) XWithdrawWindow(display,windows->info.id,windows->info.screen);
       /*
         Wait for next event.
@@ -4969,7 +4969,7 @@ static MagickBooleanType XCropImage(Display *display,
     (void) XMapWindow(display,windows->info.id);
     do
     {
-      if (IfMagickTrue(windows->info.mapped) )
+      if (windows->info.mapped != MagickFalse )
         {
           /*
             Display pointer position.
@@ -5234,7 +5234,7 @@ static MagickBooleanType XCropImage(Display *display,
           */
           x=event.xmotion.x;
           y=event.xmotion.y;
-          if (IfMagickTrue(windows->info.mapped) )
+          if (windows->info.mapped != MagickFalse )
             {
               if ((x < (int) (windows->info.x+windows->info.width)) &&
                   (y < (int) (windows->info.y+windows->info.height)))
@@ -5529,7 +5529,7 @@ static MagickBooleanType XDrawEditImage(Display *display,
     state=DefaultState;
     do
     {
-      if (IfMagickTrue(windows->info.mapped) )
+      if (windows->info.mapped != MagickFalse )
         {
           /*
             Display pointer position.
@@ -5608,7 +5608,7 @@ static MagickBooleanType XDrawEditImage(Display *display,
                 break;
               transparent=pen_number == (MaxNumberPens-2) ? MagickTrue :
                 MagickFalse;
-              if (IfMagickTrue(transparent) )
+              if (transparent != MagickFalse )
                 {
                   draw_info.stencil=TransparentStencil;
                   break;
@@ -5889,7 +5889,7 @@ static MagickBooleanType XDrawEditImage(Display *display,
           */
           x=event.xmotion.x;
           y=event.xmotion.y;
-          if (IfMagickTrue(windows->info.mapped) )
+          if (windows->info.mapped != MagickFalse )
             {
               if ((x < (int) (windows->info.x+windows->info.width)) &&
                   (y < (int) (windows->info.y+windows->info.height)))
@@ -5962,7 +5962,7 @@ static MagickBooleanType XDrawEditImage(Display *display,
                 windows->image.highlight_context,&line_info);
             }
           else
-            if (IfMagickTrue(windows->info.mapped) )
+            if (windows->info.mapped != MagickFalse )
               (void) XWithdrawWindow(display,windows->info.id,
                 windows->info.screen);
           break;
@@ -5984,7 +5984,7 @@ static MagickBooleanType XDrawEditImage(Display *display,
                 windows->image.highlight_context,&rectangle_info);
             }
           else
-            if (IfMagickTrue(windows->info.mapped) )
+            if (windows->info.mapped != MagickFalse )
               (void) XWithdrawWindow(display,windows->info.id,
                 windows->info.screen);
           break;
@@ -6008,7 +6008,7 @@ static MagickBooleanType XDrawEditImage(Display *display,
                 windows->image.highlight_context,&rectangle_info);
             }
           else
-            if (IfMagickTrue(windows->info.mapped) )
+            if (windows->info.mapped != MagickFalse )
               (void) XWithdrawWindow(display,windows->info.id,
                 windows->info.screen);
           break;
@@ -6034,7 +6034,7 @@ static MagickBooleanType XDrawEditImage(Display *display,
                 windows->image.highlight_context,&line_info);
             }
           else
-            if (IfMagickTrue(windows->info.mapped) )
+            if (windows->info.mapped != MagickFalse )
               (void) XWithdrawWindow(display,windows->info.id,
                 windows->info.screen);
           break;
@@ -6481,7 +6481,7 @@ static void XImageCache(Display *display,XResourceInfo *resource_info,
       redo_image=(*image);
       *image=cache_image->list;
       cache_image=DestroyImage(cache_image);
-      if (IfMagickTrue(windows->image.orphan) )
+      if (windows->image.orphan != MagickFalse )
         return;
       XConfigureImageColormap(display,resource_info,windows,*image,exception);
       (void) XConfigureImage(display,resource_info,windows,*image,exception);
@@ -6647,7 +6647,7 @@ static void XImageCache(Display *display,XResourceInfo *resource_info,
       *image=DestroyImage(*image);
       *image=redo_image;
       redo_image=NewImageList();
-      if (IfMagickTrue(windows->image.orphan) )
+      if (windows->image.orphan != MagickFalse )
         return;
       XConfigureImageColormap(display,resource_info,windows,*image,exception);
       (void) XConfigureImage(display,resource_info,windows,*image,exception);
@@ -7251,7 +7251,7 @@ static Image *XMagickCommand(Display *display,XResourceInfo *resource_info,
       if (*filename == '\0')
         break;
       status=ShredFile(filename);
-      if (IfMagickTrue(status) )
+      if (status != MagickFalse )
         XNoticeWidget(display,windows,"Unable to delete image file:",filename);
       break;
     }
@@ -7532,7 +7532,7 @@ static Image *XMagickCommand(Display *display,XResourceInfo *resource_info,
           (void) FormatLocaleString(windows->image.crop_geometry,MagickPathExtent,
             "%ux%u%+d%+d",width,height,(int) (*image)->columns-(int) width-x,y);
         }
-      if (IfMagickTrue(windows->image.orphan) )
+      if (windows->image.orphan != MagickFalse )
         break;
       (void) XConfigureImage(display,resource_info,windows,*image,exception);
       break;
@@ -7567,7 +7567,7 @@ static Image *XMagickCommand(Display *display,XResourceInfo *resource_info,
           (void) FormatLocaleString(windows->image.crop_geometry,MagickPathExtent,
             "%ux%u%+d%+d",width,height,x,(int) (*image)->rows-(int) height-y);
         }
-      if (IfMagickTrue(windows->image.orphan) )
+      if (windows->image.orphan != MagickFalse )
         break;
       (void) XConfigureImage(display,resource_info,windows,*image,exception);
       break;
@@ -7653,7 +7653,7 @@ static Image *XMagickCommand(Display *display,XResourceInfo *resource_info,
         }
       CatchException(exception);
       XSetCursorState(display,windows,MagickFalse);
-      if (IfMagickTrue(windows->image.orphan) )
+      if (windows->image.orphan != MagickFalse )
         break;
       windows->image.window_changes.width=(int) (*image)->columns;
       windows->image.window_changes.height=(int) (*image)->rows;
@@ -7694,7 +7694,7 @@ static Image *XMagickCommand(Display *display,XResourceInfo *resource_info,
         }
       CatchException(exception);
       XSetCursorState(display,windows,MagickFalse);
-      if (IfMagickTrue(windows->image.orphan) )
+      if (windows->image.orphan != MagickFalse )
         break;
       windows->image.window_changes.width=(int) (*image)->columns;
       windows->image.window_changes.height=(int) (*image)->rows;
@@ -7750,7 +7750,7 @@ static Image *XMagickCommand(Display *display,XResourceInfo *resource_info,
         MagickPathExtent);
       (void) ModulateImage(*image,modulate_factors,exception);
       XSetCursorState(display,windows,MagickFalse);
-      if (IfMagickTrue(windows->image.orphan) )
+      if (windows->image.orphan != MagickFalse )
         break;
       XConfigureImageColormap(display,resource_info,windows,*image,exception);
       (void) XConfigureImage(display,resource_info,windows,*image,exception);
@@ -7778,7 +7778,7 @@ static Image *XMagickCommand(Display *display,XResourceInfo *resource_info,
         MagickPathExtent);
       (void) ModulateImage(*image,modulate_factors,exception);
       XSetCursorState(display,windows,MagickFalse);
-      if (IfMagickTrue(windows->image.orphan) )
+      if (windows->image.orphan != MagickFalse )
         break;
       XConfigureImageColormap(display,resource_info,windows,*image,exception);
       (void) XConfigureImage(display,resource_info,windows,*image,exception);
@@ -7805,7 +7805,7 @@ static Image *XMagickCommand(Display *display,XResourceInfo *resource_info,
         MagickPathExtent);
       (void) ModulateImage(*image,modulate_factors,exception);
       XSetCursorState(display,windows,MagickFalse);
-      if (IfMagickTrue(windows->image.orphan) )
+      if (windows->image.orphan != MagickFalse )
         break;
       XConfigureImageColormap(display,resource_info,windows,*image,exception);
       (void) XConfigureImage(display,resource_info,windows,*image,exception);
@@ -7830,7 +7830,7 @@ static Image *XMagickCommand(Display *display,XResourceInfo *resource_info,
       XCheckRefreshWindows(display,windows);
       (void) GammaImage(*image,strtod(factor,(char **) NULL),exception);
       XSetCursorState(display,windows,MagickFalse);
-      if (IfMagickTrue(windows->image.orphan) )
+      if (windows->image.orphan != MagickFalse )
         break;
       XConfigureImageColormap(display,resource_info,windows,*image,exception);
       (void) XConfigureImage(display,resource_info,windows,*image,exception);
@@ -7845,7 +7845,7 @@ static Image *XMagickCommand(Display *display,XResourceInfo *resource_info,
       XCheckRefreshWindows(display,windows);
       (void) ContrastImage(*image,MagickTrue,exception);
       XSetCursorState(display,windows,MagickFalse);
-      if (IfMagickTrue(windows->image.orphan) )
+      if (windows->image.orphan != MagickFalse )
         break;
       XConfigureImageColormap(display,resource_info,windows,*image,exception);
       (void) XConfigureImage(display,resource_info,windows,*image,exception);
@@ -7860,7 +7860,7 @@ static Image *XMagickCommand(Display *display,XResourceInfo *resource_info,
       XCheckRefreshWindows(display,windows);
       (void) ContrastImage(*image,MagickFalse,exception);
       XSetCursorState(display,windows,MagickFalse);
-      if (IfMagickTrue(windows->image.orphan) )
+      if (windows->image.orphan != MagickFalse )
         break;
       XConfigureImageColormap(display,resource_info,windows,*image,exception);
       (void) XConfigureImage(display,resource_info,windows,*image,exception);
@@ -7899,7 +7899,7 @@ static Image *XMagickCommand(Display *display,XResourceInfo *resource_info,
       (void) ContrastStretchImage(*image,black_point,white_point,
         exception);
       XSetCursorState(display,windows,MagickFalse);
-      if (IfMagickTrue(windows->image.orphan) )
+      if (windows->image.orphan != MagickFalse )
         break;
       XConfigureImageColormap(display,resource_info,windows,*image,exception);
       (void) XConfigureImage(display,resource_info,windows,*image,exception);
@@ -7936,7 +7936,7 @@ static Image *XMagickCommand(Display *display,XResourceInfo *resource_info,
       (void) SigmoidalContrastImage(*image,MagickTrue,geometry_info.rho,
         geometry_info.sigma,exception);
       XSetCursorState(display,windows,MagickFalse);
-      if (IfMagickTrue(windows->image.orphan) )
+      if (windows->image.orphan != MagickFalse )
         break;
       XConfigureImageColormap(display,resource_info,windows,*image,exception);
       (void) XConfigureImage(display,resource_info,windows,*image,exception);
@@ -7951,7 +7951,7 @@ static Image *XMagickCommand(Display *display,XResourceInfo *resource_info,
       XCheckRefreshWindows(display,windows);
       (void) NormalizeImage(*image,exception);
       XSetCursorState(display,windows,MagickFalse);
-      if (IfMagickTrue(windows->image.orphan) )
+      if (windows->image.orphan != MagickFalse )
         break;
       XConfigureImageColormap(display,resource_info,windows,*image,exception);
       (void) XConfigureImage(display,resource_info,windows,*image,exception);
@@ -7966,7 +7966,7 @@ static Image *XMagickCommand(Display *display,XResourceInfo *resource_info,
       XCheckRefreshWindows(display,windows);
       (void) EqualizeImage(*image,exception);
       XSetCursorState(display,windows,MagickFalse);
-      if (IfMagickTrue(windows->image.orphan) )
+      if (windows->image.orphan != MagickFalse )
         break;
       XConfigureImageColormap(display,resource_info,windows,*image,exception);
       (void) XConfigureImage(display,resource_info,windows,*image,exception);
@@ -7981,7 +7981,7 @@ static Image *XMagickCommand(Display *display,XResourceInfo *resource_info,
       XCheckRefreshWindows(display,windows);
       (void) NegateImage(*image,MagickFalse,exception);
       XSetCursorState(display,windows,MagickFalse);
-      if (IfMagickTrue(windows->image.orphan) )
+      if (windows->image.orphan != MagickFalse )
         break;
       XConfigureImageColormap(display,resource_info,windows,*image,exception);
       (void) XConfigureImage(display,resource_info,windows,*image,exception);
@@ -7997,7 +7997,7 @@ static Image *XMagickCommand(Display *display,XResourceInfo *resource_info,
       (void) SetImageType(*image,(*image)->alpha_trait == UndefinedPixelTrait ?
         GrayscaleType : GrayscaleAlphaType,exception);
       XSetCursorState(display,windows,MagickFalse);
-      if (IfMagickTrue(windows->image.orphan) )
+      if (windows->image.orphan != MagickFalse )
         break;
       XConfigureImageColormap(display,resource_info,windows,*image,exception);
       (void) XConfigureImage(display,resource_info,windows,*image,exception);
@@ -8031,7 +8031,7 @@ static Image *XMagickCommand(Display *display,XResourceInfo *resource_info,
         }
       CatchException(exception);
       XSetCursorState(display,windows,MagickFalse);
-      if (IfMagickTrue(windows->image.orphan) )
+      if (windows->image.orphan != MagickFalse )
         break;
       XConfigureImageColormap(display,resource_info,windows,*image,exception);
       (void) XConfigureImage(display,resource_info,windows,*image,exception);
@@ -8062,7 +8062,7 @@ static Image *XMagickCommand(Display *display,XResourceInfo *resource_info,
         NoDitherMethod;
       (void) QuantizeImage(&quantize_info,*image,exception);
       XSetCursorState(display,windows,MagickFalse);
-      if (IfMagickTrue(windows->image.orphan) )
+      if (windows->image.orphan != MagickFalse )
         break;
       XConfigureImageColormap(display,resource_info,windows,*image,exception);
       (void) XConfigureImage(display,resource_info,windows,*image,exception);
@@ -8086,7 +8086,7 @@ static Image *XMagickCommand(Display *display,XResourceInfo *resource_info,
         }
       CatchException(exception);
       XSetCursorState(display,windows,MagickFalse);
-      if (IfMagickTrue(windows->image.orphan) )
+      if (windows->image.orphan != MagickFalse )
         break;
       XConfigureImageColormap(display,resource_info,windows,*image,exception);
       (void) XConfigureImage(display,resource_info,windows,*image,exception);
@@ -8124,7 +8124,7 @@ static Image *XMagickCommand(Display *display,XResourceInfo *resource_info,
         }
       CatchException(exception);
       XSetCursorState(display,windows,MagickFalse);
-      if (IfMagickTrue(windows->image.orphan) )
+      if (windows->image.orphan != MagickFalse )
         break;
       XConfigureImageColormap(display,resource_info,windows,*image,exception);
       (void) XConfigureImage(display,resource_info,windows,*image,exception);
@@ -8160,7 +8160,7 @@ static Image *XMagickCommand(Display *display,XResourceInfo *resource_info,
         }
       CatchException(exception);
       XSetCursorState(display,windows,MagickFalse);
-      if (IfMagickTrue(windows->image.orphan) )
+      if (windows->image.orphan != MagickFalse )
         break;
       XConfigureImageColormap(display,resource_info,windows,*image,exception);
       (void) XConfigureImage(display,resource_info,windows,*image,exception);
@@ -8200,7 +8200,7 @@ static Image *XMagickCommand(Display *display,XResourceInfo *resource_info,
         }
       CatchException(exception);
       XSetCursorState(display,windows,MagickFalse);
-      if (IfMagickTrue(windows->image.orphan) )
+      if (windows->image.orphan != MagickFalse )
         break;
       XConfigureImageColormap(display,resource_info,windows,*image,exception);
       (void) XConfigureImage(display,resource_info,windows,*image,exception);
@@ -8236,7 +8236,7 @@ static Image *XMagickCommand(Display *display,XResourceInfo *resource_info,
         }
       CatchException(exception);
       XSetCursorState(display,windows,MagickFalse);
-      if (IfMagickTrue(windows->image.orphan) )
+      if (windows->image.orphan != MagickFalse )
         break;
       XConfigureImageColormap(display,resource_info,windows,*image,exception);
       (void) XConfigureImage(display,resource_info,windows,*image,exception);
@@ -8272,7 +8272,7 @@ static Image *XMagickCommand(Display *display,XResourceInfo *resource_info,
         }
       CatchException(exception);
       XSetCursorState(display,windows,MagickFalse);
-      if (IfMagickTrue(windows->image.orphan) )
+      if (windows->image.orphan != MagickFalse )
         break;
       XConfigureImageColormap(display,resource_info,windows,*image,exception);
       (void) XConfigureImage(display,resource_info,windows,*image,exception);
@@ -8301,7 +8301,7 @@ static Image *XMagickCommand(Display *display,XResourceInfo *resource_info,
       threshold=StringToDoubleInterval(factor,(double) QuantumRange+1.0);
       (void) BilevelImage(*image,threshold,exception);
       XSetCursorState(display,windows,MagickFalse);
-      if (IfMagickTrue(windows->image.orphan) )
+      if (windows->image.orphan != MagickFalse )
         break;
       XConfigureImageColormap(display,resource_info,windows,*image,exception);
       (void) XConfigureImage(display,resource_info,windows,*image,exception);
@@ -8336,7 +8336,7 @@ static Image *XMagickCommand(Display *display,XResourceInfo *resource_info,
         }
       CatchException(exception);
       XSetCursorState(display,windows,MagickFalse);
-      if (IfMagickTrue(windows->image.orphan) )
+      if (windows->image.orphan != MagickFalse )
         break;
       XConfigureImageColormap(display,resource_info,windows,*image,exception);
       (void) XConfigureImage(display,resource_info,windows,*image,exception);
@@ -8371,7 +8371,7 @@ static Image *XMagickCommand(Display *display,XResourceInfo *resource_info,
         }
       CatchException(exception);
       XSetCursorState(display,windows,MagickFalse);
-      if (IfMagickTrue(windows->image.orphan) )
+      if (windows->image.orphan != MagickFalse )
         break;
       XConfigureImageColormap(display,resource_info,windows,*image,exception);
       (void) XConfigureImage(display,resource_info,windows,*image,exception);
@@ -8412,7 +8412,7 @@ static Image *XMagickCommand(Display *display,XResourceInfo *resource_info,
         }
       CatchException(exception);
       XSetCursorState(display,windows,MagickFalse);
-      if (IfMagickTrue(windows->image.orphan) )
+      if (windows->image.orphan != MagickFalse )
         break;
       XConfigureImageColormap(display,resource_info,windows,*image,exception);
       (void) XConfigureImage(display,resource_info,windows,*image,exception);
@@ -8440,7 +8440,7 @@ static Image *XMagickCommand(Display *display,XResourceInfo *resource_info,
         exception);
       (void) RaiseImage(*image,&page_geometry,MagickTrue,exception);
       XSetCursorState(display,windows,MagickFalse);
-      if (IfMagickTrue(windows->image.orphan) )
+      if (windows->image.orphan != MagickFalse )
         break;
       XConfigureImageColormap(display,resource_info,windows,*image,exception);
       (void) XConfigureImage(display,resource_info,windows,*image,exception);
@@ -8469,7 +8469,7 @@ static Image *XMagickCommand(Display *display,XResourceInfo *resource_info,
       (void) SegmentImage(*image,sRGBColorspace,MagickFalse,geometry_info.rho,
         geometry_info.sigma,exception);
       XSetCursorState(display,windows,MagickFalse);
-      if (IfMagickTrue(windows->image.orphan) )
+      if (windows->image.orphan != MagickFalse )
         break;
       XConfigureImageColormap(display,resource_info,windows,*image,exception);
       (void) XConfigureImage(display,resource_info,windows,*image,exception);
@@ -8507,7 +8507,7 @@ static Image *XMagickCommand(Display *display,XResourceInfo *resource_info,
         }
       CatchException(exception);
       XSetCursorState(display,windows,MagickFalse);
-      if (IfMagickTrue(windows->image.orphan) )
+      if (windows->image.orphan != MagickFalse )
         break;
       XConfigureImageColormap(display,resource_info,windows,*image,exception);
       (void) XConfigureImage(display,resource_info,windows,*image,exception);
@@ -8536,7 +8536,7 @@ static Image *XMagickCommand(Display *display,XResourceInfo *resource_info,
       threshold=StringToDoubleInterval(factor,(double) QuantumRange+1.0);
       (void) SolarizeImage(*image,threshold,exception);
       XSetCursorState(display,windows,MagickFalse);
-      if (IfMagickTrue(windows->image.orphan) )
+      if (windows->image.orphan != MagickFalse )
         break;
       XConfigureImageColormap(display,resource_info,windows,*image,exception);
       (void) XConfigureImage(display,resource_info,windows,*image,exception);
@@ -8572,7 +8572,7 @@ static Image *XMagickCommand(Display *display,XResourceInfo *resource_info,
         }
       CatchException(exception);
       XSetCursorState(display,windows,MagickFalse);
-      if (IfMagickTrue(windows->image.orphan) )
+      if (windows->image.orphan != MagickFalse )
         break;
       XConfigureImageColormap(display,resource_info,windows,*image,exception);
       (void) XConfigureImage(display,resource_info,windows,*image,exception);
@@ -8608,7 +8608,7 @@ static Image *XMagickCommand(Display *display,XResourceInfo *resource_info,
         }
       CatchException(exception);
       XSetCursorState(display,windows,MagickFalse);
-      if (IfMagickTrue(windows->image.orphan) )
+      if (windows->image.orphan != MagickFalse )
         break;
       XConfigureImageColormap(display,resource_info,windows,*image,exception);
       (void) XConfigureImage(display,resource_info,windows,*image,exception);
@@ -8651,7 +8651,7 @@ static Image *XMagickCommand(Display *display,XResourceInfo *resource_info,
         }
       CatchException(exception);
       XSetCursorState(display,windows,MagickFalse);
-      if (IfMagickTrue(windows->image.orphan) )
+      if (windows->image.orphan != MagickFalse )
         break;
       XConfigureImageColormap(display,resource_info,windows,*image,exception);
       (void) XConfigureImage(display,resource_info,windows,*image,exception);
@@ -8689,7 +8689,7 @@ static Image *XMagickCommand(Display *display,XResourceInfo *resource_info,
         }
       CatchException(exception);
       XSetCursorState(display,windows,MagickFalse);
-      if (IfMagickTrue(windows->image.orphan) )
+      if (windows->image.orphan != MagickFalse )
         break;
       XConfigureImageColormap(display,resource_info,windows,*image,exception);
       (void) XConfigureImage(display,resource_info,windows,*image,exception);
@@ -8725,7 +8725,7 @@ static Image *XMagickCommand(Display *display,XResourceInfo *resource_info,
         }
       CatchException(exception);
       XSetCursorState(display,windows,MagickFalse);
-      if (IfMagickTrue(windows->image.orphan) )
+      if (windows->image.orphan != MagickFalse )
         break;
       XConfigureImageColormap(display,resource_info,windows,*image,exception);
       (void) XConfigureImage(display,resource_info,windows,*image,exception);
@@ -8765,7 +8765,7 @@ static Image *XMagickCommand(Display *display,XResourceInfo *resource_info,
         }
       CatchException(exception);
       XSetCursorState(display,windows,MagickFalse);
-      if (IfMagickTrue(windows->image.orphan) )
+      if (windows->image.orphan != MagickFalse )
         break;
       XConfigureImageColormap(display,resource_info,windows,*image,exception);
       (void) XConfigureImage(display,resource_info,windows,*image,exception);
@@ -8880,7 +8880,7 @@ static Image *XMagickCommand(Display *display,XResourceInfo *resource_info,
         }
       CatchException(exception);
       XSetCursorState(display,windows,MagickFalse);
-      if (IfMagickTrue(windows->image.orphan) )
+      if (windows->image.orphan != MagickFalse )
         break;
       windows->image.window_changes.width=(int) (*image)->columns;
       windows->image.window_changes.height=(int) (*image)->rows;
@@ -8936,7 +8936,7 @@ static Image *XMagickCommand(Display *display,XResourceInfo *resource_info,
         }
       CatchException(exception);
       XSetCursorState(display,windows,MagickFalse);
-      if (IfMagickTrue(windows->image.orphan) )
+      if (windows->image.orphan != MagickFalse )
         break;
       windows->image.window_changes.width=(int) (*image)->columns;
       windows->image.window_changes.height=(int) (*image)->rows;
@@ -9045,7 +9045,7 @@ static Image *XMagickCommand(Display *display,XResourceInfo *resource_info,
       /*
         Zoom image.
       */
-      if (IfMagickTrue(windows->magnify.mapped) )
+      if (windows->magnify.mapped != MagickFalse )
         (void) XRaiseWindow(display,windows->magnify.id);
       else
         {
@@ -9359,7 +9359,7 @@ static void XMagnifyImage(Display *display,XWindows *windows,XEvent *event,
     /*
       Map and unmap Info widget as text cursor crosses its boundaries.
     */
-    if (IfMagickTrue(windows->info.mapped) )
+    if (windows->info.mapped != MagickFalse )
       {
         if ((x < (int) (windows->info.x+windows->info.width)) &&
             (y < (int) (windows->info.y+windows->info.height)))
@@ -9369,7 +9369,7 @@ static void XMagnifyImage(Display *display,XWindows *windows,XEvent *event,
       if ((x > (int) (windows->info.x+windows->info.width)) ||
           (y > (int) (windows->info.y+windows->info.height)))
         (void) XMapWindow(display,windows->info.id);
-    if (IfMagickTrue(windows->info.mapped) )
+    if (windows->info.mapped != MagickFalse )
       {
         /*
           Display pointer position.
@@ -9737,7 +9737,7 @@ static MagickBooleanType XMatteEditImage(Display *display,
   state=DefaultState;
   do
   {
-    if (IfMagickTrue(windows->info.mapped) )
+    if (windows->info.mapped != MagickFalse )
       {
         /*
           Display pointer position.
@@ -10025,7 +10025,7 @@ static MagickBooleanType XMatteEditImage(Display *display,
         */
         x=event.xmotion.x;
         y=event.xmotion.y;
-        if (IfMagickTrue(windows->info.mapped) )
+        if (windows->info.mapped != MagickFalse )
           {
             if ((x < (int) (windows->info.x+windows->info.width)) &&
                 (y < (int) (windows->info.y+windows->info.height)))
@@ -10681,7 +10681,7 @@ static MagickBooleanType XPasteImage(Display *display,
   state=DefaultState;
   do
   {
-    if (IfMagickTrue(windows->info.mapped) )
+    if (windows->info.mapped != MagickFalse )
       {
         /*
           Display pointer position.
@@ -10755,7 +10755,7 @@ static MagickBooleanType XPasteImage(Display *display,
     {
       case ButtonPress:
       {
-        if (IfMagickTrue(image->debug) )
+        if (image->debug != MagickFalse )
           (void) LogMagickEvent(X11Event,GetMagickModule(),
             "Button Press: 0x%lx %u +%d+%d",event.xbutton.window,
             event.xbutton.button,event.xbutton.x,event.xbutton.y);
@@ -10784,7 +10784,7 @@ static MagickBooleanType XPasteImage(Display *display,
       }
       case ButtonRelease:
       {
-        if (IfMagickTrue(image->debug) )
+        if (image->debug != MagickFalse )
           (void) LogMagickEvent(X11Event,GetMagickModule(),
             "Button Release: 0x%lx %u +%d+%d",event.xbutton.window,
             event.xbutton.button,event.xbutton.x,event.xbutton.y);
@@ -10824,7 +10824,7 @@ static MagickBooleanType XPasteImage(Display *display,
         length=XLookupString((XKeyEvent *) &event.xkey,command,(int)
           sizeof(command),&key_symbol,(XComposeStatus *) NULL);
         *(command+length)='\0';
-        if (IfMagickTrue(image->debug) )
+        if (image->debug != MagickFalse )
           (void) LogMagickEvent(X11Event,GetMagickModule(),
             "Key press: 0x%lx (%s)",(long) key_symbol,command);
         switch ((int) key_symbol)
@@ -10866,7 +10866,7 @@ static MagickBooleanType XPasteImage(Display *display,
         */
         x=event.xmotion.x;
         y=event.xmotion.y;
-        if (IfMagickTrue(windows->info.mapped) )
+        if (windows->info.mapped != MagickFalse )
           {
             if ((x < (int) (windows->info.x+windows->info.width)) &&
                 (y < (int) (windows->info.y+windows->info.height)))
@@ -10883,7 +10883,7 @@ static MagickBooleanType XPasteImage(Display *display,
       }
       default:
       {
-        if (IfMagickTrue(image->debug) )
+        if (image->debug != MagickFalse )
           (void) LogMagickEvent(X11Event,GetMagickModule(),"Event type: %d",
             event.type);
         break;
@@ -11327,7 +11327,7 @@ static MagickBooleanType XROIImage(Display *display,
   state=DefaultState;
   do
   {
-    if (IfMagickTrue(windows->info.mapped) )
+    if (windows->info.mapped != MagickFalse )
       {
         /*
           Display pointer position.
@@ -11437,7 +11437,7 @@ static MagickBooleanType XROIImage(Display *display,
         */
         x=event.xmotion.x;
         y=event.xmotion.y;
-        if (IfMagickTrue(windows->info.mapped) )
+        if (windows->info.mapped != MagickFalse )
           {
             if ((x < (int) (windows->info.x+windows->info.width)) &&
                 (y < (int) (windows->info.y+windows->info.height)))
@@ -11498,7 +11498,7 @@ static MagickBooleanType XROIImage(Display *display,
             windows->image.highlight_context,&highlight_info);
         }
       else
-        if (IfMagickTrue(windows->info.mapped) )
+        if (windows->info.mapped != MagickFalse )
           (void) XWithdrawWindow(display,windows->info.id,windows->info.screen);
       /*
         Wait for next event.
@@ -11583,7 +11583,7 @@ static MagickBooleanType XROIImage(Display *display,
     (void) XMapWindow(display,windows->info.id);
     do
     {
-      if (IfMagickTrue(windows->info.mapped) )
+      if (windows->info.mapped != MagickFalse )
         {
           /*
             Display pointer position.
@@ -11905,7 +11905,7 @@ static MagickBooleanType XROIImage(Display *display,
           */
           x=event.xmotion.x;
           y=event.xmotion.y;
-          if (IfMagickTrue(windows->info.mapped) )
+          if (windows->info.mapped != MagickFalse )
             {
               if ((x < (int) (windows->info.x+windows->info.width)) &&
                   (y < (int) (windows->info.y+windows->info.height)))
@@ -12314,7 +12314,7 @@ static MagickBooleanType XRotateImage(Display *display,
               windows->image.highlight_context,&rotate_info);
           }
         else
-          if (IfMagickTrue(windows->info.mapped) )
+          if (windows->info.mapped != MagickFalse )
             (void) XWithdrawWindow(display,windows->info.id,
               windows->info.screen);
         /*
@@ -12449,7 +12449,7 @@ static MagickBooleanType XRotateImage(Display *display,
         }
       }
     }
-  if (IfMagickTrue(windows->image.orphan) )
+  if (windows->image.orphan != MagickFalse )
     return(MagickTrue);
   if (normalized_degrees != 0.0)
     {
@@ -12560,7 +12560,7 @@ static MagickBooleanType XSaveImage(Display *display,
   XFileBrowserWidget(display,windows,"Save",filename);
   if (*filename == '\0')
     return(MagickTrue);
-  if (IfMagickTrue(IsPathAccessible(filename)) )
+  if (IsPathAccessible(filename != MagickFalse) )
     {
       int
         status;
@@ -12634,7 +12634,7 @@ static MagickBooleanType XSaveImage(Display *display,
   */
   (void) CopyMagickString(save_image->filename,filename,MagickPathExtent);
   status=WriteImage(image_info,save_image,exception);
-  if (IfMagickTrue(status) )
+  if (status != MagickFalse )
     image->taint=MagickFalse;
   save_image=DestroyImage(save_image);
   image_info=DestroyImageInfo(image_info);
@@ -12873,7 +12873,7 @@ static void XScreenEvent(Display *display,XWindows *windows,XEvent *event,
     {
       while (XCheckMaskEvent(display,ButtonMotionMask,event)) ;
       if (event->xmotion.window == windows->image.id)
-        if (IfMagickTrue(windows->magnify.mapped) )
+        if (windows->magnify.mapped != MagickFalse )
           {
             /*
               Update magnified image.
@@ -12964,7 +12964,7 @@ static void XSetCropGeometry(Display *display,XWindows *windows,
     height,
     width;
 
-  if (IfMagickTrue(windows->info.mapped) )
+  if (windows->info.mapped != MagickFalse )
     {
       /*
         Display info on cropping rectangle.
@@ -13211,7 +13211,7 @@ static Image *XTileImage(Display *display,XResourceInfo *resource_info,
       if (status <= 0)
         break;
       status=ShredFile(filename);
-      if (IfMagickTrue(status) )
+      if (status != MagickFalse )
         {
           XNoticeWidget(display,windows,"Unable to delete image file:",
             filename);
@@ -13248,7 +13248,7 @@ static Image *XTileImage(Display *display,XResourceInfo *resource_info,
           q++;
         (void) CopyMagickString(filename,p,(size_t) (q-p+1));
         p=q;
-        if (IfMagickTrue(IsPathAccessible(filename)) )
+        if (IsPathAccessible(filename != MagickFalse) )
           {
             tile++;
             continue;
@@ -13818,7 +13818,7 @@ MagickExport MagickBooleanType XDisplayBackgroundImage(Display *display,
   */
   assert(image != (Image *) NULL);
   assert(image->signature == MagickCoreSignature);
-  if (IfMagickTrue(image->debug) )
+  if (image->debug != MagickFalse )
     (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",image->filename);
   resources=(*resource_info);
   window_info.id=(Window) NULL;
@@ -13933,7 +13933,7 @@ MagickExport MagickBooleanType XDisplayBackgroundImage(Display *display,
       image->filename);
   window_info.x=0;
   window_info.y=0;
-  if (IfMagickTrue(image->debug) )
+  if (image->debug != MagickFalse )
     {
       (void) LogMagickEvent(X11Event,GetMagickModule(),
         "Image: %s[%.20g] %.20gx%.20g ",image->filename,(double) image->scene,
@@ -13948,7 +13948,7 @@ MagickExport MagickBooleanType XDisplayBackgroundImage(Display *display,
   */
   width=(int) window_info.width;
   height=(int) window_info.height;
-  if (IfMagickTrue(resources.backdrop) )
+  if (resources.backdrop != MagickFalse )
     {
       /*
         Center image on window.
@@ -14513,7 +14513,7 @@ MagickExport Image *XDisplayImage(Display *display,XResourceInfo *resource_info,
 
   assert(image != (Image **) NULL);
   assert((*image)->signature == MagickCoreSignature);
-  if (IfMagickTrue((*image)->debug) )
+  if ((*image != MagickFalse->debug) )
     (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",(*image)->filename);
   display_image=(*image);
   warning_handler=(WarningHandler) NULL;
@@ -14586,7 +14586,7 @@ MagickExport Image *XDisplayImage(Display *display,XResourceInfo *resource_info,
   manager_hints=windows->manager_hints;
   root_window=XRootWindow(display,visual_info->screen);
   nexus=NewImageList();
-  if (IfMagickTrue(display_image->debug) )
+  if (display_image->debug != MagickFalse )
     {
       (void) LogMagickEvent(X11Event,GetMagickModule(),
         "Image: %s[%.20g] %.20gx%.20g ",display_image->filename,
@@ -14615,7 +14615,7 @@ MagickExport Image *XDisplayImage(Display *display,XResourceInfo *resource_info,
   manager_hints->initial_state=WithdrawnState;
   XMakeWindow(display,root_window,argv,argc,class_hints,manager_hints,
     &windows->context);
-  if (IfMagickTrue(display_image->debug) )
+  if (display_image->debug != MagickFalse )
     (void) LogMagickEvent(X11Event,GetMagickModule(),
       "Window id: 0x%lx (context)",windows->context.id);
   context_values.background=pixel->background_color.pixel;
@@ -14666,7 +14666,7 @@ MagickExport Image *XDisplayImage(Display *display,XResourceInfo *resource_info,
   manager_hints->initial_state=IconicState;
   XMakeWindow(display,root_window,argv,argc,class_hints,manager_hints,
     &windows->icon);
-  if (IfMagickTrue(display_image->debug) )
+  if (display_image->debug != MagickFalse )
     (void) LogMagickEvent(X11Event,GetMagickModule(),"Window id: 0x%lx (icon)",
       windows->icon.id);
   /*
@@ -14767,7 +14767,7 @@ MagickExport Image *XDisplayImage(Display *display,XResourceInfo *resource_info,
         NormalState;
       XMakeWindow(display,root_window,argv,argc,class_hints,manager_hints,
         &windows->backdrop);
-      if (IfMagickTrue(display_image->debug) )
+      if (display_image->debug != MagickFalse )
         (void) LogMagickEvent(X11Event,GetMagickModule(),
           "Window id: 0x%lx (backdrop)",windows->backdrop.id);
       (void) XMapWindow(display,windows->backdrop.id);
@@ -14799,7 +14799,7 @@ MagickExport Image *XDisplayImage(Display *display,XResourceInfo *resource_info,
       manager_hints->flags|=WindowGroupHint;
       manager_hints->window_group=windows->group_leader.id;
       (void) XSelectInput(display,windows->group_leader.id,StructureNotifyMask);
-      if (IfMagickTrue(display_image->debug) )
+      if (display_image->debug != MagickFalse )
         (void) LogMagickEvent(X11Event,GetMagickModule(),
           "Window id: 0x%lx (group leader)",windows->group_leader.id);
     }
@@ -14811,7 +14811,7 @@ MagickExport Image *XDisplayImage(Display *display,XResourceInfo *resource_info,
   if (windows->group_leader.id != (Window) NULL)
     (void) XSetTransientForHint(display,windows->image.id,
       windows->group_leader.id);
-  if (IfMagickTrue(display_image->debug) )
+  if (display_image->debug != MagickFalse )
     (void) LogMagickEvent(X11Event,GetMagickModule(),"Window id: 0x%lx (image)",
       windows->image.id);
   /*
@@ -14839,9 +14839,9 @@ MagickExport Image *XDisplayImage(Display *display,XResourceInfo *resource_info,
   windows->info.shadow_stipple=XCreateBitmapFromData(display,
     windows->info.id,(char *) ShadowBitmap,ShadowWidth,ShadowHeight);
   (void) XSetTransientForHint(display,windows->info.id,windows->image.id);
-  if (IfMagickTrue(windows->image.mapped) )
+  if (windows->image.mapped != MagickFalse )
     (void) XWithdrawWindow(display,windows->info.id,windows->info.screen);
-  if (IfMagickTrue(display_image->debug) )
+  if (display_image->debug != MagickFalse )
     (void) LogMagickEvent(X11Event,GetMagickModule(),"Window id: 0x%lx (info)",
       windows->info.id);
   /*
@@ -14873,9 +14873,9 @@ MagickExport Image *XDisplayImage(Display *display,XResourceInfo *resource_info,
   windows->command.shadow_stipple=XCreateBitmapFromData(display,
     windows->command.id,(char *) ShadowBitmap,ShadowWidth,ShadowHeight);
   (void) XSetTransientForHint(display,windows->command.id,windows->image.id);
-  if (IfMagickTrue(windows->command.mapped) )
+  if (windows->command.mapped != MagickFalse )
     (void) XMapRaised(display,windows->command.id);
-  if (IfMagickTrue(display_image->debug) )
+  if (display_image->debug != MagickFalse )
     (void) LogMagickEvent(X11Event,GetMagickModule(),
       "Window id: 0x%lx (command)",windows->command.id);
   /*
@@ -14904,7 +14904,7 @@ MagickExport Image *XDisplayImage(Display *display,XResourceInfo *resource_info,
   windows->widget.shadow_stipple=XCreateBitmapFromData(display,
     windows->widget.id,(char *) ShadowBitmap,ShadowWidth,ShadowHeight);
   (void) XSetTransientForHint(display,windows->widget.id,windows->image.id);
-  if (IfMagickTrue(display_image->debug) )
+  if (display_image->debug != MagickFalse )
     (void) LogMagickEvent(X11Event,GetMagickModule(),
       "Window id: 0x%lx (widget)",windows->widget.id);
   /*
@@ -14928,7 +14928,7 @@ MagickExport Image *XDisplayImage(Display *display,XResourceInfo *resource_info,
   windows->popup.shadow_stipple=XCreateBitmapFromData(display,
     windows->popup.id,(char *) ShadowBitmap,ShadowWidth,ShadowHeight);
   (void) XSetTransientForHint(display,windows->popup.id,windows->image.id);
-  if (IfMagickTrue(display_image->debug) )
+  if (display_image->debug != MagickFalse )
     (void) LogMagickEvent(X11Event,GetMagickModule(),
       "Window id: 0x%lx (pop up)",windows->popup.id);
   /*
@@ -14970,7 +14970,7 @@ MagickExport Image *XDisplayImage(Display *display,XResourceInfo *resource_info,
   manager_hints->window_group=windows->image.id;
   XMakeWindow(display,root_window,argv,argc,class_hints,manager_hints,
     &windows->magnify);
-  if (IfMagickTrue(display_image->debug) )
+  if (display_image->debug != MagickFalse )
     (void) LogMagickEvent(X11Event,GetMagickModule(),
       "Window id: 0x%lx (magnify)",windows->magnify.id);
   (void) XSetTransientForHint(display,windows->magnify.id,windows->image.id);
@@ -14999,11 +14999,11 @@ MagickExport Image *XDisplayImage(Display *display,XResourceInfo *resource_info,
   manager_hints->window_group=windows->image.id;
   XMakeWindow(display,root_window,argv,argc,class_hints,manager_hints,
     &windows->pan);
-  if (IfMagickTrue(display_image->debug) )
+  if (display_image->debug != MagickFalse )
     (void) LogMagickEvent(X11Event,GetMagickModule(),"Window id: 0x%lx (pan)",
       windows->pan.id);
   (void) XSetTransientForHint(display,windows->pan.id,windows->image.id);
-  if (IfMagickTrue(windows->info.mapped) )
+  if (windows->info.mapped != MagickFalse )
     (void) XWithdrawWindow(display,windows->info.id,windows->info.screen);
   if (IfMagickFalse(windows->image.mapped) ||
       (windows->backdrop.id != (Window) NULL))
@@ -15039,9 +15039,9 @@ MagickExport Image *XDisplayImage(Display *display,XResourceInfo *resource_info,
   if (IfMagickFalse(status))
     ThrowXWindowFatalException(XServerFatalError,"UnableToCreateXImage",
       display_image->filename);
-  if (IfMagickTrue(windows->magnify.mapped) )
+  if (windows->magnify.mapped != MagickFalse )
     (void) XMapRaised(display,windows->magnify.id);
-  if (IfMagickTrue(windows->pan.mapped) )
+  if (windows->pan.mapped != MagickFalse )
     (void) XMapRaised(display,windows->pan.id);
   windows->image.window_changes.width=(int) display_image->columns;
   windows->image.window_changes.height=(int) display_image->rows;
@@ -15054,7 +15054,7 @@ MagickExport Image *XDisplayImage(Display *display,XResourceInfo *resource_info,
   delay=display_image->delay/MagickMax(display_image->ticks_per_second,1L);
   timer=time((time_t *) NULL)+(delay == 0 ? 1 : delay)+1;
   update_time=0;
-  if (IfMagickTrue(resource_info->update) )
+  if (resource_info->update != MagickFalse )
     {
       MagickBooleanType
         status;
@@ -15063,7 +15063,7 @@ MagickExport Image *XDisplayImage(Display *display,XResourceInfo *resource_info,
         Determine when file data was last modified.
       */
       status=GetPathAttributes(display_image->filename,&attributes);
-      if (IfMagickTrue(status) )
+      if (status != MagickFalse )
         update_time=attributes.st_mtime;
     }
   *state&=(~FormerImageState);
@@ -15074,7 +15074,7 @@ MagickExport Image *XDisplayImage(Display *display,XResourceInfo *resource_info,
     /*
       Handle a window event.
     */
-    if (IfMagickTrue(windows->image.mapped) )
+    if (windows->image.mapped != MagickFalse )
       if ((display_image->delay != 0) || (resource_info->update != 0))
         {
           if (timer < time((time_t *) NULL))
@@ -15090,7 +15090,7 @@ MagickExport Image *XDisplayImage(Display *display,XResourceInfo *resource_info,
                     Determine if image file was modified.
                   */
                   status=GetPathAttributes(display_image->filename,&attributes);
-                  if (IfMagickTrue(status) )
+                  if (status != MagickFalse )
                     if (update_time != attributes.st_mtime)
                       {
                         /*
@@ -15160,7 +15160,7 @@ MagickExport Image *XDisplayImage(Display *display,XResourceInfo *resource_info,
     {
       case ButtonPress:
       {
-        if (IfMagickTrue(display_image->debug) )
+        if (display_image->debug != MagickFalse )
           (void) LogMagickEvent(X11Event,GetMagickModule(),
             "Button Press: 0x%lx %u +%d+%d",event.xbutton.window,
             event.xbutton.button,event.xbutton.x,event.xbutton.y);
@@ -15200,7 +15200,7 @@ MagickExport Image *XDisplayImage(Display *display,XResourceInfo *resource_info,
                 /*
                   Map/unmap Command widget.
                 */
-                if (IfMagickTrue(windows->command.mapped) )
+                if (windows->command.mapped != MagickFalse )
                   (void) XWithdrawWindow(display,windows->command.id,
                     windows->command.screen);
                 else
@@ -15355,7 +15355,7 @@ MagickExport Image *XDisplayImage(Display *display,XResourceInfo *resource_info,
       }
       case ButtonRelease:
       {
-        if (IfMagickTrue(display_image->debug) )
+        if (display_image->debug != MagickFalse )
           (void) LogMagickEvent(X11Event,GetMagickModule(),
             "Button Release: 0x%lx %u +%d+%d",event.xbutton.window,
             event.xbutton.button,event.xbutton.x,event.xbutton.y);
@@ -15363,7 +15363,7 @@ MagickExport Image *XDisplayImage(Display *display,XResourceInfo *resource_info,
       }
       case ClientMessage:
       {
-        if (IfMagickTrue(display_image->debug) )
+        if (display_image->debug != MagickFalse )
           (void) LogMagickEvent(X11Event,GetMagickModule(),
             "Client Message: 0x%lx 0x%lx %d 0x%lx",event.xclient.window,
             event.xclient.message_type,event.xclient.format,(unsigned long)
@@ -15409,7 +15409,7 @@ MagickExport Image *XDisplayImage(Display *display,XResourceInfo *resource_info,
                     (unsigned long) magick_windows[i]->mask,
                     &magick_windows[i]->attributes);
                 }
-                if (IfMagickTrue(windows->pan.mapped) )
+                if (windows->pan.mapped != MagickFalse )
                   {
                     (void) XSetWindowBackgroundPixmap(display,windows->pan.id,
                       windows->pan.pixmap);
@@ -15526,7 +15526,7 @@ MagickExport Image *XDisplayImage(Display *display,XResourceInfo *resource_info,
       }
       case ConfigureNotify:
       {
-        if (IfMagickTrue(display_image->debug) )
+        if (display_image->debug != MagickFalse )
           (void) LogMagickEvent(X11Event,GetMagickModule(),
             "Configure Notify: 0x%lx %dx%d+%d+%d %d",event.xconfigure.window,
             event.xconfigure.width,event.xconfigure.height,event.xconfigure.x,
@@ -15611,8 +15611,8 @@ MagickExport Image *XDisplayImage(Display *display,XResourceInfo *resource_info,
                 windows->image.x=vid_info.x;
                 windows->image.y=vid_info.y;
               }
-            if (IfMagickTrue(windows->image.mapped) &&
-                IfMagickTrue(windows->image.stasis) )
+            if (windows->image.mapped != MagickFalse &&
+                windows->image.stasis != MagickFalse )
               {
                 /*
                   Update image window configuration.
@@ -15632,7 +15632,7 @@ MagickExport Image *XDisplayImage(Display *display,XResourceInfo *resource_info,
                 XDrawPanRectangle(display,windows);
               }
             else
-              if (IfMagickTrue(windows->pan.mapped) )
+              if (windows->pan.mapped != MagickFalse )
                 (void) XWithdrawWindow(display,windows->pan.id,
                   windows->pan.screen);
             break;
@@ -15665,8 +15665,8 @@ MagickExport Image *XDisplayImage(Display *display,XResourceInfo *resource_info,
                   &window_changes);
                 break;
               }
-            if (IfMagickTrue(windows->magnify.mapped) &&
-                IfMagickTrue(windows->magnify.stasis) )
+            if (windows->magnify.mapped != MagickFalse &&
+                windows->magnify.stasis != MagickFalse )
               {
                 status=XMakeImage(display,resource_info,&windows->magnify,
                   display_image,windows->magnify.width,windows->magnify.height,
@@ -15675,7 +15675,7 @@ MagickExport Image *XDisplayImage(Display *display,XResourceInfo *resource_info,
               }
             break;
           }
-        if (IfMagickTrue(windows->magnify.mapped) &&
+        if (windows->magnify.mapped != MagickFalse &&
             (event.xconfigure.window == windows->pan.id))
           {
             /*
@@ -15706,7 +15706,7 @@ MagickExport Image *XDisplayImage(Display *display,XResourceInfo *resource_info,
         /*
           Group leader has exited.
         */
-        if (IfMagickTrue(display_image->debug) )
+        if (display_image->debug != MagickFalse )
           (void) LogMagickEvent(X11Event,GetMagickModule(),
             "Destroy Notify: 0x%lx",event.xdestroywindow.window);
         if (event.xdestroywindow.window == windows->group_leader.id)
@@ -15728,7 +15728,7 @@ MagickExport Image *XDisplayImage(Display *display,XResourceInfo *resource_info,
       }
       case Expose:
       {
-        if (IfMagickTrue(display_image->debug) )
+        if (display_image->debug != MagickFalse )
           (void) LogMagickEvent(X11Event,GetMagickModule(),
             "Expose: 0x%lx %dx%d+%d+%d",event.xexpose.window,
             event.xexpose.width,event.xexpose.height,event.xexpose.x,
@@ -15737,7 +15737,7 @@ MagickExport Image *XDisplayImage(Display *display,XResourceInfo *resource_info,
           Refresh windows that are now exposed.
         */
         if ((event.xexpose.window == windows->image.id) &&
-            IfMagickTrue(windows->image.mapped) )
+            windows->image.mapped != MagickFalse )
           {
             XRefreshWindow(display,&windows->image,&event);
             delay=display_image->delay/MagickMax(
@@ -15746,7 +15746,7 @@ MagickExport Image *XDisplayImage(Display *display,XResourceInfo *resource_info,
             break;
           }
         if ((event.xexpose.window == windows->magnify.id) &&
-            IfMagickTrue(windows->magnify.mapped))
+            windows->magnify.mapped != MagickFalse)
           {
             XMakeMagnifyImage(display,windows,exception);
             break;
@@ -15774,7 +15774,7 @@ MagickExport Image *XDisplayImage(Display *display,XResourceInfo *resource_info,
         length=XLookupString((XKeyEvent *) &event.xkey,command,(int)
           sizeof(command),&key_symbol,(XComposeStatus *) NULL);
         *(command+length)='\0';
-        if (IfMagickTrue(display_image->debug) )
+        if (display_image->debug != MagickFalse )
           (void) LogMagickEvent(X11Event,GetMagickModule(),
             "Key press: %d 0x%lx (%s)",event.xkey.state,(unsigned long)
             key_symbol,command);
@@ -15813,7 +15813,7 @@ MagickExport Image *XDisplayImage(Display *display,XResourceInfo *resource_info,
         */
         (void) XLookupString((XKeyEvent *) &event.xkey,command,(int)
           sizeof(command),&key_symbol,(XComposeStatus *) NULL);
-        if (IfMagickTrue(display_image->debug) )
+        if (display_image->debug != MagickFalse )
           (void) LogMagickEvent(X11Event,GetMagickModule(),
             "Key release: 0x%lx (%c)",(unsigned long) key_symbol,*command);
         break;
@@ -15830,7 +15830,7 @@ MagickExport Image *XDisplayImage(Display *display,XResourceInfo *resource_info,
       }
       case MapNotify:
       {
-        if (IfMagickTrue(display_image->debug) )
+        if (display_image->debug != MagickFalse )
           (void) LogMagickEvent(X11Event,GetMagickModule(),"Map Notify: 0x%lx",
             event.xmap.window);
         if (event.xmap.window == windows->backdrop.id)
@@ -15938,7 +15938,7 @@ MagickExport Image *XDisplayImage(Display *display,XResourceInfo *resource_info,
           after,
           length;
 
-        if (IfMagickTrue(display_image->debug) )
+        if (display_image->debug != MagickFalse )
           (void) LogMagickEvent(X11Event,GetMagickModule(),
             "Property Notify: 0x%lx 0x%lx %d",event.xproperty.window,
             event.xproperty.atom,event.xproperty.state);
@@ -15970,7 +15970,7 @@ MagickExport Image *XDisplayImage(Display *display,XResourceInfo *resource_info,
       }
       case ReparentNotify:
       {
-        if (IfMagickTrue(display_image->debug) )
+        if (display_image->debug != MagickFalse )
           (void) LogMagickEvent(X11Event,GetMagickModule(),
             "Reparent Notify: 0x%lx=>0x%lx",event.xreparent.parent,
             event.xreparent.window);
@@ -15978,7 +15978,7 @@ MagickExport Image *XDisplayImage(Display *display,XResourceInfo *resource_info,
       }
       case UnmapNotify:
       {
-        if (IfMagickTrue(display_image->debug) )
+        if (display_image->debug != MagickFalse )
           (void) LogMagickEvent(X11Event,GetMagickModule(),
             "Unmap Notify: 0x%lx",event.xunmap.window);
         if (event.xunmap.window == windows->backdrop.id)
@@ -16041,7 +16041,7 @@ MagickExport Image *XDisplayImage(Display *display,XResourceInfo *resource_info,
       }
       default:
       {
-        if (IfMagickTrue(display_image->debug) )
+        if (display_image->debug != MagickFalse )
           (void) LogMagickEvent(X11Event,GetMagickModule(),"Event type: %d",
             event.type);
         break;
@@ -16052,13 +16052,13 @@ MagickExport Image *XDisplayImage(Display *display,XResourceInfo *resource_info,
     (void) XMagickCommand(display,resource_info,windows,FreeBuffersCommand,
       &display_image,exception);
   else
-    if (IfMagickTrue(resource_info->confirm_edit) )
+    if (resource_info->confirm_edit != MagickFalse )
       {
         /*
           Query user if image has changed.
         */
         if (IfMagickFalse(resource_info->immutable) &&
-            IfMagickTrue(display_image->taint))
+            display_image->taint != MagickFalse)
           {
             int
               status;
@@ -16080,16 +16080,16 @@ MagickExport Image *XDisplayImage(Display *display,XResourceInfo *resource_info,
       /*
         Withdraw pan and Magnify window.
       */
-      if (IfMagickTrue(windows->info.mapped) )
+      if (windows->info.mapped != MagickFalse )
         (void) XWithdrawWindow(display,windows->info.id,windows->info.screen);
-      if (IfMagickTrue(windows->magnify.mapped) )
+      if (windows->magnify.mapped != MagickFalse )
         (void) XWithdrawWindow(display,windows->magnify.id,
           windows->magnify.screen);
-      if (IfMagickTrue(windows->command.mapped) )
+      if (windows->command.mapped != MagickFalse )
         (void) XWithdrawWindow(display,windows->command.id,
           windows->command.screen);
     }
-  if (IfMagickTrue(windows->pan.mapped) )
+  if (windows->pan.mapped != MagickFalse )
     (void) XWithdrawWindow(display,windows->pan.id,windows->pan.screen);
   if (IfMagickFalse(resource_info->backdrop) )
     if (windows->backdrop.mapped)
@@ -16189,7 +16189,7 @@ MagickExport MagickBooleanType DisplayImages(const ImageInfo *image_info,
   assert(image != (Image *) NULL);
   assert(image->signature == MagickCoreSignature);
   (void) image_info;
-  if (IfMagickTrue(image->debug) )
+  if (image->debug != MagickFalse )
     (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",image->filename);
   (void) ThrowMagickException(exception,GetMagickModule(),MissingDelegateError,
     "DelegateLibrarySupportNotBuiltIn","'%s' (X11)",image->filename);
index 9bdd80443a6447f7f923bc00fe4f2b6b0855a23b..461a12901fd502349cb9e5b2e92959969584db9e 100644 (file)
@@ -326,7 +326,7 @@ MagickExport MagickBooleanType ClutImage(Image *image,const Image *clut_image,
   assert(clut_image->signature == MagickCoreSignature);
   if( IfMagickFalse(SetImageStorageClass(image,DirectClass,exception)) )
     return(MagickFalse);
-  if( IfMagickTrue(IsGrayColorspace(image->colorspace)) &&
+  if( IsGrayColorspace(image->colorspace != MagickFalse) &&
       IfMagickFalse(IsGrayColorspace(clut_image->colorspace)))
     (void) SetImageColorspace(image,sRGBColorspace,exception);
   clut_map=(PixelInfo *) AcquireQuantumMemory(MaxMap+1UL,sizeof(*clut_map));
@@ -888,7 +888,7 @@ MagickExport MagickBooleanType ContrastImage(Image *image,
   assert(image->signature == MagickCoreSignature);
   if (image->debug != MagickFalse)
     (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",image->filename);
-  sign=IfMagickTrue(sharpen) ? 1 : -1;
+  sign=sharpen != MagickFalse ? 1 : -1;
   if (image->storage_class == PseudoClass)
     {
       /*
@@ -2679,7 +2679,7 @@ MagickExport MagickBooleanType LevelImageColors(Image *image,
   assert(image->signature == MagickCoreSignature);
   if (image->debug != MagickFalse)
     (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",image->filename);
-  if( IfMagickTrue(IsGrayColorspace(image->colorspace)) &&
+  if( IsGrayColorspace(image->colorspace != MagickFalse) &&
       (IfMagickFalse(IsGrayColorspace(black_color->colorspace)) ||
        IfMagickFalse(IsGrayColorspace(white_color->colorspace))))
     (void) SetImageColorspace(image,sRGBColorspace,exception);
@@ -3423,7 +3423,7 @@ MagickExport MagickBooleanType NegateImage(Image *image,
       /*
         Negate colormap.
       */
-      if( IfMagickTrue(grayscale) )
+      if( grayscale != MagickFalse )
         if ((image->colormap[i].red != image->colormap[i].green) ||
             (image->colormap[i].green != image->colormap[i].blue))
           continue;
@@ -3440,7 +3440,7 @@ MagickExport MagickBooleanType NegateImage(Image *image,
   status=MagickTrue;
   progress=0;
   image_view=AcquireAuthenticCacheView(image,exception);
-  if( IfMagickTrue(grayscale) )
+  if( grayscale != MagickFalse )
     {
       for (y=0; y < (ssize_t) image->rows; y++)
       {
@@ -3468,7 +3468,7 @@ MagickExport MagickBooleanType NegateImage(Image *image,
             j;
 
           if ((GetPixelReadMask(image,q) == 0) ||
-              IfMagickTrue(IsPixelGray(image,q)))
+              IsPixelGray(image,q != MagickFalse))
             {
               q+=GetPixelChannels(image);
               continue;
@@ -3771,7 +3771,7 @@ MagickExport MagickBooleanType SigmoidalContrastImage(Image *image,
       register ssize_t
         i;
 
-      if( IfMagickTrue(sharpen) )
+      if( sharpen != MagickFalse )
         for (i=0; i < (ssize_t) image->colors; i++)
         {
           if ((GetPixelRedTraits(image) & UpdatePixelTrait) != 0)
@@ -3846,7 +3846,7 @@ MagickExport MagickBooleanType SigmoidalContrastImage(Image *image,
         PixelTrait traits=GetPixelChannelTraits(image,channel);
         if ((traits & UpdatePixelTrait) == 0)
           continue;
-        if( IfMagickTrue(sharpen) )
+        if( sharpen != MagickFalse )
           q[i]=ScaledSig(q[i]);
         else
           q[i]=InverseScaledSig(q[i]);
index 0a63d45ba2d0e77bb498f91490269f0610847958..b793755cae1b1b4b33b014fb6575f1119b1225af 100644 (file)
-/*
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%                                                                             %
-%                                                                             %
-%                                                                             %
-%                H   H   AAA   SSSSS  H   H  M   M   AAA   PPPP               %
-%                H   H  A   A  SS     H   H  MM MM  A   A  P   P              %
-%                HHHHH  AAAAA   SSS   HHHHH  M M M  AAAAA  PPPP               %
-%                H   H  A   A     SS  H   H  M   M  A   A  P                  %
-%                H   H  A   A  SSSSS  H   H  M   M  A   A  P                  %
-%                                                                             %
-%                                                                             %
-%                  MagickCore Hash-map and Linked-list Methods                %
-%                                                                             %
-%                              Software Design                                %
-%                                   Cristy                                    %
-%                               December 2002                                 %
-%                                                                             %
-%                                                                             %
-%  Copyright 1999-2016 ImageMagick Studio LLC, a non-profit organization      %
-%  dedicated to making software imaging solutions freely available.           %
-%                                                                             %
-%  You may not use this file except in compliance with the License.  You may  %
-%  obtain a copy of the License at                                            %
-%                                                                             %
-%    http://www.imagemagick.org/script/license.php                            %
-%                                                                             %
-%  Unless required by applicable law or agreed to in writing, software        %
-%  distributed under the License is distributed on an "AS IS" BASIS,          %
-%  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.   %
-%  See the License for the specific language governing permissions and        %
-%  limitations under the License.                                             %
-%                                                                             %
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%
-%  This module implements the standard handy hash and linked-list methods for
-%  storing and retrieving large numbers of data elements.  It is loosely based
-%  on the Java implementation of these algorithms.
-%
-*/
-\f
-/*
-  Include declarations.
-*/
-#include "MagickCore/studio.h"
-#include "MagickCore/exception.h"
-#include "MagickCore/exception-private.h"
-#include "MagickCore/locale_.h"
-#include "MagickCore/hashmap.h"
-#include "MagickCore/memory_.h"
-#include "MagickCore/semaphore.h"
-#include "MagickCore/signature-private.h"
-#include "MagickCore/string_.h"
-\f
-/*
-  Typedef declarations.
-*/
-typedef struct _ElementInfo
-{
-  void
-    *value;
-
-  struct _ElementInfo
-    *next;
-} ElementInfo;
-
-typedef struct _EntryInfo
-{
-  size_t
-    hash;
-
-  void
-    *key,
-    *value;
-} EntryInfo;
-
-struct _LinkedListInfo
-{
-  size_t
-    capacity,
-    elements;
-
-  ElementInfo
-    *head,
-    *tail,
-    *next;
-
-  SemaphoreInfo
-    *semaphore;
-
-  size_t
-    signature;
-};
-
-struct _HashmapInfo
-{
-  size_t
-    (*hash)(const void *);
-
-  MagickBooleanType
-    (*compare)(const void *,const void *);
-
-  void
-    *(*relinquish_key)(void *),
-    *(*relinquish_value)(void *);
-
-  size_t
-    capacity,
-    entries,
-    next;
-
-  MagickBooleanType
-    head_of_list;
-
-  LinkedListInfo
-    **map;
-
-  SemaphoreInfo
-    *semaphore;
-
-  size_t
-    signature;
-};
-\f
-/*
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%                                                                             %
-%                                                                             %
-%                                                                             %
-%   A p p e n d V a l u e T o L i n k e d L i s t                             %
-%                                                                             %
-%                                                                             %
-%                                                                             %
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%
-%  AppendValueToLinkedList() appends a value to the end of the linked-list.
-%
-%  The format of the AppendValueToLinkedList method is:
-%
-%      MagickBooleanType AppendValueToLinkedList(LinkedListInfo *list_info,
-%        const void *value)
-%
-%  A description of each parameter follows:
-%
-%    o list_info: the linked-list info.
-%
-%    o value: the value.
-%
-*/
-MagickExport MagickBooleanType AppendValueToLinkedList(
-  LinkedListInfo *list_info,const void *value)
-{
-  register ElementInfo
-    *next;
-
-  assert(list_info != (LinkedListInfo *) NULL);
-  assert(list_info->signature == MagickCoreSignature);
-  if (list_info->elements == list_info->capacity)
-    return(MagickFalse);
-  next=(ElementInfo *) AcquireMagickMemory(sizeof(*next));
-  if (next == (ElementInfo *) NULL)
-    return(MagickFalse);
-  next->value=(void *) value;
-  next->next=(ElementInfo *) NULL;
-  LockSemaphoreInfo(list_info->semaphore);
-  if (list_info->next == (ElementInfo *) NULL)
-    list_info->next=next;
-  if (list_info->elements == 0)
-    list_info->head=next;
-  else
-    list_info->tail->next=next;
-  list_info->tail=next;
-  list_info->elements++;
-  UnlockSemaphoreInfo(list_info->semaphore);
-  return(MagickTrue);
-}
-\f
-/*
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%                                                                             %
-%                                                                             %
-%                                                                             %
-%   C l e a r L i n k e d L i s t                                             %
-%                                                                             %
-%                                                                             %
-%                                                                             %
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%
-%  ClearLinkedList() clears all the elements from the linked-list.
-%
-%  The format of the ClearLinkedList method is:
-%
-%      void ClearLinkedList(LinkedListInfo *list_info,
-%        void *(*relinquish_value)(void *))
-%
-%  A description of each parameter follows:
-%
-%    o list_info: the linked-list info.
-%
-%    o relinquish_value: the value deallocation method; typically
-%      RelinquishMagickMemory().
-%
-*/
-MagickExport void ClearLinkedList(LinkedListInfo *list_info,
-  void *(*relinquish_value)(void *))
-{
-  ElementInfo
-    *element;
-
-  register ElementInfo
-    *next;
-
-  assert(list_info != (LinkedListInfo *) NULL);
-  assert(list_info->signature == MagickCoreSignature);
-  LockSemaphoreInfo(list_info->semaphore);
-  next=list_info->head;
-  while (next != (ElementInfo *) NULL)
-  {
-    if (relinquish_value != (void *(*)(void *)) NULL)
-      next->value=relinquish_value(next->value);
-    element=next;
-    next=next->next;
-    element=(ElementInfo *) RelinquishMagickMemory(element);
-  }
-  list_info->head=(ElementInfo *) NULL;
-  list_info->tail=(ElementInfo *) NULL;
-  list_info->next=(ElementInfo *) NULL;
-  list_info->elements=0;
-  UnlockSemaphoreInfo(list_info->semaphore);
-}
-\f
-/*
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%                                                                             %
-%                                                                             %
-%                                                                             %
-%   C o m p a r e H a s h m a p S t r i n g                                   %
-%                                                                             %
-%                                                                             %
-%                                                                             %
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%
-%  CompareHashmapString() finds an entry in a hash-map based on the contents
-%  of a string.
-%
-%  The format of the CompareHashmapString method is:
-%
-%      MagickBooleanType CompareHashmapString(const void *target,
-%        const void *source)
-%
-%  A description of each parameter follows:
-%
-%    o target: the target string.
-%
-%    o source: the source string.
-%
-*/
-MagickExport MagickBooleanType CompareHashmapString(const void *target,
-  const void *source)
-{
-  const char
-    *p,
-    *q;
-
-  p=(const char *) target;
-  q=(const char *) source;
-  return(LocaleCompare(p,q) == 0 ? MagickTrue : MagickFalse);
-}
-\f
-/*
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%                                                                             %
-%                                                                             %
-%                                                                             %
-%   C o m p a r e H a s h m a p S t r i n g I n f o                           %
-%                                                                             %
-%                                                                             %
-%                                                                             %
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%
-%  CompareHashmapStringInfo() finds an entry in a hash-map based on the
-%  contents of a string.
-%
-%  The format of the CompareHashmapStringInfo method is:
-%
-%      MagickBooleanType CompareHashmapStringInfo(const void *target,
-%        const void *source)
-%
-%  A description of each parameter follows:
-%
-%    o target: the target string.
-%
-%    o source: the source string.
-%
-*/
-MagickExport MagickBooleanType CompareHashmapStringInfo(const void *target,
-  const void *source)
+/*\r
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\r
+%                                                                             %\r
+%                                                                             %\r
+%                                                                             %\r
+%                H   H   AAA   SSSSS  H   H  M   M   AAA   PPPP               %\r
+%                H   H  A   A  SS     H   H  MM MM  A   A  P   P              %\r
+%                HHHHH  AAAAA   SSS   HHHHH  M M M  AAAAA  PPPP               %\r
+%                H   H  A   A     SS  H   H  M   M  A   A  P                  %\r
+%                H   H  A   A  SSSSS  H   H  M   M  A   A  P                  %\r
+%                                                                             %\r
+%                                                                             %\r
+%                  MagickCore Hash-map and Linked-list Methods                %\r
+%                                                                             %\r
+%                              Software Design                                %\r
+%                                   Cristy                                    %\r
+%                               December 2002                                 %\r
+%                                                                             %\r
+%                                                                             %\r
+%  Copyright 1999-2016 ImageMagick Studio LLC, a non-profit organization      %\r
+%  dedicated to making software imaging solutions freely available.           %\r
+%                                                                             %\r
+%  You may not use this file except in compliance with the License.  You may  %\r
+%  obtain a copy of the License at                                            %\r
+%                                                                             %\r
+%    http://www.imagemagick.org/script/license.php                            %\r
+%                                                                             %\r
+%  Unless required by applicable law or agreed to in writing, software        %\r
+%  distributed under the License is distributed on an "AS IS" BASIS,          %\r
+%  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.   %\r
+%  See the License for the specific language governing permissions and        %\r
+%  limitations under the License.                                             %\r
+%                                                                             %\r
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\r
+%\r
+%  This module implements the standard handy hash and linked-list methods for\r
+%  storing and retrieving large numbers of data elements.  It is loosely based\r
+%  on the Java implementation of these algorithms.\r
+%\r
+*/\r
+\f\r
+/*\r
+  Include declarations.\r
+*/\r
+#include "MagickCore/studio.h"\r
+#include "MagickCore/exception.h"\r
+#include "MagickCore/exception-private.h"\r
+#include "MagickCore/locale_.h"\r
+#include "MagickCore/hashmap.h"\r
+#include "MagickCore/memory_.h"\r
+#include "MagickCore/semaphore.h"\r
+#include "MagickCore/signature-private.h"\r
+#include "MagickCore/string_.h"\r
+\f\r
+/*\r
+  Typedef declarations.\r
+*/\r
+typedef struct _ElementInfo\r
+{\r
+  void\r
+    *value;\r
+\r
+  struct _ElementInfo\r
+    *next;\r
+} ElementInfo;\r
+\r
+typedef struct _EntryInfo\r
+{\r
+  size_t\r
+    hash;\r
+\r
+  void\r
+    *key,\r
+    *value;\r
+} EntryInfo;\r
+\r
+struct _LinkedListInfo\r
+{\r
+  size_t\r
+    capacity,\r
+    elements;\r
+\r
+  ElementInfo\r
+    *head,\r
+    *tail,\r
+    *next;\r
+\r
+  SemaphoreInfo\r
+    *semaphore;\r
+\r
+  size_t\r
+    signature;\r
+};\r
+\r
+struct _HashmapInfo\r
+{\r
+  size_t\r
+    (*hash)(const void *);\r
+\r
+  MagickBooleanType\r
+    (*compare)(const void *,const void *);\r
+\r
+  void\r
+    *(*relinquish_key)(void *),\r
+    *(*relinquish_value)(void *);\r
+\r
+  size_t\r
+    capacity,\r
+    entries,\r
+    next;\r
+\r
+  MagickBooleanType\r
+    head_of_list;\r
+\r
+  LinkedListInfo\r
+    **map;\r
+\r
+  SemaphoreInfo\r
+    *semaphore;\r
+\r
+  size_t\r
+    signature;\r
+};\r
+\f\r
+/*\r
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\r
+%                                                                             %\r
+%                                                                             %\r
+%                                                                             %\r
+%   A p p e n d V a l u e T o L i n k e d L i s t                             %\r
+%                                                                             %\r
+%                                                                             %\r
+%                                                                             %\r
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\r
+%\r
+%  AppendValueToLinkedList() appends a value to the end of the linked-list.\r
+%\r
+%  The format of the AppendValueToLinkedList method is:\r
+%\r
+%      MagickBooleanType AppendValueToLinkedList(LinkedListInfo *list_info,\r
+%        const void *value)\r
+%\r
+%  A description of each parameter follows:\r
+%\r
+%    o list_info: the linked-list info.\r
+%\r
+%    o value: the value.\r
+%\r
+*/\r
+MagickExport MagickBooleanType AppendValueToLinkedList(\r
+  LinkedListInfo *list_info,const void *value)\r
+{\r
+  register ElementInfo\r
+    *next;\r
+\r
+  assert(list_info != (LinkedListInfo *) NULL);\r
+  assert(list_info->signature == MagickCoreSignature);\r
+  if (list_info->elements == list_info->capacity)\r
+    return(MagickFalse);\r
+  next=(ElementInfo *) AcquireMagickMemory(sizeof(*next));\r
+  if (next == (ElementInfo *) NULL)\r
+    return(MagickFalse);\r
+  next->value=(void *) value;\r
+  next->next=(ElementInfo *) NULL;\r
+  LockSemaphoreInfo(list_info->semaphore);\r
+  if (list_info->next == (ElementInfo *) NULL)\r
+    list_info->next=next;\r
+  if (list_info->elements == 0)\r
+    list_info->head=next;\r
+  else\r
+    list_info->tail->next=next;\r
+  list_info->tail=next;\r
+  list_info->elements++;\r
+  UnlockSemaphoreInfo(list_info->semaphore);\r
+  return(MagickTrue);\r
+}\r
+\f\r
+/*\r
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\r
+%                                                                             %\r
+%                                                                             %\r
+%                                                                             %\r
+%   C l e a r L i n k e d L i s t                                             %\r
+%                                                                             %\r
+%                                                                             %\r
+%                                                                             %\r
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\r
+%\r
+%  ClearLinkedList() clears all the elements from the linked-list.\r
+%\r
+%  The format of the ClearLinkedList method is:\r
+%\r
+%      void ClearLinkedList(LinkedListInfo *list_info,\r
+%        void *(*relinquish_value)(void *))\r
+%\r
+%  A description of each parameter follows:\r
+%\r
+%    o list_info: the linked-list info.\r
+%\r
+%    o relinquish_value: the value deallocation method; typically\r
+%      RelinquishMagickMemory().\r
+%\r
+*/\r
+MagickExport void ClearLinkedList(LinkedListInfo *list_info,\r
+  void *(*relinquish_value)(void *))\r
+{\r
+  ElementInfo\r
+    *element;\r
+\r
+  register ElementInfo\r
+    *next;\r
+\r
+  assert(list_info != (LinkedListInfo *) NULL);\r
+  assert(list_info->signature == MagickCoreSignature);\r
+  LockSemaphoreInfo(list_info->semaphore);\r
+  next=list_info->head;\r
+  while (next != (ElementInfo *) NULL)\r
+  {\r
+    if (relinquish_value != (void *(*)(void *)) NULL)\r
+      next->value=relinquish_value(next->value);\r
+    element=next;\r
+    next=next->next;\r
+    element=(ElementInfo *) RelinquishMagickMemory(element);\r
+  }\r
+  list_info->head=(ElementInfo *) NULL;\r
+  list_info->tail=(ElementInfo *) NULL;\r
+  list_info->next=(ElementInfo *) NULL;\r
+  list_info->elements=0;\r
+  UnlockSemaphoreInfo(list_info->semaphore);\r
+}\r
+\f\r
+/*\r
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\r
+%                                                                             %\r
+%                                                                             %\r
+%                                                                             %\r
+%   C o m p a r e H a s h m a p S t r i n g                                   %\r
+%                                                                             %\r
+%                                                                             %\r
+%                                                                             %\r
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\r
+%\r
+%  CompareHashmapString() finds an entry in a hash-map based on the contents\r
+%  of a string.\r
+%\r
+%  The format of the CompareHashmapString method is:\r
+%\r
+%      MagickBooleanType CompareHashmapString(const void *target,\r
+%        const void *source)\r
+%\r
+%  A description of each parameter follows:\r
+%\r
+%    o target: the target string.\r
+%\r
+%    o source: the source string.\r
+%\r
+*/\r
+MagickExport MagickBooleanType CompareHashmapString(const void *target,\r
+  const void *source)\r
+{\r
+  const char\r
+    *p,\r
+    *q;\r
+\r
+  p=(const char *) target;\r
+  q=(const char *) source;\r
+  return(LocaleCompare(p,q) == 0 ? MagickTrue : MagickFalse);\r
+}\r
+\f\r
+/*\r
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\r
+%                                                                             %\r
+%                                                                             %\r
+%                                                                             %\r
+%   C o m p a r e H a s h m a p S t r i n g I n f o                           %\r
+%                                                                             %\r
+%                                                                             %\r
+%                                                                             %\r
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\r
+%\r
+%  CompareHashmapStringInfo() finds an entry in a hash-map based on the\r
+%  contents of a string.\r
+%\r
+%  The format of the CompareHashmapStringInfo method is:\r
+%\r
+%      MagickBooleanType CompareHashmapStringInfo(const void *target,\r
+%        const void *source)\r
+%\r
+%  A description of each parameter follows:\r
+%\r
+%    o target: the target string.\r
+%\r
+%    o source: the source string.\r
+%\r
+*/\r
+MagickExport MagickBooleanType CompareHashmapStringInfo(const void *target,\r
+  const void *source)\r
 {\r
   const StringInfo\r
     *p,\r
@@ -302,1627 +302,1627 @@ MagickExport MagickBooleanType CompareHashmapStringInfo(const void *target,
 \r
   p=(const StringInfo *) target;\r
   q=(const StringInfo *) source;\r
-  return(CompareStringInfo(p,q) == 0 ? MagickTrue : MagickFalse);
-}
-\f
-/*
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%                                                                             %
-%                                                                             %
-%                                                                             %
-%   D e s t r o y H a s h m a p                                               %
-%                                                                             %
-%                                                                             %
-%                                                                             %
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%
-%  DestroyHashmap() frees the hash-map and all associated resources.
-%
-%  The format of the DestroyHashmap method is:
-%
-%      HashmapInfo *DestroyHashmap(HashmapInfo *hashmap_info)
-%
-%  A description of each parameter follows:
-%
-%    o hashmap_info: the hashmap info.
-%
-*/
-MagickExport HashmapInfo *DestroyHashmap(HashmapInfo *hashmap_info)
-{
-  LinkedListInfo
-    *list_info;
-
-  register EntryInfo
-    *entry;
-
-  register ssize_t
-    i;
-
-  assert(hashmap_info != (HashmapInfo *) NULL);
-  assert(hashmap_info->signature == MagickCoreSignature);
-  LockSemaphoreInfo(hashmap_info->semaphore);
-  for (i=0; i < (ssize_t) hashmap_info->capacity; i++)
-  {
-    list_info=hashmap_info->map[i];
-    if (list_info != (LinkedListInfo *) NULL)
-      {
-        list_info->next=list_info->head;
-        entry=(EntryInfo *) GetNextValueInLinkedList(list_info);
-        while (entry != (EntryInfo *) NULL)
-        {
-          if (hashmap_info->relinquish_key != (void *(*)(void *)) NULL)
-            entry->key=hashmap_info->relinquish_key(entry->key);
-          if (hashmap_info->relinquish_value != (void *(*)(void *)) NULL)
-            entry->value=hashmap_info->relinquish_value(entry->value);
-          entry=(EntryInfo *) GetNextValueInLinkedList(list_info);
-        }
-      }
-    if (list_info != (LinkedListInfo *) NULL)
-      list_info=DestroyLinkedList(list_info,RelinquishMagickMemory);
-  }
-  hashmap_info->map=(LinkedListInfo **) RelinquishMagickMemory(
-    hashmap_info->map);
-  hashmap_info->signature=(~MagickCoreSignature);
-  UnlockSemaphoreInfo(hashmap_info->semaphore);
-  RelinquishSemaphoreInfo(&hashmap_info->semaphore);
-  hashmap_info=(HashmapInfo *) RelinquishMagickMemory(hashmap_info);
-  return(hashmap_info);
-}
-\f
-/*
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%                                                                             %
-%                                                                             %
-%                                                                             %
-%   D e s t r o y L i n k e d L i s t                                         %
-%                                                                             %
-%                                                                             %
-%                                                                             %
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%
-%  DestroyLinkedList() frees the linked-list and all associated resources.
-%
-%  The format of the DestroyLinkedList method is:
-%
-%      LinkedListInfo *DestroyLinkedList(LinkedListInfo *list_info,
-%        void *(*relinquish_value)(void *))
-%
-%  A description of each parameter follows:
-%
-%    o list_info: the linked-list info.
-%
-%    o relinquish_value: the value deallocation method;  typically
-%      RelinquishMagickMemory().
-%
-*/
-MagickExport LinkedListInfo *DestroyLinkedList(LinkedListInfo *list_info,
-  void *(*relinquish_value)(void *))
-{
-  ElementInfo
-    *entry;
-
-  register ElementInfo
-    *next;
-
-  assert(list_info != (LinkedListInfo *) NULL);
-  assert(list_info->signature == MagickCoreSignature);
-  LockSemaphoreInfo(list_info->semaphore);
-  for (next=list_info->head; next != (ElementInfo *) NULL; )
-  {
-    if (relinquish_value != (void *(*)(void *)) NULL)
-      next->value=relinquish_value(next->value);
-    entry=next;
-    next=next->next;
-    entry=(ElementInfo *) RelinquishMagickMemory(entry);
-  }
-  list_info->signature=(~MagickCoreSignature);
-  UnlockSemaphoreInfo(list_info->semaphore);
-  RelinquishSemaphoreInfo(&list_info->semaphore);
-  list_info=(LinkedListInfo *) RelinquishMagickMemory(list_info);
-  return(list_info);
-}
-\f
-/*
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%                                                                             %
-%                                                                             %
-%                                                                             %
-%   G e t L a s t V a l u e I n L i n k e d L i s t                           %
-%                                                                             %
-%                                                                             %
-%                                                                             %
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%
-%  GetLastValueInLinkedList() gets the last value in the linked-list.
-%
-%  The format of the GetLastValueInLinkedList method is:
-%
-%      void *GetLastValueInLinkedList(LinkedListInfo *list_info)
-%
-%  A description of each parameter follows:
-%
-%    o list_info: the linked_list info.
-%
-*/
-MagickExport void *GetLastValueInLinkedList(LinkedListInfo *list_info)
-{
-  void
-    *value;
-
-  assert(list_info != (LinkedListInfo *) NULL);
-  assert(list_info->signature == MagickCoreSignature);
-  if (list_info->elements == 0)
-    return((void *) NULL);
-  LockSemaphoreInfo(list_info->semaphore);
-  value=list_info->tail->value;
-  UnlockSemaphoreInfo(list_info->semaphore);
-  return(value);
-}
-\f
-/*
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%                                                                             %
-%                                                                             %
-%                                                                             %
-%   G e t N e x t K e y I n H a s h m a p                                     %
-%                                                                             %
-%                                                                             %
-%                                                                             %
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%
-%  GetNextKeyInHashmap() gets the next key in the hash-map.
-%
-%  The format of the GetNextKeyInHashmap method is:
-%
-%      void *GetNextKeyInHashmap(HashmapInfo *hashmap_info)
-%
-%  A description of each parameter follows:
-%
-%    o hashmap_info: the hashmap info.
-%
-*/
-MagickExport void *GetNextKeyInHashmap(HashmapInfo *hashmap_info)
-{
-  LinkedListInfo
-    *list_info;
-
-  register EntryInfo
-    *entry;
-
-  void
-    *key;
-
-  assert(hashmap_info != (HashmapInfo *) NULL);
-  assert(hashmap_info->signature == MagickCoreSignature);
-  LockSemaphoreInfo(hashmap_info->semaphore);
-  while (hashmap_info->next < hashmap_info->capacity)
-  {
-    list_info=hashmap_info->map[hashmap_info->next];
-    if (list_info != (LinkedListInfo *) NULL)
-      {
-        if (IfMagickFalse(hashmap_info->head_of_list))
-          {
-            list_info->next=list_info->head;
-            hashmap_info->head_of_list=MagickTrue;
-          }
-        entry=(EntryInfo *) GetNextValueInLinkedList(list_info);
-        if (entry != (EntryInfo *) NULL)
-          {
-            key=entry->key;
-            UnlockSemaphoreInfo(hashmap_info->semaphore);
-            return(key);
-          }
-        hashmap_info->head_of_list=MagickFalse;
-      }
-    hashmap_info->next++;
-  }
-  UnlockSemaphoreInfo(hashmap_info->semaphore);
-  return((void *) NULL);
-}
-\f
-/*
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%                                                                             %
-%                                                                             %
-%                                                                             %
-%   G e t N e x t V a l u e I n H a s h m a p                                 %
-%                                                                             %
-%                                                                             %
-%                                                                             %
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%
-%  GetNextValueInHashmap() gets the next value in the hash-map.
-%
-%  The format of the GetNextValueInHashmap method is:
-%
-%      void *GetNextValueInHashmap(HashmapInfo *hashmap_info)
-%
-%  A description of each parameter follows:
-%
-%    o hashmap_info: the hashmap info.
-%
-*/
-MagickExport void *GetNextValueInHashmap(HashmapInfo *hashmap_info)
-{
-  LinkedListInfo
-    *list_info;
-
-  register EntryInfo
-    *entry;
-
-  void
-    *value;
-
-  assert(hashmap_info != (HashmapInfo *) NULL);
-  assert(hashmap_info->signature == MagickCoreSignature);
-  LockSemaphoreInfo(hashmap_info->semaphore);
-  while (hashmap_info->next < hashmap_info->capacity)
-  {
-    list_info=hashmap_info->map[hashmap_info->next];
-    if (list_info != (LinkedListInfo *) NULL)
-      {
-        if (IfMagickFalse(hashmap_info->head_of_list))
-          {
-            list_info->next=list_info->head;
-            hashmap_info->head_of_list=MagickTrue;
-          }
-        entry=(EntryInfo *) GetNextValueInLinkedList(list_info);
-        if (entry != (EntryInfo *) NULL)
-          {
-            value=entry->value;
-            UnlockSemaphoreInfo(hashmap_info->semaphore);
-            return(value);
-          }
-        hashmap_info->head_of_list=MagickFalse;
-      }
-    hashmap_info->next++;
-  }
-  UnlockSemaphoreInfo(hashmap_info->semaphore);
-  return((void *) NULL);
-}
-\f
-/*
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%                                                                             %
-%                                                                             %
-%                                                                             %
-%   G e t N e x t V a l u e I n L i n k e d L i s t                           %
-%                                                                             %
-%                                                                             %
-%                                                                             %
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%
-%  GetNextValueInLinkedList() gets the next value in the linked-list.
-%
-%  The format of the GetNextValueInLinkedList method is:
-%
-%      void *GetNextValueInLinkedList(LinkedListInfo *list_info)
-%
-%  A description of each parameter follows:
-%
-%    o list_info: the linked-list info.
-%
-*/
-MagickExport void *GetNextValueInLinkedList(LinkedListInfo *list_info)
-{
-  void
-    *value;
-
-  assert(list_info != (LinkedListInfo *) NULL);
-  assert(list_info->signature == MagickCoreSignature);
-  LockSemaphoreInfo(list_info->semaphore);
-  if (list_info->next == (ElementInfo *) NULL)
-    {
-      UnlockSemaphoreInfo(list_info->semaphore);
-      return((void *) NULL);
-    }
-  value=list_info->next->value;
-  list_info->next=list_info->next->next;
-  UnlockSemaphoreInfo(list_info->semaphore);
-  return(value);
-}
-\f
-/*
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%                                                                             %
-%                                                                             %
-%                                                                             %
-%   G e t N u m b e r O f E n t r i e s I n H a s h m a p                     %
-%                                                                             %
-%                                                                             %
-%                                                                             %
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%
-%  GetNumberOfEntriesInHashmap() returns the number of entries in the hash-map.
-%
-%  The format of the GetNumberOfEntriesInHashmap method is:
-%
-%      size_t GetNumberOfEntriesInHashmap(const HashmapInfo *hashmap_info)
-%
-%  A description of each parameter follows:
-%
-%    o hashmap_info: the hashmap info.
-%
-*/
-MagickExport size_t GetNumberOfEntriesInHashmap(
-  const HashmapInfo *hashmap_info)
-{
-  assert(hashmap_info != (HashmapInfo *) NULL);
-  assert(hashmap_info->signature == MagickCoreSignature);
-  return(hashmap_info->entries);
-}
-\f
-/*
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%                                                                             %
-%                                                                             %
-%                                                                             %
-%   G e t N u m b e r O f E l e m e n t s I n L i n k e d L i s t             %
-%                                                                             %
-%                                                                             %
-%                                                                             %
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%
-%  GetNumberOfElementsInLinkedList() returns the number of entries in the
-%  linked-list.
-%
-%  The format of the GetNumberOfElementsInLinkedList method is:
-%
-%      size_t GetNumberOfElementsInLinkedList(
-%        const LinkedListInfo *list_info)
-%
-%  A description of each parameter follows:
-%
-%    o list_info: the linked-list info.
-%
-*/
-MagickExport size_t GetNumberOfElementsInLinkedList(
-  const LinkedListInfo *list_info)
-{
-  assert(list_info != (LinkedListInfo *) NULL);
-  assert(list_info->signature == MagickCoreSignature);
-  return(list_info->elements);
-}
-\f
-/*
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%                                                                             %
-%                                                                             %
-%                                                                             %
-%   G e t V a l u e F r o m H a s h m a p                                     %
-%                                                                             %
-%                                                                             %
-%                                                                             %
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%
-%  GetValueFromHashmap() gets an entry from the hash-map by its key.
-%
-%  The format of the GetValueFromHashmap method is:
-%
-%      void *GetValueFromHashmap(HashmapInfo *hashmap_info,const void *key)
-%
-%  A description of each parameter follows:
-%
-%    o hashmap_info: the hashmap info.
-%
-%    o key: the key.
-%
-*/
-MagickExport void *GetValueFromHashmap(HashmapInfo *hashmap_info,
-  const void *key)
-{
-  LinkedListInfo
-    *list_info;
-
-  register EntryInfo
-    *entry;
-
-  size_t
-    hash;
-
-  void
-    *value;
-
-  assert(hashmap_info != (HashmapInfo *) NULL);
-  assert(hashmap_info->signature == MagickCoreSignature);
-  if (key == (const void *) NULL)
-    return((void *) NULL);
-  LockSemaphoreInfo(hashmap_info->semaphore);
-  hash=hashmap_info->hash(key);
-  list_info=hashmap_info->map[hash % hashmap_info->capacity];
-  if (list_info != (LinkedListInfo *) NULL)
-    {
-      list_info->next=list_info->head;
-      entry=(EntryInfo *) GetNextValueInLinkedList(list_info);
-      while (entry != (EntryInfo *) NULL)
-      {
-        if (entry->hash == hash)
-          {
-            MagickBooleanType
-              compare;
-
-            compare=MagickTrue;
-            if (hashmap_info->compare !=
-                (MagickBooleanType (*)(const void *,const void *)) NULL)
-              compare=hashmap_info->compare(key,entry->key);
-            if (IfMagickTrue(compare))
-              {
-                value=entry->value;
-                UnlockSemaphoreInfo(hashmap_info->semaphore);
-                return(value);
-              }
-          }
-        entry=(EntryInfo *) GetNextValueInLinkedList(list_info);
-      }
-    }
-  UnlockSemaphoreInfo(hashmap_info->semaphore);
-  return((void *) NULL);
-}
-\f
-/*
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%                                                                             %
-%                                                                             %
-%                                                                             %
-%   G e t V a l u e F r o m L i n k e d L i s t                               %
-%                                                                             %
-%                                                                             %
-%                                                                             %
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%
-%  GetValueFromLinkedList() gets a value from the linked-list at the specified
-%  location.
-%
-%  The format of the GetValueFromLinkedList method is:
-%
-%      void *GetValueFromLinkedList(LinkedListInfo *list_info,
-%        const size_t index)
-%
-%  A description of each parameter follows:
-%
-%    o list_info: the linked_list info.
-%
-%    o index: the list index.
-%
-*/
-MagickExport void *GetValueFromLinkedList(LinkedListInfo *list_info,
-  const size_t index)
-{
-  register ElementInfo
-    *next;
-
-  register ssize_t
-    i;
-
-  void
-    *value;
-
-  assert(list_info != (LinkedListInfo *) NULL);
-  assert(list_info->signature == MagickCoreSignature);
-  if (index >= list_info->elements)
-    return((void *) NULL);
-  LockSemaphoreInfo(list_info->semaphore);
-  if (index == 0)
-    {
-      value=list_info->head->value;
-      UnlockSemaphoreInfo(list_info->semaphore);
-      return(value);
-    }
-  if (index == (list_info->elements-1))
-    {
-      value=list_info->tail->value;
-      UnlockSemaphoreInfo(list_info->semaphore);
-      return(value);
-    }
-  next=list_info->head;
-  for (i=0; i < (ssize_t) index; i++)
-    next=next->next;
-  value=next->value;
-  UnlockSemaphoreInfo(list_info->semaphore);
-  return(value);
-}
-\f
-/*
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%                                                                             %
-%                                                                             %
-%                                                                             %
-%   H a s h P o i n t e r T y p e                                             %
-%                                                                             %
-%                                                                             %
-%                                                                             %
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%
-%  HashPointerType() finds an entry in a hash-map based on the address of a
-%  pointer.
-%
-%  The format of the HashPointerType method is:
-%
-%      size_t HashPointerType(const void *pointer)
-%
-%  A description of each parameter follows:
-%
-%    o pointer: compute the hash entry location from this pointer address.
-%
-*/
-MagickExport size_t HashPointerType(const void *pointer)
-{
-  size_t
-    hash;
-
-  hash=(size_t) pointer;
-  hash+=(~(hash << 9));
-  hash^=(hash >> 14);
-  hash+=(hash << 4);
-  hash^=(hash >> 10);
-  return(hash);
-}
-\f
-/*
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%                                                                             %
-%                                                                             %
-%                                                                             %
-%   H a s h S t r i n g T y p e                                               %
-%                                                                             %
-%                                                                             %
-%                                                                             %
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%
-%  HashStringType() finds an entry in a hash-map based on the contents of a
-%  string.
-%
-%  The format of the HashStringType method is:
-%
-%      size_t HashStringType(const void *string)
-%
-%  A description of each parameter follows:
-%
-%    o string: compute the hash entry location from this string.
-%
-*/
-MagickExport size_t HashStringType(const void *string)
-{
-  const unsigned char
-    *digest;
-
-  register ssize_t
-    i;
-
-  SignatureInfo
-    *signature_info;
-
-  size_t
-    hash;
-
-  StringInfo
-    *signature;
-
-  signature_info=AcquireSignatureInfo();
-  signature=StringToStringInfo((const char *) string);
-  UpdateSignature(signature_info,signature);
-  FinalizeSignature(signature_info);
-  digest=GetStringInfoDatum(GetSignatureDigest(signature_info));
-  hash=0;
-  for (i=0; i < 8; i++)
-    hash^=digest[i];
-  signature=DestroyStringInfo(signature);
-  signature_info=DestroySignatureInfo(signature_info);
-  return(hash);
-}
-\f
-/*
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%                                                                             %
-%                                                                             %
-%                                                                             %
-%   H a s h S t r i n g I n f o T y p e                                       %
-%                                                                             %
-%                                                                             %
-%                                                                             %
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%
-%  Specify the HashStringInfoType() method in NewHashmap() to find an entry
-%  in a hash-map based on the contents of a string.
-%
-%  The format of the HashStringInfoType method is:
-%
-%      size_t HashStringInfoType(const void *string_info)
-%
-%  A description of each parameter follows:
-%
-%    o string_info: compute the hash entry location from this string.
-%
-*/
-MagickExport size_t HashStringInfoType(const void *string_info)
-{
-  const unsigned char
-    *digest;
-
-  register ssize_t
-    i;
-
-  SignatureInfo
-    *signature_info;
-
-  size_t
-    hash;
-
-  signature_info=AcquireSignatureInfo();
-  UpdateSignature(signature_info,(const StringInfo *) string_info);
-  FinalizeSignature(signature_info);
-  digest=GetStringInfoDatum(GetSignatureDigest(signature_info));
-  hash=0;
-  for (i=0; i < 8; i++)
-    hash^=digest[i];
-  signature_info=DestroySignatureInfo(signature_info);
-  return(hash);
-}
-\f
-/*
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%                                                                             %
-%                                                                             %
-%                                                                             %
-%   I n s e r t V a l u e I n L i n k e d L i s t                             %
-%                                                                             %
-%                                                                             %
-%                                                                             %
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%
-%  InsertValueInLinkedList() inserts an element in the linked-list at the
-%  specified location.
-%
-%  The format of the InsertValueInLinkedList method is:
-%
-%      MagickBooleanType InsertValueInLinkedList(ListInfo *list_info,
-%        const size_t index,const void *value)
-%
-%  A description of each parameter follows:
-%
-%    o list_info: the hashmap info.
-%
-%    o index: the index.
-%
-%    o value: the value.
-%
-*/
-MagickExport MagickBooleanType InsertValueInLinkedList(
-  LinkedListInfo *list_info,const size_t index,const void *value)
-{
-  register ElementInfo
-    *next;
-
-  register ssize_t
-    i;
-
-  assert(list_info != (LinkedListInfo *) NULL);
-  assert(list_info->signature == MagickCoreSignature);
-  if (value == (const void *) NULL)
-    return(MagickFalse);
-  if ((index > list_info->elements) ||
-      (list_info->elements == list_info->capacity))
-    return(MagickFalse);
-  next=(ElementInfo *) AcquireMagickMemory(sizeof(*next));
-  if (next == (ElementInfo *) NULL)
-    return(MagickFalse);
-  next->value=(void *) value;
-  next->next=(ElementInfo *) NULL;
-  LockSemaphoreInfo(list_info->semaphore);
-  if (list_info->elements == 0)
-    {
-      if (list_info->next == (ElementInfo *) NULL)
-        list_info->next=next;
-      list_info->head=next;
-      list_info->tail=next;
-    }
-  else
-    {
-      if (index == 0)
-        {
-          if (list_info->next == list_info->head)
-            list_info->next=next;
-          next->next=list_info->head;
-          list_info->head=next;
-        }
-      else
-        if (index == list_info->elements)
-          {
-            if (list_info->next == (ElementInfo *) NULL)
-              list_info->next=next;
-            list_info->tail->next=next;
-            list_info->tail=next;
-          }
-        else
-          {
-            ElementInfo
-              *element;
-
-            element=list_info->head;
-            next->next=element->next;
-            for (i=1; i < (ssize_t) index; i++)
-            {
-              element=element->next;
-              next->next=element->next;
-            }
-            next=next->next;
-            element->next=next;
-            if (list_info->next == next->next)
-              list_info->next=next;
-          }
-    }
-  list_info->elements++;
-  UnlockSemaphoreInfo(list_info->semaphore);
-  return(MagickTrue);
-}
-\f
-/*
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%                                                                             %
-%                                                                             %
-%                                                                             %
-%   I n s e r t V a l u e I n S o r t e d L i n k e d L i s t                 %
-%                                                                             %
-%                                                                             %
-%                                                                             %
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%
-%  InsertValueInSortedLinkedList() inserts a value in the sorted linked-list.
-%
-%  The format of the InsertValueInSortedLinkedList method is:
-%
-%      MagickBooleanType InsertValueInSortedLinkedList(ListInfo *list_info,
-%        int (*compare)(const void *,const void *),void **replace,
-%        const void *value)
-%
-%  A description of each parameter follows:
-%
-%    o list_info: the hashmap info.
-%
-%    o index: the index.
-%
-%    o compare: the compare method.
-%
-%    o replace: return previous element here.
-%
-%    o value: the value.
-%
-*/
-MagickExport MagickBooleanType InsertValueInSortedLinkedList(
-  LinkedListInfo *list_info,int (*compare)(const void *,const void *),
-  void **replace,const void *value)
-{
-  ElementInfo
-    *element;
-
-  register ElementInfo
-    *next;
-
-  register ssize_t
-    i;
-
-  assert(list_info != (LinkedListInfo *) NULL);
-  assert(list_info->signature == MagickCoreSignature);
-  if ((compare == (int (*)(const void *,const void *)) NULL) ||
-      (value == (const void *) NULL))
-    return(MagickFalse);
-  if (list_info->elements == list_info->capacity)
-    return(MagickFalse);
-  next=(ElementInfo *) AcquireMagickMemory(sizeof(*next));
-  if (next == (ElementInfo *) NULL)
-    return(MagickFalse);
-  next->value=(void *) value;
-  element=(ElementInfo *) NULL;
-  LockSemaphoreInfo(list_info->semaphore);
-  next->next=list_info->head;
-  while (next->next != (ElementInfo *) NULL)
-  {
-    i=(ssize_t) compare(value,next->next->value);
-    if ((i < 0) || ((replace != (void **) NULL) && (i == 0)))
-      {
-        if (i == 0)
-          {
-            *replace=next->next->value;
-            next->next=next->next->next;
-            if (element != (ElementInfo *) NULL)
-              element->next=(ElementInfo *) RelinquishMagickMemory(
-                element->next);
-            list_info->elements--;
-          }
-        if (element != (ElementInfo *) NULL)
-          element->next=next;
-        else
-          list_info->head=next;
-        break;
-      }
-    element=next->next;
-    next->next=next->next->next;
-  }
-  if (next->next == (ElementInfo *) NULL)
-    {
-      if (element != (ElementInfo *) NULL)
-        element->next=next;
-      else
-        list_info->head=next;
-      list_info->tail=next;
-    }
-  list_info->elements++;
-  UnlockSemaphoreInfo(list_info->semaphore);
-  return(MagickTrue);
-}
-\f
-/*
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%                                                                             %
-%                                                                             %
-%                                                                             %
-%   I s H a s h m a p E m p t y                                               %
-%                                                                             %
-%                                                                             %
-%                                                                             %
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%
-%  IsHashmapEmpty() returns MagickTrue if the hash-map is empty.
-%
-%  The format of the IsHashmapEmpty method is:
-%
-%      MagickBooleanType IsHashmapEmpty(const HashmapInfo *hashmap_info)
-%
-%  A description of each parameter follows:
-%
-%    o hashmap_info: the hashmap info.
-%
-*/
-MagickExport MagickBooleanType IsHashmapEmpty(const HashmapInfo *hashmap_info)
-{
-  assert(hashmap_info != (HashmapInfo *) NULL);
-  assert(hashmap_info->signature == MagickCoreSignature);
-  return(hashmap_info->entries == 0 ? MagickTrue : MagickFalse);
-}
-\f
-/*
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%                                                                             %
-%                                                                             %
-%                                                                             %
-%   I s L i n k e d L i s t E m p t y                                         %
-%                                                                             %
-%                                                                             %
-%                                                                             %
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%
-%  IsLinkedListEmpty() returns MagickTrue if the linked-list is empty.
-%
-%  The format of the IsLinkedListEmpty method is:
-%
-%      MagickBooleanType IsLinkedListEmpty(LinkedListInfo *list_info)
-%
-%  A description of each parameter follows:
-%
-%    o list_info: the linked-list info.
-%
-*/
-MagickExport MagickBooleanType IsLinkedListEmpty(
-  const LinkedListInfo *list_info)
-{
-  assert(list_info != (LinkedListInfo *) NULL);
-  assert(list_info->signature == MagickCoreSignature);
-  return(list_info->elements == 0 ? MagickTrue : MagickFalse);
-}
-\f
-/*
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%                                                                             %
-%                                                                             %
-%                                                                             %
-%   L i n k e d L i s t T o A r r a y                                         %
-%                                                                             %
-%                                                                             %
-%                                                                             %
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%
-%  LinkedListToArray() converts the linked-list to an array.
-%
-%  The format of the LinkedListToArray method is:
-%
-%      MagickBooleanType LinkedListToArray(LinkedListInfo *list_info,
-%        void **array)
-%
-%  A description of each parameter follows:
-%
-%    o list_info: the linked-list info.
-%
-%    o array: the array.
-%
-*/
-MagickExport MagickBooleanType LinkedListToArray(LinkedListInfo *list_info,
-  void **array)
-{
-  register ElementInfo
-    *next;
-
-  register ssize_t
-    i;
-
-  assert(list_info != (LinkedListInfo *) NULL);
-  assert(list_info->signature == MagickCoreSignature);
-  if (array == (void **) NULL)
-    return(MagickFalse);
-  LockSemaphoreInfo(list_info->semaphore);
-  next=list_info->head;
-  for (i=0; next != (ElementInfo *) NULL; i++)
-  {
-    array[i]=next->value;
-    next=next->next;
-  }
-  UnlockSemaphoreInfo(list_info->semaphore);
-  return(MagickTrue);
-}
-\f
-/*
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%                                                                             %
-%                                                                             %
-%                                                                             %
-%   N e w H a s h m a p                                                       %
-%                                                                             %
-%                                                                             %
-%                                                                             %
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%
-%  NewHashmap() returns a pointer to a HashmapInfo structure initialized
-%  to default values.  The capacity is an initial estimate.  The hashmap will
-%  increase capacity dynamically as the demand requires.
-%
-%  The format of the NewHashmap method is:
-%
-%      HashmapInfo *NewHashmap(const size_t capacity,
-%        size_t (*hash)(const void *),
-%        MagickBooleanType (*compare)(const void *,const void *),
-%        void *(*relinquish_key)(void *),void *(*relinquish_value)(void *))
-%
-%  A description of each parameter follows:
-%
-%    o capacity: the initial number entries in the hash-map: typically
-%      SmallHashmapSize, MediumHashmapSize, or LargeHashmapSize.  The
-%      hashmap will dynamically increase its capacity on demand.
-%
-%    o hash: the hash method, typically HashPointerType(), HashStringType(),
-%      or HashStringInfoType().
-%
-%    o compare: the compare method, typically NULL, CompareHashmapString(),
-%      or CompareHashmapStringInfo().
-%
-%    o relinquish_key: the key deallocation method, typically
-%      RelinquishMagickMemory(), called whenever a key is removed from the
-%      hash-map.
-%
-%    o relinquish_value: the value deallocation method;  typically
-%      RelinquishMagickMemory(), called whenever a value object is removed from
-%      the hash-map.
-%
-*/
-MagickExport HashmapInfo *NewHashmap(const size_t capacity,
-  size_t (*hash)(const void *),
-  MagickBooleanType (*compare)(const void *,const void *),
-  void *(*relinquish_key)(void *),void *(*relinquish_value)(void *))
-{
-  HashmapInfo
-    *hashmap_info;
-
-  hashmap_info=(HashmapInfo *) AcquireMagickMemory(sizeof(*hashmap_info));
-  if (hashmap_info == (HashmapInfo *) NULL)
-    ThrowFatalException(ResourceLimitFatalError,"MemoryAllocationFailed");
-  (void) ResetMagickMemory(hashmap_info,0,sizeof(*hashmap_info));
-  hashmap_info->hash=HashPointerType;
-  if (hash != (size_t (*)(const void *)) NULL)
-    hashmap_info->hash=hash;
-  hashmap_info->compare=(MagickBooleanType (*)(const void *,const void *)) NULL;
-  if (compare != (MagickBooleanType (*)(const void *,const void *)) NULL)
-    hashmap_info->compare=compare;
-  hashmap_info->relinquish_key=relinquish_key;
-  hashmap_info->relinquish_value=relinquish_value;
-  hashmap_info->entries=0;
-  hashmap_info->capacity=capacity;
-  hashmap_info->map=(LinkedListInfo **) NULL;
-  if (~capacity >= 1UL)
-    hashmap_info->map=(LinkedListInfo **) AcquireQuantumMemory((size_t)
-      capacity+1UL,sizeof(*hashmap_info->map));
-  if (hashmap_info->map == (LinkedListInfo **) NULL)
-    ThrowFatalException(ResourceLimitFatalError,"MemoryAllocationFailed");
-  (void) ResetMagickMemory(hashmap_info->map,0,(size_t) capacity*
-    sizeof(*hashmap_info->map));
-  hashmap_info->semaphore=AcquireSemaphoreInfo();
-  hashmap_info->signature=MagickCoreSignature;
-  return(hashmap_info);
-}
-\f
-/*
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%                                                                             %
-%                                                                             %
-%                                                                             %
-%   N e w L i n k e d L i s t I n f o                                         %
-%                                                                             %
-%                                                                             %
-%                                                                             %
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%
-%  NewLinkedList() returns a pointer to a LinkedListInfo structure
-%  initialized to default values.
-%
-%  The format of the NewLinkedList method is:
-%
-%      LinkedListInfo *NewLinkedList(const size_t capacity)
-%
-%  A description of each parameter follows:
-%
-%    o capacity: the maximum number of elements in the list.
-%
-*/
-MagickExport LinkedListInfo *NewLinkedList(const size_t capacity)
-{
-  LinkedListInfo
-    *list_info;
-
-  list_info=(LinkedListInfo *) AcquireMagickMemory(sizeof(*list_info));
-  if (list_info == (LinkedListInfo *) NULL)
-    ThrowFatalException(ResourceLimitFatalError,"MemoryAllocationFailed");
-  (void) ResetMagickMemory(list_info,0,sizeof(*list_info));
-  list_info->capacity=capacity == 0 ? (size_t) (~0) : capacity;
-  list_info->elements=0;
-  list_info->head=(ElementInfo *) NULL;
-  list_info->tail=(ElementInfo *) NULL;
-  list_info->next=(ElementInfo *) NULL;
-  list_info->semaphore=AcquireSemaphoreInfo();
-  list_info->signature=MagickCoreSignature;
-  return(list_info);
-}
-\f
-/*
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%                                                                             %
-%                                                                             %
-%                                                                             %
-%   P u t E n t r y I n H a s h m a p                                         %
-%                                                                             %
-%                                                                             %
-%                                                                             %
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%
-%  PutEntryInHashmap() puts an entry in the hash-map.  If the key already
-%  exists in the map it is first removed.
-%
-%  The format of the PutEntryInHashmap method is:
-%
-%      MagickBooleanType PutEntryInHashmap(HashmapInfo *hashmap_info,
-%        const void *key,const void *value)
-%
-%  A description of each parameter follows:
-%
-%    o hashmap_info: the hashmap info.
-%
-%    o key: the key.
-%
-%    o value: the value.
-%
-*/
-
-static MagickBooleanType IncreaseHashmapCapacity(HashmapInfo *hashmap_info)
-{
-#define MaxCapacities  20
-
-  const size_t
-    capacities[MaxCapacities] =
-    {
-      17, 31, 61, 131, 257, 509, 1021, 2053, 4099, 8191, 16381, 32771,
-      65537, 131071, 262147, 524287, 1048573, 2097143, 4194301, 8388617
-    };
-
-  ElementInfo
-    *element;
-
-  EntryInfo
-    *entry;
-
-  LinkedListInfo
-    *map_info,
-    **map;
-
-  register ElementInfo
-    *next;
-
-  register ssize_t
-    i;
-
-  size_t
-    capacity;
-
-  /*
-    Increase to the next prime capacity.
-  */
-  for (i=0; i < MaxCapacities; i++)
-    if (hashmap_info->capacity < capacities[i])
-      break;
-  if (i >= (MaxCapacities-1))
-    return(MagickFalse);
-  capacity=capacities[i+1];
-  map=(LinkedListInfo **) AcquireQuantumMemory((size_t) capacity+1UL,
-    sizeof(*map));
-  if (map == (LinkedListInfo **) NULL)
-    return(MagickFalse);
-  (void) ResetMagickMemory(map,0,(size_t) capacity*sizeof(*map));
-  /*
-    Copy entries to new hashmap with increased capacity.
-  */
-  for (i=0; i < (ssize_t) hashmap_info->capacity; i++)
-  {
-    LinkedListInfo
-      *list_info;
-
-    list_info=hashmap_info->map[i];
-    if (list_info == (LinkedListInfo *) NULL)
-      continue;
-    LockSemaphoreInfo(list_info->semaphore);
-    for (next=list_info->head; next != (ElementInfo *) NULL; )
-    {
-      element=next;
-      next=next->next;
-      entry=(EntryInfo *) element->value;
-      map_info=map[entry->hash % capacity];
-      if (map_info == (LinkedListInfo *) NULL)
-        {
-          map_info=NewLinkedList(0);
-          map[entry->hash % capacity]=map_info;
-        }
-      map_info->next=element;
-      element->next=map_info->head;
-      map_info->head=element;
-      map_info->elements++;
-    }
-    list_info->signature=(~MagickCoreSignature);
-    UnlockSemaphoreInfo(list_info->semaphore);
-    RelinquishSemaphoreInfo(&list_info->semaphore);
-    list_info=(LinkedListInfo *) RelinquishMagickMemory(list_info);
-  }
-  hashmap_info->map=(LinkedListInfo **) RelinquishMagickMemory(
-    hashmap_info->map);
-  hashmap_info->map=map;
-  hashmap_info->capacity=capacity;
-  return(MagickTrue);
-}
-
-MagickExport MagickBooleanType PutEntryInHashmap(HashmapInfo *hashmap_info,
-  const void *key,const void *value)
-{
-  EntryInfo
-    *entry,
-    *next;
-
-  LinkedListInfo
-    *list_info;
-
-  register size_t
-    i;
-
-  assert(hashmap_info != (HashmapInfo *) NULL);
-  assert(hashmap_info->signature == MagickCoreSignature);
-  if ((key == (void *) NULL) || (value == (void *) NULL))
-    return(MagickFalse);
-  next=(EntryInfo *) AcquireMagickMemory(sizeof(*next));
-  if (next == (EntryInfo *) NULL)
-    return(MagickFalse);
-  LockSemaphoreInfo(hashmap_info->semaphore);
-  next->hash=hashmap_info->hash(key);
-  next->key=(void *) key;
-  next->value=(void *) value;
-  list_info=hashmap_info->map[next->hash % hashmap_info->capacity];
-  if (list_info == (LinkedListInfo *) NULL)
-    {
-      list_info=NewLinkedList(0);
-      hashmap_info->map[next->hash % hashmap_info->capacity]=list_info;
-    }
-  else
-    {
-      list_info->next=list_info->head;
-      entry=(EntryInfo *) GetNextValueInLinkedList(list_info);
-      for (i=0; entry != (EntryInfo *) NULL; i++)
-      {
-        if (entry->hash == next->hash)
-          {
-            MagickBooleanType
-              compare;
-
-            compare=MagickTrue;
-            if (hashmap_info->compare !=
-                (MagickBooleanType (*)(const void *,const void *)) NULL)
-              compare=hashmap_info->compare(key,entry->key);
-            if( IfMagickTrue(compare) )
-              {
-                (void) RemoveElementFromLinkedList(list_info,i);
-                if (hashmap_info->relinquish_key != (void *(*)(void *)) NULL)
-                  entry->key=hashmap_info->relinquish_key(entry->key);
-                if (hashmap_info->relinquish_value != (void *(*)(void *)) NULL)
-                  entry->value=hashmap_info->relinquish_value(entry->value);
-                entry=(EntryInfo *) RelinquishMagickMemory(entry);
-                break;
-              }
-          }
-        entry=(EntryInfo *) GetNextValueInLinkedList(list_info);
-      }
-    }
-  if (IfMagickFalse(InsertValueInLinkedList(list_info,0,next)))
-    {
-      next=(EntryInfo *) RelinquishMagickMemory(next);
-      UnlockSemaphoreInfo(hashmap_info->semaphore);
-      return(MagickFalse);
-    }
-  if (list_info->elements >= (hashmap_info->capacity-1))
-    if (IfMagickFalse(IncreaseHashmapCapacity(hashmap_info)))
-      {
-        UnlockSemaphoreInfo(hashmap_info->semaphore);
-        return(MagickFalse);
-      }
-  hashmap_info->entries++;
-  UnlockSemaphoreInfo(hashmap_info->semaphore);
-  return(MagickTrue);
-}
-\f
-/*
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%                                                                             %
-%                                                                             %
-%                                                                             %
-%   R e m o v e E l e m e n t B y V a l u e F r o m L i n k e d L i s t       %
-%                                                                             %
-%                                                                             %
-%                                                                             %
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%
-%  RemoveElementByValueFromLinkedList() removes an element from the linked-list
-%  by value.
-%
-%  The format of the RemoveElementByValueFromLinkedList method is:
-%
-%      void *RemoveElementByValueFromLinkedList(LinkedListInfo *list_info,
-%        const void *value)
-%
-%  A description of each parameter follows:
-%
-%    o list_info: the list info.
-%
-%    o value: the value.
-%
-*/
-MagickExport void *RemoveElementByValueFromLinkedList(LinkedListInfo *list_info,
-  const void *value)
-{
-  ElementInfo
-    *next;
-
-  assert(list_info != (LinkedListInfo *) NULL);
-  assert(list_info->signature == MagickCoreSignature);
-  if ((list_info->elements == 0) || (value == (const void *) NULL))
-    return((void *) NULL);
-  LockSemaphoreInfo(list_info->semaphore);
-  if (value == list_info->head->value)
-    {
-      if (list_info->next == list_info->head)
-        list_info->next=list_info->head->next;
-      next=list_info->head;
-      list_info->head=list_info->head->next;
-      next=(ElementInfo *) RelinquishMagickMemory(next);
-    }
-  else
-    {
-      ElementInfo
-        *element;
-
-      next=list_info->head;
-      while ((next->next != (ElementInfo *) NULL) &&
-             (next->next->value != value))
-        next=next->next;
-      if (next->next == (ElementInfo *) NULL)
-        {
-          UnlockSemaphoreInfo(list_info->semaphore);
-          return((void *) NULL);
-        }
-      element=next->next;
-      next->next=element->next;
-      if (element == list_info->tail)
-        list_info->tail=next;
-      if (list_info->next == element)
-        list_info->next=element->next;
-      element=(ElementInfo *) RelinquishMagickMemory(element);
-    }
-  list_info->elements--;
-  UnlockSemaphoreInfo(list_info->semaphore);
-  return((void *) value);
-}
-\f
-/*
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%                                                                             %
-%                                                                             %
-%                                                                             %
-%   R e m o v e E l e m e n t F r o m L i n k e d L i s t                     %
-%                                                                             %
-%                                                                             %
-%                                                                             %
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%
-%  RemoveElementFromLinkedList() removes an element from the linked-list at the
-%  specified location.
-%
-%  The format of the RemoveElementFromLinkedList method is:
-%
-%      void *RemoveElementFromLinkedList(LinkedListInfo *list_info,
-%        const size_t index)
-%
-%  A description of each parameter follows:
-%
-%    o list_info: the linked-list info.
-%
-%    o index: the index.
-%
-*/
-MagickExport void *RemoveElementFromLinkedList(LinkedListInfo *list_info,
-  const size_t index)
-{
-  ElementInfo
-    *next;
-
-  register ssize_t
-    i;
-
-  void
-    *value;
-
-  assert(list_info != (LinkedListInfo *) NULL);
-  assert(list_info->signature == MagickCoreSignature);
-  if (index >= list_info->elements)
-    return((void *) NULL);
-  LockSemaphoreInfo(list_info->semaphore);
-  if (index == 0)
-    {
-      if (list_info->next == list_info->head)
-        list_info->next=list_info->head->next;
-      value=list_info->head->value;
-      next=list_info->head;
-      list_info->head=list_info->head->next;
-      next=(ElementInfo *) RelinquishMagickMemory(next);
-    }
-  else
-    {
-      ElementInfo
-        *element;
-
-      next=list_info->head;
-      for (i=1; i < (ssize_t) index; i++)
-        next=next->next;
-      element=next->next;
-      next->next=element->next;
-      if (element == list_info->tail)
-        list_info->tail=next;
-      if (list_info->next == element)
-        list_info->next=element->next;
-      value=element->value;
-      element=(ElementInfo *) RelinquishMagickMemory(element);
-    }
-  list_info->elements--;
-  UnlockSemaphoreInfo(list_info->semaphore);
-  return(value);
-}
-\f
-/*
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%                                                                             %
-%                                                                             %
-%                                                                             %
-%   R e m o v e E n t r y F r o m H a s h m a p                               %
-%                                                                             %
-%                                                                             %
-%                                                                             %
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%
-%  RemoveEntryFromHashmap() removes an entry from the hash-map by its key.
-%
-%  The format of the RemoveEntryFromHashmap method is:
-%
-%      void *RemoveEntryFromHashmap(HashmapInfo *hashmap_info,void *key)
-%
-%  A description of each parameter follows:
-%
-%    o hashmap_info: the hashmap info.
-%
-%    o key: the key.
-%
-*/
-MagickExport void *RemoveEntryFromHashmap(HashmapInfo *hashmap_info,
-  const void *key)
-{
-  EntryInfo
-    *entry;
-
-  LinkedListInfo
-    *list_info;
-
-  register size_t
-    i;
-
-  size_t
-    hash;
-
-  void
-    *value;
-
-  assert(hashmap_info != (HashmapInfo *) NULL);
-  assert(hashmap_info->signature == MagickCoreSignature);
-  if (key == (const void *) NULL)
-    return((void *) NULL);
-  LockSemaphoreInfo(hashmap_info->semaphore);
-  hash=hashmap_info->hash(key);
-  list_info=hashmap_info->map[hash % hashmap_info->capacity];
-  if (list_info != (LinkedListInfo *) NULL)
-    {
-      list_info->next=list_info->head;
-      entry=(EntryInfo *) GetNextValueInLinkedList(list_info);
-      for (i=0; entry != (EntryInfo *) NULL; i++)
-      {
-        if (entry->hash == hash)
-          {
-            MagickBooleanType
-              compare;
-
-            compare=MagickTrue;
-            if (hashmap_info->compare !=
-                (MagickBooleanType (*)(const void *,const void *)) NULL)
-              compare=hashmap_info->compare(key,entry->key);
-            if( IfMagickTrue(compare) )
-              {
-                entry=(EntryInfo *) RemoveElementFromLinkedList(list_info,i);
-                if (entry == (EntryInfo *) NULL)
-                  {
-                    UnlockSemaphoreInfo(hashmap_info->semaphore);
-                    return((void *) NULL);
-                  }
-                if (hashmap_info->relinquish_key != (void *(*)(void *)) NULL)
-                  entry->key=hashmap_info->relinquish_key(entry->key);
-                value=entry->value;
-                entry=(EntryInfo *) RelinquishMagickMemory(entry);
-                hashmap_info->entries--;
-                UnlockSemaphoreInfo(hashmap_info->semaphore);
-                return(value);
-              }
-          }
-        entry=(EntryInfo *) GetNextValueInLinkedList(list_info);
-      }
-    }
-  UnlockSemaphoreInfo(hashmap_info->semaphore);
-  return((void *) NULL);
-}
-\f
-/*
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%                                                                             %
-%                                                                             %
-%                                                                             %
-%   R e m o v e L a s t E l e m e n t F r o m L i n k e d L i s t             %
-%                                                                             %
-%                                                                             %
-%                                                                             %
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%
-%  RemoveLastElementFromLinkedList() removes the last element from the
-%  linked-list.
-%
-%  The format of the RemoveLastElementFromLinkedList method is:
-%
-%      void *RemoveLastElementFromLinkedList(LinkedListInfo *list_info)
-%
-%  A description of each parameter follows:
-%
-%    o list_info: the linked-list info.
-%
-*/
-MagickExport void *RemoveLastElementFromLinkedList(LinkedListInfo *list_info)
-{
-  void
-    *value;
-
-  assert(list_info != (LinkedListInfo *) NULL);
-  assert(list_info->signature == MagickCoreSignature);
-  if (list_info->elements == 0)
-    return((void *) NULL);
-  LockSemaphoreInfo(list_info->semaphore);
-  if (list_info->next == list_info->tail)
-    list_info->next=(ElementInfo *) NULL;
-  if (list_info->elements == 1UL)
-    {
-      value=list_info->head->value;
-      list_info->head=(ElementInfo *) NULL;
-      list_info->tail=(ElementInfo *) RelinquishMagickMemory(list_info->tail);
-    }
-  else
-    {
-      ElementInfo
-        *next;
-
-      value=list_info->tail->value;
-      next=list_info->head;
-      while (next->next != list_info->tail)
-        next=next->next;
-      list_info->tail=(ElementInfo *) RelinquishMagickMemory(list_info->tail);
-      list_info->tail=next;
-      next->next=(ElementInfo *) NULL;
-    }
-  list_info->elements--;
-  UnlockSemaphoreInfo(list_info->semaphore);
-  return(value);
-}
-\f
-/*
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%                                                                             %
-%                                                                             %
-%                                                                             %
-%   R e s e t H a s h m a p I t e r a t o r                                   %
-%                                                                             %
-%                                                                             %
-%                                                                             %
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%
-%  ResetHashmapIterator() resets the hash-map iterator.  Use it in conjunction
-%  with GetNextKeyInHashmap() to iterate over all the keys in the hash-map.
-%
-%  The format of the ResetHashmapIterator method is:
-%
-%      ResetHashmapIterator(HashmapInfo *hashmap_info)
-%
-%  A description of each parameter follows:
-%
-%    o hashmap_info: the hashmap info.
-%
-*/
-MagickExport void ResetHashmapIterator(HashmapInfo *hashmap_info)
-{
-  assert(hashmap_info != (HashmapInfo *) NULL);
-  assert(hashmap_info->signature == MagickCoreSignature);
-  LockSemaphoreInfo(hashmap_info->semaphore);
-  hashmap_info->next=0;
-  hashmap_info->head_of_list=MagickFalse;
-  UnlockSemaphoreInfo(hashmap_info->semaphore);
-}
-\f
-/*
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%                                                                             %
-%                                                                             %
-%                                                                             %
-%   R e s e t L i n k e d L i s t I t e r a t o r                             %
-%                                                                             %
-%                                                                             %
-%                                                                             %
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%
-%  ResetLinkedListIterator() resets the lined-list iterator.  Use it in
-%  conjunction with GetNextValueInLinkedList() to iterate over all the values
-%  in the linked-list.
-%
-%  The format of the ResetLinkedListIterator method is:
-%
-%      ResetLinkedListIterator(LinkedListInfo *list_info)
-%
-%  A description of each parameter follows:
-%
-%    o list_info: the linked-list info.
-%
-*/
-MagickExport void ResetLinkedListIterator(LinkedListInfo *list_info)
-{
-  assert(list_info != (LinkedListInfo *) NULL);
-  assert(list_info->signature == MagickCoreSignature);
-  LockSemaphoreInfo(list_info->semaphore);
-  list_info->next=list_info->head;
-  UnlockSemaphoreInfo(list_info->semaphore);
-}
+  return(CompareStringInfo(p,q) == 0 ? MagickTrue : MagickFalse);\r
+}\r
+\f\r
+/*\r
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\r
+%                                                                             %\r
+%                                                                             %\r
+%                                                                             %\r
+%   D e s t r o y H a s h m a p                                               %\r
+%                                                                             %\r
+%                                                                             %\r
+%                                                                             %\r
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\r
+%\r
+%  DestroyHashmap() frees the hash-map and all associated resources.\r
+%\r
+%  The format of the DestroyHashmap method is:\r
+%\r
+%      HashmapInfo *DestroyHashmap(HashmapInfo *hashmap_info)\r
+%\r
+%  A description of each parameter follows:\r
+%\r
+%    o hashmap_info: the hashmap info.\r
+%\r
+*/\r
+MagickExport HashmapInfo *DestroyHashmap(HashmapInfo *hashmap_info)\r
+{\r
+  LinkedListInfo\r
+    *list_info;\r
+\r
+  register EntryInfo\r
+    *entry;\r
+\r
+  register ssize_t\r
+    i;\r
+\r
+  assert(hashmap_info != (HashmapInfo *) NULL);\r
+  assert(hashmap_info->signature == MagickCoreSignature);\r
+  LockSemaphoreInfo(hashmap_info->semaphore);\r
+  for (i=0; i < (ssize_t) hashmap_info->capacity; i++)\r
+  {\r
+    list_info=hashmap_info->map[i];\r
+    if (list_info != (LinkedListInfo *) NULL)\r
+      {\r
+        list_info->next=list_info->head;\r
+        entry=(EntryInfo *) GetNextValueInLinkedList(list_info);\r
+        while (entry != (EntryInfo *) NULL)\r
+        {\r
+          if (hashmap_info->relinquish_key != (void *(*)(void *)) NULL)\r
+            entry->key=hashmap_info->relinquish_key(entry->key);\r
+          if (hashmap_info->relinquish_value != (void *(*)(void *)) NULL)\r
+            entry->value=hashmap_info->relinquish_value(entry->value);\r
+          entry=(EntryInfo *) GetNextValueInLinkedList(list_info);\r
+        }\r
+      }\r
+    if (list_info != (LinkedListInfo *) NULL)\r
+      list_info=DestroyLinkedList(list_info,RelinquishMagickMemory);\r
+  }\r
+  hashmap_info->map=(LinkedListInfo **) RelinquishMagickMemory(\r
+    hashmap_info->map);\r
+  hashmap_info->signature=(~MagickCoreSignature);\r
+  UnlockSemaphoreInfo(hashmap_info->semaphore);\r
+  RelinquishSemaphoreInfo(&hashmap_info->semaphore);\r
+  hashmap_info=(HashmapInfo *) RelinquishMagickMemory(hashmap_info);\r
+  return(hashmap_info);\r
+}\r
+\f\r
+/*\r
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\r
+%                                                                             %\r
+%                                                                             %\r
+%                                                                             %\r
+%   D e s t r o y L i n k e d L i s t                                         %\r
+%                                                                             %\r
+%                                                                             %\r
+%                                                                             %\r
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\r
+%\r
+%  DestroyLinkedList() frees the linked-list and all associated resources.\r
+%\r
+%  The format of the DestroyLinkedList method is:\r
+%\r
+%      LinkedListInfo *DestroyLinkedList(LinkedListInfo *list_info,\r
+%        void *(*relinquish_value)(void *))\r
+%\r
+%  A description of each parameter follows:\r
+%\r
+%    o list_info: the linked-list info.\r
+%\r
+%    o relinquish_value: the value deallocation method;  typically\r
+%      RelinquishMagickMemory().\r
+%\r
+*/\r
+MagickExport LinkedListInfo *DestroyLinkedList(LinkedListInfo *list_info,\r
+  void *(*relinquish_value)(void *))\r
+{\r
+  ElementInfo\r
+    *entry;\r
+\r
+  register ElementInfo\r
+    *next;\r
+\r
+  assert(list_info != (LinkedListInfo *) NULL);\r
+  assert(list_info->signature == MagickCoreSignature);\r
+  LockSemaphoreInfo(list_info->semaphore);\r
+  for (next=list_info->head; next != (ElementInfo *) NULL; )\r
+  {\r
+    if (relinquish_value != (void *(*)(void *)) NULL)\r
+      next->value=relinquish_value(next->value);\r
+    entry=next;\r
+    next=next->next;\r
+    entry=(ElementInfo *) RelinquishMagickMemory(entry);\r
+  }\r
+  list_info->signature=(~MagickCoreSignature);\r
+  UnlockSemaphoreInfo(list_info->semaphore);\r
+  RelinquishSemaphoreInfo(&list_info->semaphore);\r
+  list_info=(LinkedListInfo *) RelinquishMagickMemory(list_info);\r
+  return(list_info);\r
+}\r
+\f\r
+/*\r
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\r
+%                                                                             %\r
+%                                                                             %\r
+%                                                                             %\r
+%   G e t L a s t V a l u e I n L i n k e d L i s t                           %\r
+%                                                                             %\r
+%                                                                             %\r
+%                                                                             %\r
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\r
+%\r
+%  GetLastValueInLinkedList() gets the last value in the linked-list.\r
+%\r
+%  The format of the GetLastValueInLinkedList method is:\r
+%\r
+%      void *GetLastValueInLinkedList(LinkedListInfo *list_info)\r
+%\r
+%  A description of each parameter follows:\r
+%\r
+%    o list_info: the linked_list info.\r
+%\r
+*/\r
+MagickExport void *GetLastValueInLinkedList(LinkedListInfo *list_info)\r
+{\r
+  void\r
+    *value;\r
+\r
+  assert(list_info != (LinkedListInfo *) NULL);\r
+  assert(list_info->signature == MagickCoreSignature);\r
+  if (list_info->elements == 0)\r
+    return((void *) NULL);\r
+  LockSemaphoreInfo(list_info->semaphore);\r
+  value=list_info->tail->value;\r
+  UnlockSemaphoreInfo(list_info->semaphore);\r
+  return(value);\r
+}\r
+\f\r
+/*\r
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\r
+%                                                                             %\r
+%                                                                             %\r
+%                                                                             %\r
+%   G e t N e x t K e y I n H a s h m a p                                     %\r
+%                                                                             %\r
+%                                                                             %\r
+%                                                                             %\r
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\r
+%\r
+%  GetNextKeyInHashmap() gets the next key in the hash-map.\r
+%\r
+%  The format of the GetNextKeyInHashmap method is:\r
+%\r
+%      void *GetNextKeyInHashmap(HashmapInfo *hashmap_info)\r
+%\r
+%  A description of each parameter follows:\r
+%\r
+%    o hashmap_info: the hashmap info.\r
+%\r
+*/\r
+MagickExport void *GetNextKeyInHashmap(HashmapInfo *hashmap_info)\r
+{\r
+  LinkedListInfo\r
+    *list_info;\r
+\r
+  register EntryInfo\r
+    *entry;\r
+\r
+  void\r
+    *key;\r
+\r
+  assert(hashmap_info != (HashmapInfo *) NULL);\r
+  assert(hashmap_info->signature == MagickCoreSignature);\r
+  LockSemaphoreInfo(hashmap_info->semaphore);\r
+  while (hashmap_info->next < hashmap_info->capacity)\r
+  {\r
+    list_info=hashmap_info->map[hashmap_info->next];\r
+    if (list_info != (LinkedListInfo *) NULL)\r
+      {\r
+        if (IfMagickFalse(hashmap_info->head_of_list))\r
+          {\r
+            list_info->next=list_info->head;\r
+            hashmap_info->head_of_list=MagickTrue;\r
+          }\r
+        entry=(EntryInfo *) GetNextValueInLinkedList(list_info);\r
+        if (entry != (EntryInfo *) NULL)\r
+          {\r
+            key=entry->key;\r
+            UnlockSemaphoreInfo(hashmap_info->semaphore);\r
+            return(key);\r
+          }\r
+        hashmap_info->head_of_list=MagickFalse;\r
+      }\r
+    hashmap_info->next++;\r
+  }\r
+  UnlockSemaphoreInfo(hashmap_info->semaphore);\r
+  return((void *) NULL);\r
+}\r
+\f\r
+/*\r
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\r
+%                                                                             %\r
+%                                                                             %\r
+%                                                                             %\r
+%   G e t N e x t V a l u e I n H a s h m a p                                 %\r
+%                                                                             %\r
+%                                                                             %\r
+%                                                                             %\r
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\r
+%\r
+%  GetNextValueInHashmap() gets the next value in the hash-map.\r
+%\r
+%  The format of the GetNextValueInHashmap method is:\r
+%\r
+%      void *GetNextValueInHashmap(HashmapInfo *hashmap_info)\r
+%\r
+%  A description of each parameter follows:\r
+%\r
+%    o hashmap_info: the hashmap info.\r
+%\r
+*/\r
+MagickExport void *GetNextValueInHashmap(HashmapInfo *hashmap_info)\r
+{\r
+  LinkedListInfo\r
+    *list_info;\r
+\r
+  register EntryInfo\r
+    *entry;\r
+\r
+  void\r
+    *value;\r
+\r
+  assert(hashmap_info != (HashmapInfo *) NULL);\r
+  assert(hashmap_info->signature == MagickCoreSignature);\r
+  LockSemaphoreInfo(hashmap_info->semaphore);\r
+  while (hashmap_info->next < hashmap_info->capacity)\r
+  {\r
+    list_info=hashmap_info->map[hashmap_info->next];\r
+    if (list_info != (LinkedListInfo *) NULL)\r
+      {\r
+        if (IfMagickFalse(hashmap_info->head_of_list))\r
+          {\r
+            list_info->next=list_info->head;\r
+            hashmap_info->head_of_list=MagickTrue;\r
+          }\r
+        entry=(EntryInfo *) GetNextValueInLinkedList(list_info);\r
+        if (entry != (EntryInfo *) NULL)\r
+          {\r
+            value=entry->value;\r
+            UnlockSemaphoreInfo(hashmap_info->semaphore);\r
+            return(value);\r
+          }\r
+        hashmap_info->head_of_list=MagickFalse;\r
+      }\r
+    hashmap_info->next++;\r
+  }\r
+  UnlockSemaphoreInfo(hashmap_info->semaphore);\r
+  return((void *) NULL);\r
+}\r
+\f\r
+/*\r
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\r
+%                                                                             %\r
+%                                                                             %\r
+%                                                                             %\r
+%   G e t N e x t V a l u e I n L i n k e d L i s t                           %\r
+%                                                                             %\r
+%                                                                             %\r
+%                                                                             %\r
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\r
+%\r
+%  GetNextValueInLinkedList() gets the next value in the linked-list.\r
+%\r
+%  The format of the GetNextValueInLinkedList method is:\r
+%\r
+%      void *GetNextValueInLinkedList(LinkedListInfo *list_info)\r
+%\r
+%  A description of each parameter follows:\r
+%\r
+%    o list_info: the linked-list info.\r
+%\r
+*/\r
+MagickExport void *GetNextValueInLinkedList(LinkedListInfo *list_info)\r
+{\r
+  void\r
+    *value;\r
+\r
+  assert(list_info != (LinkedListInfo *) NULL);\r
+  assert(list_info->signature == MagickCoreSignature);\r
+  LockSemaphoreInfo(list_info->semaphore);\r
+  if (list_info->next == (ElementInfo *) NULL)\r
+    {\r
+      UnlockSemaphoreInfo(list_info->semaphore);\r
+      return((void *) NULL);\r
+    }\r
+  value=list_info->next->value;\r
+  list_info->next=list_info->next->next;\r
+  UnlockSemaphoreInfo(list_info->semaphore);\r
+  return(value);\r
+}\r
+\f\r
+/*\r
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\r
+%                                                                             %\r
+%                                                                             %\r
+%                                                                             %\r
+%   G e t N u m b e r O f E n t r i e s I n H a s h m a p                     %\r
+%                                                                             %\r
+%                                                                             %\r
+%                                                                             %\r
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\r
+%\r
+%  GetNumberOfEntriesInHashmap() returns the number of entries in the hash-map.\r
+%\r
+%  The format of the GetNumberOfEntriesInHashmap method is:\r
+%\r
+%      size_t GetNumberOfEntriesInHashmap(const HashmapInfo *hashmap_info)\r
+%\r
+%  A description of each parameter follows:\r
+%\r
+%    o hashmap_info: the hashmap info.\r
+%\r
+*/\r
+MagickExport size_t GetNumberOfEntriesInHashmap(\r
+  const HashmapInfo *hashmap_info)\r
+{\r
+  assert(hashmap_info != (HashmapInfo *) NULL);\r
+  assert(hashmap_info->signature == MagickCoreSignature);\r
+  return(hashmap_info->entries);\r
+}\r
+\f\r
+/*\r
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\r
+%                                                                             %\r
+%                                                                             %\r
+%                                                                             %\r
+%   G e t N u m b e r O f E l e m e n t s I n L i n k e d L i s t             %\r
+%                                                                             %\r
+%                                                                             %\r
+%                                                                             %\r
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\r
+%\r
+%  GetNumberOfElementsInLinkedList() returns the number of entries in the\r
+%  linked-list.\r
+%\r
+%  The format of the GetNumberOfElementsInLinkedList method is:\r
+%\r
+%      size_t GetNumberOfElementsInLinkedList(\r
+%        const LinkedListInfo *list_info)\r
+%\r
+%  A description of each parameter follows:\r
+%\r
+%    o list_info: the linked-list info.\r
+%\r
+*/\r
+MagickExport size_t GetNumberOfElementsInLinkedList(\r
+  const LinkedListInfo *list_info)\r
+{\r
+  assert(list_info != (LinkedListInfo *) NULL);\r
+  assert(list_info->signature == MagickCoreSignature);\r
+  return(list_info->elements);\r
+}\r
+\f\r
+/*\r
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\r
+%                                                                             %\r
+%                                                                             %\r
+%                                                                             %\r
+%   G e t V a l u e F r o m H a s h m a p                                     %\r
+%                                                                             %\r
+%                                                                             %\r
+%                                                                             %\r
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\r
+%\r
+%  GetValueFromHashmap() gets an entry from the hash-map by its key.\r
+%\r
+%  The format of the GetValueFromHashmap method is:\r
+%\r
+%      void *GetValueFromHashmap(HashmapInfo *hashmap_info,const void *key)\r
+%\r
+%  A description of each parameter follows:\r
+%\r
+%    o hashmap_info: the hashmap info.\r
+%\r
+%    o key: the key.\r
+%\r
+*/\r
+MagickExport void *GetValueFromHashmap(HashmapInfo *hashmap_info,\r
+  const void *key)\r
+{\r
+  LinkedListInfo\r
+    *list_info;\r
+\r
+  register EntryInfo\r
+    *entry;\r
+\r
+  size_t\r
+    hash;\r
+\r
+  void\r
+    *value;\r
+\r
+  assert(hashmap_info != (HashmapInfo *) NULL);\r
+  assert(hashmap_info->signature == MagickCoreSignature);\r
+  if (key == (const void *) NULL)\r
+    return((void *) NULL);\r
+  LockSemaphoreInfo(hashmap_info->semaphore);\r
+  hash=hashmap_info->hash(key);\r
+  list_info=hashmap_info->map[hash % hashmap_info->capacity];\r
+  if (list_info != (LinkedListInfo *) NULL)\r
+    {\r
+      list_info->next=list_info->head;\r
+      entry=(EntryInfo *) GetNextValueInLinkedList(list_info);\r
+      while (entry != (EntryInfo *) NULL)\r
+      {\r
+        if (entry->hash == hash)\r
+          {\r
+            MagickBooleanType\r
+              compare;\r
+\r
+            compare=MagickTrue;\r
+            if (hashmap_info->compare !=\r
+                (MagickBooleanType (*)(const void *,const void *)) NULL)\r
+              compare=hashmap_info->compare(key,entry->key);\r
+            if (compare != MagickFalse)\r
+              {\r
+                value=entry->value;\r
+                UnlockSemaphoreInfo(hashmap_info->semaphore);\r
+                return(value);\r
+              }\r
+          }\r
+        entry=(EntryInfo *) GetNextValueInLinkedList(list_info);\r
+      }\r
+    }\r
+  UnlockSemaphoreInfo(hashmap_info->semaphore);\r
+  return((void *) NULL);\r
+}\r
+\f\r
+/*\r
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\r
+%                                                                             %\r
+%                                                                             %\r
+%                                                                             %\r
+%   G e t V a l u e F r o m L i n k e d L i s t                               %\r
+%                                                                             %\r
+%                                                                             %\r
+%                                                                             %\r
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\r
+%\r
+%  GetValueFromLinkedList() gets a value from the linked-list at the specified\r
+%  location.\r
+%\r
+%  The format of the GetValueFromLinkedList method is:\r
+%\r
+%      void *GetValueFromLinkedList(LinkedListInfo *list_info,\r
+%        const size_t index)\r
+%\r
+%  A description of each parameter follows:\r
+%\r
+%    o list_info: the linked_list info.\r
+%\r
+%    o index: the list index.\r
+%\r
+*/\r
+MagickExport void *GetValueFromLinkedList(LinkedListInfo *list_info,\r
+  const size_t index)\r
+{\r
+  register ElementInfo\r
+    *next;\r
+\r
+  register ssize_t\r
+    i;\r
+\r
+  void\r
+    *value;\r
+\r
+  assert(list_info != (LinkedListInfo *) NULL);\r
+  assert(list_info->signature == MagickCoreSignature);\r
+  if (index >= list_info->elements)\r
+    return((void *) NULL);\r
+  LockSemaphoreInfo(list_info->semaphore);\r
+  if (index == 0)\r
+    {\r
+      value=list_info->head->value;\r
+      UnlockSemaphoreInfo(list_info->semaphore);\r
+      return(value);\r
+    }\r
+  if (index == (list_info->elements-1))\r
+    {\r
+      value=list_info->tail->value;\r
+      UnlockSemaphoreInfo(list_info->semaphore);\r
+      return(value);\r
+    }\r
+  next=list_info->head;\r
+  for (i=0; i < (ssize_t) index; i++)\r
+    next=next->next;\r
+  value=next->value;\r
+  UnlockSemaphoreInfo(list_info->semaphore);\r
+  return(value);\r
+}\r
+\f\r
+/*\r
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\r
+%                                                                             %\r
+%                                                                             %\r
+%                                                                             %\r
+%   H a s h P o i n t e r T y p e                                             %\r
+%                                                                             %\r
+%                                                                             %\r
+%                                                                             %\r
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\r
+%\r
+%  HashPointerType() finds an entry in a hash-map based on the address of a\r
+%  pointer.\r
+%\r
+%  The format of the HashPointerType method is:\r
+%\r
+%      size_t HashPointerType(const void *pointer)\r
+%\r
+%  A description of each parameter follows:\r
+%\r
+%    o pointer: compute the hash entry location from this pointer address.\r
+%\r
+*/\r
+MagickExport size_t HashPointerType(const void *pointer)\r
+{\r
+  size_t\r
+    hash;\r
+\r
+  hash=(size_t) pointer;\r
+  hash+=(~(hash << 9));\r
+  hash^=(hash >> 14);\r
+  hash+=(hash << 4);\r
+  hash^=(hash >> 10);\r
+  return(hash);\r
+}\r
+\f\r
+/*\r
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\r
+%                                                                             %\r
+%                                                                             %\r
+%                                                                             %\r
+%   H a s h S t r i n g T y p e                                               %\r
+%                                                                             %\r
+%                                                                             %\r
+%                                                                             %\r
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\r
+%\r
+%  HashStringType() finds an entry in a hash-map based on the contents of a\r
+%  string.\r
+%\r
+%  The format of the HashStringType method is:\r
+%\r
+%      size_t HashStringType(const void *string)\r
+%\r
+%  A description of each parameter follows:\r
+%\r
+%    o string: compute the hash entry location from this string.\r
+%\r
+*/\r
+MagickExport size_t HashStringType(const void *string)\r
+{\r
+  const unsigned char\r
+    *digest;\r
+\r
+  register ssize_t\r
+    i;\r
+\r
+  SignatureInfo\r
+    *signature_info;\r
+\r
+  size_t\r
+    hash;\r
+\r
+  StringInfo\r
+    *signature;\r
+\r
+  signature_info=AcquireSignatureInfo();\r
+  signature=StringToStringInfo((const char *) string);\r
+  UpdateSignature(signature_info,signature);\r
+  FinalizeSignature(signature_info);\r
+  digest=GetStringInfoDatum(GetSignatureDigest(signature_info));\r
+  hash=0;\r
+  for (i=0; i < 8; i++)\r
+    hash^=digest[i];\r
+  signature=DestroyStringInfo(signature);\r
+  signature_info=DestroySignatureInfo(signature_info);\r
+  return(hash);\r
+}\r
+\f\r
+/*\r
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\r
+%                                                                             %\r
+%                                                                             %\r
+%                                                                             %\r
+%   H a s h S t r i n g I n f o T y p e                                       %\r
+%                                                                             %\r
+%                                                                             %\r
+%                                                                             %\r
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\r
+%\r
+%  Specify the HashStringInfoType() method in NewHashmap() to find an entry\r
+%  in a hash-map based on the contents of a string.\r
+%\r
+%  The format of the HashStringInfoType method is:\r
+%\r
+%      size_t HashStringInfoType(const void *string_info)\r
+%\r
+%  A description of each parameter follows:\r
+%\r
+%    o string_info: compute the hash entry location from this string.\r
+%\r
+*/\r
+MagickExport size_t HashStringInfoType(const void *string_info)\r
+{\r
+  const unsigned char\r
+    *digest;\r
+\r
+  register ssize_t\r
+    i;\r
+\r
+  SignatureInfo\r
+    *signature_info;\r
+\r
+  size_t\r
+    hash;\r
+\r
+  signature_info=AcquireSignatureInfo();\r
+  UpdateSignature(signature_info,(const StringInfo *) string_info);\r
+  FinalizeSignature(signature_info);\r
+  digest=GetStringInfoDatum(GetSignatureDigest(signature_info));\r
+  hash=0;\r
+  for (i=0; i < 8; i++)\r
+    hash^=digest[i];\r
+  signature_info=DestroySignatureInfo(signature_info);\r
+  return(hash);\r
+}\r
+\f\r
+/*\r
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\r
+%                                                                             %\r
+%                                                                             %\r
+%                                                                             %\r
+%   I n s e r t V a l u e I n L i n k e d L i s t                             %\r
+%                                                                             %\r
+%                                                                             %\r
+%                                                                             %\r
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\r
+%\r
+%  InsertValueInLinkedList() inserts an element in the linked-list at the\r
+%  specified location.\r
+%\r
+%  The format of the InsertValueInLinkedList method is:\r
+%\r
+%      MagickBooleanType InsertValueInLinkedList(ListInfo *list_info,\r
+%        const size_t index,const void *value)\r
+%\r
+%  A description of each parameter follows:\r
+%\r
+%    o list_info: the hashmap info.\r
+%\r
+%    o index: the index.\r
+%\r
+%    o value: the value.\r
+%\r
+*/\r
+MagickExport MagickBooleanType InsertValueInLinkedList(\r
+  LinkedListInfo *list_info,const size_t index,const void *value)\r
+{\r
+  register ElementInfo\r
+    *next;\r
+\r
+  register ssize_t\r
+    i;\r
+\r
+  assert(list_info != (LinkedListInfo *) NULL);\r
+  assert(list_info->signature == MagickCoreSignature);\r
+  if (value == (const void *) NULL)\r
+    return(MagickFalse);\r
+  if ((index > list_info->elements) ||\r
+      (list_info->elements == list_info->capacity))\r
+    return(MagickFalse);\r
+  next=(ElementInfo *) AcquireMagickMemory(sizeof(*next));\r
+  if (next == (ElementInfo *) NULL)\r
+    return(MagickFalse);\r
+  next->value=(void *) value;\r
+  next->next=(ElementInfo *) NULL;\r
+  LockSemaphoreInfo(list_info->semaphore);\r
+  if (list_info->elements == 0)\r
+    {\r
+      if (list_info->next == (ElementInfo *) NULL)\r
+        list_info->next=next;\r
+      list_info->head=next;\r
+      list_info->tail=next;\r
+    }\r
+  else\r
+    {\r
+      if (index == 0)\r
+        {\r
+          if (list_info->next == list_info->head)\r
+            list_info->next=next;\r
+          next->next=list_info->head;\r
+          list_info->head=next;\r
+        }\r
+      else\r
+        if (index == list_info->elements)\r
+          {\r
+            if (list_info->next == (ElementInfo *) NULL)\r
+              list_info->next=next;\r
+            list_info->tail->next=next;\r
+            list_info->tail=next;\r
+          }\r
+        else\r
+          {\r
+            ElementInfo\r
+              *element;\r
+\r
+            element=list_info->head;\r
+            next->next=element->next;\r
+            for (i=1; i < (ssize_t) index; i++)\r
+            {\r
+              element=element->next;\r
+              next->next=element->next;\r
+            }\r
+            next=next->next;\r
+            element->next=next;\r
+            if (list_info->next == next->next)\r
+              list_info->next=next;\r
+          }\r
+    }\r
+  list_info->elements++;\r
+  UnlockSemaphoreInfo(list_info->semaphore);\r
+  return(MagickTrue);\r
+}\r
+\f\r
+/*\r
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\r
+%                                                                             %\r
+%                                                                             %\r
+%                                                                             %\r
+%   I n s e r t V a l u e I n S o r t e d L i n k e d L i s t                 %\r
+%                                                                             %\r
+%                                                                             %\r
+%                                                                             %\r
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\r
+%\r
+%  InsertValueInSortedLinkedList() inserts a value in the sorted linked-list.\r
+%\r
+%  The format of the InsertValueInSortedLinkedList method is:\r
+%\r
+%      MagickBooleanType InsertValueInSortedLinkedList(ListInfo *list_info,\r
+%        int (*compare)(const void *,const void *),void **replace,\r
+%        const void *value)\r
+%\r
+%  A description of each parameter follows:\r
+%\r
+%    o list_info: the hashmap info.\r
+%\r
+%    o index: the index.\r
+%\r
+%    o compare: the compare method.\r
+%\r
+%    o replace: return previous element here.\r
+%\r
+%    o value: the value.\r
+%\r
+*/\r
+MagickExport MagickBooleanType InsertValueInSortedLinkedList(\r
+  LinkedListInfo *list_info,int (*compare)(const void *,const void *),\r
+  void **replace,const void *value)\r
+{\r
+  ElementInfo\r
+    *element;\r
+\r
+  register ElementInfo\r
+    *next;\r
+\r
+  register ssize_t\r
+    i;\r
+\r
+  assert(list_info != (LinkedListInfo *) NULL);\r
+  assert(list_info->signature == MagickCoreSignature);\r
+  if ((compare == (int (*)(const void *,const void *)) NULL) ||\r
+      (value == (const void *) NULL))\r
+    return(MagickFalse);\r
+  if (list_info->elements == list_info->capacity)\r
+    return(MagickFalse);\r
+  next=(ElementInfo *) AcquireMagickMemory(sizeof(*next));\r
+  if (next == (ElementInfo *) NULL)\r
+    return(MagickFalse);\r
+  next->value=(void *) value;\r
+  element=(ElementInfo *) NULL;\r
+  LockSemaphoreInfo(list_info->semaphore);\r
+  next->next=list_info->head;\r
+  while (next->next != (ElementInfo *) NULL)\r
+  {\r
+    i=(ssize_t) compare(value,next->next->value);\r
+    if ((i < 0) || ((replace != (void **) NULL) && (i == 0)))\r
+      {\r
+        if (i == 0)\r
+          {\r
+            *replace=next->next->value;\r
+            next->next=next->next->next;\r
+            if (element != (ElementInfo *) NULL)\r
+              element->next=(ElementInfo *) RelinquishMagickMemory(\r
+                element->next);\r
+            list_info->elements--;\r
+          }\r
+        if (element != (ElementInfo *) NULL)\r
+          element->next=next;\r
+        else\r
+          list_info->head=next;\r
+        break;\r
+      }\r
+    element=next->next;\r
+    next->next=next->next->next;\r
+  }\r
+  if (next->next == (ElementInfo *) NULL)\r
+    {\r
+      if (element != (ElementInfo *) NULL)\r
+        element->next=next;\r
+      else\r
+        list_info->head=next;\r
+      list_info->tail=next;\r
+    }\r
+  list_info->elements++;\r
+  UnlockSemaphoreInfo(list_info->semaphore);\r
+  return(MagickTrue);\r
+}\r
+\f\r
+/*\r
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\r
+%                                                                             %\r
+%                                                                             %\r
+%                                                                             %\r
+%   I s H a s h m a p E m p t y                                               %\r
+%                                                                             %\r
+%                                                                             %\r
+%                                                                             %\r
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\r
+%\r
+%  IsHashmapEmpty() returns MagickTrue if the hash-map is empty.\r
+%\r
+%  The format of the IsHashmapEmpty method is:\r
+%\r
+%      MagickBooleanType IsHashmapEmpty(const HashmapInfo *hashmap_info)\r
+%\r
+%  A description of each parameter follows:\r
+%\r
+%    o hashmap_info: the hashmap info.\r
+%\r
+*/\r
+MagickExport MagickBooleanType IsHashmapEmpty(const HashmapInfo *hashmap_info)\r
+{\r
+  assert(hashmap_info != (HashmapInfo *) NULL);\r
+  assert(hashmap_info->signature == MagickCoreSignature);\r
+  return(hashmap_info->entries == 0 ? MagickTrue : MagickFalse);\r
+}\r
+\f\r
+/*\r
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\r
+%                                                                             %\r
+%                                                                             %\r
+%                                                                             %\r
+%   I s L i n k e d L i s t E m p t y                                         %\r
+%                                                                             %\r
+%                                                                             %\r
+%                                                                             %\r
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\r
+%\r
+%  IsLinkedListEmpty() returns MagickTrue if the linked-list is empty.\r
+%\r
+%  The format of the IsLinkedListEmpty method is:\r
+%\r
+%      MagickBooleanType IsLinkedListEmpty(LinkedListInfo *list_info)\r
+%\r
+%  A description of each parameter follows:\r
+%\r
+%    o list_info: the linked-list info.\r
+%\r
+*/\r
+MagickExport MagickBooleanType IsLinkedListEmpty(\r
+  const LinkedListInfo *list_info)\r
+{\r
+  assert(list_info != (LinkedListInfo *) NULL);\r
+  assert(list_info->signature == MagickCoreSignature);\r
+  return(list_info->elements == 0 ? MagickTrue : MagickFalse);\r
+}\r
+\f\r
+/*\r
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\r
+%                                                                             %\r
+%                                                                             %\r
+%                                                                             %\r
+%   L i n k e d L i s t T o A r r a y                                         %\r
+%                                                                             %\r
+%                                                                             %\r
+%                                                                             %\r
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\r
+%\r
+%  LinkedListToArray() converts the linked-list to an array.\r
+%\r
+%  The format of the LinkedListToArray method is:\r
+%\r
+%      MagickBooleanType LinkedListToArray(LinkedListInfo *list_info,\r
+%        void **array)\r
+%\r
+%  A description of each parameter follows:\r
+%\r
+%    o list_info: the linked-list info.\r
+%\r
+%    o array: the array.\r
+%\r
+*/\r
+MagickExport MagickBooleanType LinkedListToArray(LinkedListInfo *list_info,\r
+  void **array)\r
+{\r
+  register ElementInfo\r
+    *next;\r
+\r
+  register ssize_t\r
+    i;\r
+\r
+  assert(list_info != (LinkedListInfo *) NULL);\r
+  assert(list_info->signature == MagickCoreSignature);\r
+  if (array == (void **) NULL)\r
+    return(MagickFalse);\r
+  LockSemaphoreInfo(list_info->semaphore);\r
+  next=list_info->head;\r
+  for (i=0; next != (ElementInfo *) NULL; i++)\r
+  {\r
+    array[i]=next->value;\r
+    next=next->next;\r
+  }\r
+  UnlockSemaphoreInfo(list_info->semaphore);\r
+  return(MagickTrue);\r
+}\r
+\f\r
+/*\r
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\r
+%                                                                             %\r
+%                                                                             %\r
+%                                                                             %\r
+%   N e w H a s h m a p                                                       %\r
+%                                                                             %\r
+%                                                                             %\r
+%                                                                             %\r
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\r
+%\r
+%  NewHashmap() returns a pointer to a HashmapInfo structure initialized\r
+%  to default values.  The capacity is an initial estimate.  The hashmap will\r
+%  increase capacity dynamically as the demand requires.\r
+%\r
+%  The format of the NewHashmap method is:\r
+%\r
+%      HashmapInfo *NewHashmap(const size_t capacity,\r
+%        size_t (*hash)(const void *),\r
+%        MagickBooleanType (*compare)(const void *,const void *),\r
+%        void *(*relinquish_key)(void *),void *(*relinquish_value)(void *))\r
+%\r
+%  A description of each parameter follows:\r
+%\r
+%    o capacity: the initial number entries in the hash-map: typically\r
+%      SmallHashmapSize, MediumHashmapSize, or LargeHashmapSize.  The\r
+%      hashmap will dynamically increase its capacity on demand.\r
+%\r
+%    o hash: the hash method, typically HashPointerType(), HashStringType(),\r
+%      or HashStringInfoType().\r
+%\r
+%    o compare: the compare method, typically NULL, CompareHashmapString(),\r
+%      or CompareHashmapStringInfo().\r
+%\r
+%    o relinquish_key: the key deallocation method, typically\r
+%      RelinquishMagickMemory(), called whenever a key is removed from the\r
+%      hash-map.\r
+%\r
+%    o relinquish_value: the value deallocation method;  typically\r
+%      RelinquishMagickMemory(), called whenever a value object is removed from\r
+%      the hash-map.\r
+%\r
+*/\r
+MagickExport HashmapInfo *NewHashmap(const size_t capacity,\r
+  size_t (*hash)(const void *),\r
+  MagickBooleanType (*compare)(const void *,const void *),\r
+  void *(*relinquish_key)(void *),void *(*relinquish_value)(void *))\r
+{\r
+  HashmapInfo\r
+    *hashmap_info;\r
+\r
+  hashmap_info=(HashmapInfo *) AcquireMagickMemory(sizeof(*hashmap_info));\r
+  if (hashmap_info == (HashmapInfo *) NULL)\r
+    ThrowFatalException(ResourceLimitFatalError,"MemoryAllocationFailed");\r
+  (void) ResetMagickMemory(hashmap_info,0,sizeof(*hashmap_info));\r
+  hashmap_info->hash=HashPointerType;\r
+  if (hash != (size_t (*)(const void *)) NULL)\r
+    hashmap_info->hash=hash;\r
+  hashmap_info->compare=(MagickBooleanType (*)(const void *,const void *)) NULL;\r
+  if (compare != (MagickBooleanType (*)(const void *,const void *)) NULL)\r
+    hashmap_info->compare=compare;\r
+  hashmap_info->relinquish_key=relinquish_key;\r
+  hashmap_info->relinquish_value=relinquish_value;\r
+  hashmap_info->entries=0;\r
+  hashmap_info->capacity=capacity;\r
+  hashmap_info->map=(LinkedListInfo **) NULL;\r
+  if (~capacity >= 1UL)\r
+    hashmap_info->map=(LinkedListInfo **) AcquireQuantumMemory((size_t)\r
+      capacity+1UL,sizeof(*hashmap_info->map));\r
+  if (hashmap_info->map == (LinkedListInfo **) NULL)\r
+    ThrowFatalException(ResourceLimitFatalError,"MemoryAllocationFailed");\r
+  (void) ResetMagickMemory(hashmap_info->map,0,(size_t) capacity*\r
+    sizeof(*hashmap_info->map));\r
+  hashmap_info->semaphore=AcquireSemaphoreInfo();\r
+  hashmap_info->signature=MagickCoreSignature;\r
+  return(hashmap_info);\r
+}\r
+\f\r
+/*\r
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\r
+%                                                                             %\r
+%                                                                             %\r
+%                                                                             %\r
+%   N e w L i n k e d L i s t I n f o                                         %\r
+%                                                                             %\r
+%                                                                             %\r
+%                                                                             %\r
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\r
+%\r
+%  NewLinkedList() returns a pointer to a LinkedListInfo structure\r
+%  initialized to default values.\r
+%\r
+%  The format of the NewLinkedList method is:\r
+%\r
+%      LinkedListInfo *NewLinkedList(const size_t capacity)\r
+%\r
+%  A description of each parameter follows:\r
+%\r
+%    o capacity: the maximum number of elements in the list.\r
+%\r
+*/\r
+MagickExport LinkedListInfo *NewLinkedList(const size_t capacity)\r
+{\r
+  LinkedListInfo\r
+    *list_info;\r
+\r
+  list_info=(LinkedListInfo *) AcquireMagickMemory(sizeof(*list_info));\r
+  if (list_info == (LinkedListInfo *) NULL)\r
+    ThrowFatalException(ResourceLimitFatalError,"MemoryAllocationFailed");\r
+  (void) ResetMagickMemory(list_info,0,sizeof(*list_info));\r
+  list_info->capacity=capacity == 0 ? (size_t) (~0) : capacity;\r
+  list_info->elements=0;\r
+  list_info->head=(ElementInfo *) NULL;\r
+  list_info->tail=(ElementInfo *) NULL;\r
+  list_info->next=(ElementInfo *) NULL;\r
+  list_info->semaphore=AcquireSemaphoreInfo();\r
+  list_info->signature=MagickCoreSignature;\r
+  return(list_info);\r
+}\r
+\f\r
+/*\r
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\r
+%                                                                             %\r
+%                                                                             %\r
+%                                                                             %\r
+%   P u t E n t r y I n H a s h m a p                                         %\r
+%                                                                             %\r
+%                                                                             %\r
+%                                                                             %\r
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\r
+%\r
+%  PutEntryInHashmap() puts an entry in the hash-map.  If the key already\r
+%  exists in the map it is first removed.\r
+%\r
+%  The format of the PutEntryInHashmap method is:\r
+%\r
+%      MagickBooleanType PutEntryInHashmap(HashmapInfo *hashmap_info,\r
+%        const void *key,const void *value)\r
+%\r
+%  A description of each parameter follows:\r
+%\r
+%    o hashmap_info: the hashmap info.\r
+%\r
+%    o key: the key.\r
+%\r
+%    o value: the value.\r
+%\r
+*/\r
+\r
+static MagickBooleanType IncreaseHashmapCapacity(HashmapInfo *hashmap_info)\r
+{\r
+#define MaxCapacities  20\r
+\r
+  const size_t\r
+    capacities[MaxCapacities] =\r
+    {\r
+      17, 31, 61, 131, 257, 509, 1021, 2053, 4099, 8191, 16381, 32771,\r
+      65537, 131071, 262147, 524287, 1048573, 2097143, 4194301, 8388617\r
+    };\r
+\r
+  ElementInfo\r
+    *element;\r
+\r
+  EntryInfo\r
+    *entry;\r
+\r
+  LinkedListInfo\r
+    *map_info,\r
+    **map;\r
+\r
+  register ElementInfo\r
+    *next;\r
+\r
+  register ssize_t\r
+    i;\r
+\r
+  size_t\r
+    capacity;\r
+\r
+  /*\r
+    Increase to the next prime capacity.\r
+  */\r
+  for (i=0; i < MaxCapacities; i++)\r
+    if (hashmap_info->capacity < capacities[i])\r
+      break;\r
+  if (i >= (MaxCapacities-1))\r
+    return(MagickFalse);\r
+  capacity=capacities[i+1];\r
+  map=(LinkedListInfo **) AcquireQuantumMemory((size_t) capacity+1UL,\r
+    sizeof(*map));\r
+  if (map == (LinkedListInfo **) NULL)\r
+    return(MagickFalse);\r
+  (void) ResetMagickMemory(map,0,(size_t) capacity*sizeof(*map));\r
+  /*\r
+    Copy entries to new hashmap with increased capacity.\r
+  */\r
+  for (i=0; i < (ssize_t) hashmap_info->capacity; i++)\r
+  {\r
+    LinkedListInfo\r
+      *list_info;\r
+\r
+    list_info=hashmap_info->map[i];\r
+    if (list_info == (LinkedListInfo *) NULL)\r
+      continue;\r
+    LockSemaphoreInfo(list_info->semaphore);\r
+    for (next=list_info->head; next != (ElementInfo *) NULL; )\r
+    {\r
+      element=next;\r
+      next=next->next;\r
+      entry=(EntryInfo *) element->value;\r
+      map_info=map[entry->hash % capacity];\r
+      if (map_info == (LinkedListInfo *) NULL)\r
+        {\r
+          map_info=NewLinkedList(0);\r
+          map[entry->hash % capacity]=map_info;\r
+        }\r
+      map_info->next=element;\r
+      element->next=map_info->head;\r
+      map_info->head=element;\r
+      map_info->elements++;\r
+    }\r
+    list_info->signature=(~MagickCoreSignature);\r
+    UnlockSemaphoreInfo(list_info->semaphore);\r
+    RelinquishSemaphoreInfo(&list_info->semaphore);\r
+    list_info=(LinkedListInfo *) RelinquishMagickMemory(list_info);\r
+  }\r
+  hashmap_info->map=(LinkedListInfo **) RelinquishMagickMemory(\r
+    hashmap_info->map);\r
+  hashmap_info->map=map;\r
+  hashmap_info->capacity=capacity;\r
+  return(MagickTrue);\r
+}\r
+\r
+MagickExport MagickBooleanType PutEntryInHashmap(HashmapInfo *hashmap_info,\r
+  const void *key,const void *value)\r
+{\r
+  EntryInfo\r
+    *entry,\r
+    *next;\r
+\r
+  LinkedListInfo\r
+    *list_info;\r
+\r
+  register size_t\r
+    i;\r
+\r
+  assert(hashmap_info != (HashmapInfo *) NULL);\r
+  assert(hashmap_info->signature == MagickCoreSignature);\r
+  if ((key == (void *) NULL) || (value == (void *) NULL))\r
+    return(MagickFalse);\r
+  next=(EntryInfo *) AcquireMagickMemory(sizeof(*next));\r
+  if (next == (EntryInfo *) NULL)\r
+    return(MagickFalse);\r
+  LockSemaphoreInfo(hashmap_info->semaphore);\r
+  next->hash=hashmap_info->hash(key);\r
+  next->key=(void *) key;\r
+  next->value=(void *) value;\r
+  list_info=hashmap_info->map[next->hash % hashmap_info->capacity];\r
+  if (list_info == (LinkedListInfo *) NULL)\r
+    {\r
+      list_info=NewLinkedList(0);\r
+      hashmap_info->map[next->hash % hashmap_info->capacity]=list_info;\r
+    }\r
+  else\r
+    {\r
+      list_info->next=list_info->head;\r
+      entry=(EntryInfo *) GetNextValueInLinkedList(list_info);\r
+      for (i=0; entry != (EntryInfo *) NULL; i++)\r
+      {\r
+        if (entry->hash == next->hash)\r
+          {\r
+            MagickBooleanType\r
+              compare;\r
+\r
+            compare=MagickTrue;\r
+            if (hashmap_info->compare !=\r
+                (MagickBooleanType (*)(const void *,const void *)) NULL)\r
+              compare=hashmap_info->compare(key,entry->key);\r
+            if( compare != MagickFalse )\r
+              {\r
+                (void) RemoveElementFromLinkedList(list_info,i);\r
+                if (hashmap_info->relinquish_key != (void *(*)(void *)) NULL)\r
+                  entry->key=hashmap_info->relinquish_key(entry->key);\r
+                if (hashmap_info->relinquish_value != (void *(*)(void *)) NULL)\r
+                  entry->value=hashmap_info->relinquish_value(entry->value);\r
+                entry=(EntryInfo *) RelinquishMagickMemory(entry);\r
+                break;\r
+              }\r
+          }\r
+        entry=(EntryInfo *) GetNextValueInLinkedList(list_info);\r
+      }\r
+    }\r
+  if (IfMagickFalse(InsertValueInLinkedList(list_info,0,next)))\r
+    {\r
+      next=(EntryInfo *) RelinquishMagickMemory(next);\r
+      UnlockSemaphoreInfo(hashmap_info->semaphore);\r
+      return(MagickFalse);\r
+    }\r
+  if (list_info->elements >= (hashmap_info->capacity-1))\r
+    if (IfMagickFalse(IncreaseHashmapCapacity(hashmap_info)))\r
+      {\r
+        UnlockSemaphoreInfo(hashmap_info->semaphore);\r
+        return(MagickFalse);\r
+      }\r
+  hashmap_info->entries++;\r
+  UnlockSemaphoreInfo(hashmap_info->semaphore);\r
+  return(MagickTrue);\r
+}\r
+\f\r
+/*\r
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\r
+%                                                                             %\r
+%                                                                             %\r
+%                                                                             %\r
+%   R e m o v e E l e m e n t B y V a l u e F r o m L i n k e d L i s t       %\r
+%                                                                             %\r
+%                                                                             %\r
+%                                                                             %\r
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\r
+%\r
+%  RemoveElementByValueFromLinkedList() removes an element from the linked-list\r
+%  by value.\r
+%\r
+%  The format of the RemoveElementByValueFromLinkedList method is:\r
+%\r
+%      void *RemoveElementByValueFromLinkedList(LinkedListInfo *list_info,\r
+%        const void *value)\r
+%\r
+%  A description of each parameter follows:\r
+%\r
+%    o list_info: the list info.\r
+%\r
+%    o value: the value.\r
+%\r
+*/\r
+MagickExport void *RemoveElementByValueFromLinkedList(LinkedListInfo *list_info,\r
+  const void *value)\r
+{\r
+  ElementInfo\r
+    *next;\r
+\r
+  assert(list_info != (LinkedListInfo *) NULL);\r
+  assert(list_info->signature == MagickCoreSignature);\r
+  if ((list_info->elements == 0) || (value == (const void *) NULL))\r
+    return((void *) NULL);\r
+  LockSemaphoreInfo(list_info->semaphore);\r
+  if (value == list_info->head->value)\r
+    {\r
+      if (list_info->next == list_info->head)\r
+        list_info->next=list_info->head->next;\r
+      next=list_info->head;\r
+      list_info->head=list_info->head->next;\r
+      next=(ElementInfo *) RelinquishMagickMemory(next);\r
+    }\r
+  else\r
+    {\r
+      ElementInfo\r
+        *element;\r
+\r
+      next=list_info->head;\r
+      while ((next->next != (ElementInfo *) NULL) &&\r
+             (next->next->value != value))\r
+        next=next->next;\r
+      if (next->next == (ElementInfo *) NULL)\r
+        {\r
+          UnlockSemaphoreInfo(list_info->semaphore);\r
+          return((void *) NULL);\r
+        }\r
+      element=next->next;\r
+      next->next=element->next;\r
+      if (element == list_info->tail)\r
+        list_info->tail=next;\r
+      if (list_info->next == element)\r
+        list_info->next=element->next;\r
+      element=(ElementInfo *) RelinquishMagickMemory(element);\r
+    }\r
+  list_info->elements--;\r
+  UnlockSemaphoreInfo(list_info->semaphore);\r
+  return((void *) value);\r
+}\r
+\f\r
+/*\r
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\r
+%                                                                             %\r
+%                                                                             %\r
+%                                                                             %\r
+%   R e m o v e E l e m e n t F r o m L i n k e d L i s t                     %\r
+%                                                                             %\r
+%                                                                             %\r
+%                                                                             %\r
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\r
+%\r
+%  RemoveElementFromLinkedList() removes an element from the linked-list at the\r
+%  specified location.\r
+%\r
+%  The format of the RemoveElementFromLinkedList method is:\r
+%\r
+%      void *RemoveElementFromLinkedList(LinkedListInfo *list_info,\r
+%        const size_t index)\r
+%\r
+%  A description of each parameter follows:\r
+%\r
+%    o list_info: the linked-list info.\r
+%\r
+%    o index: the index.\r
+%\r
+*/\r
+MagickExport void *RemoveElementFromLinkedList(LinkedListInfo *list_info,\r
+  const size_t index)\r
+{\r
+  ElementInfo\r
+    *next;\r
+\r
+  register ssize_t\r
+    i;\r
+\r
+  void\r
+    *value;\r
+\r
+  assert(list_info != (LinkedListInfo *) NULL);\r
+  assert(list_info->signature == MagickCoreSignature);\r
+  if (index >= list_info->elements)\r
+    return((void *) NULL);\r
+  LockSemaphoreInfo(list_info->semaphore);\r
+  if (index == 0)\r
+    {\r
+      if (list_info->next == list_info->head)\r
+        list_info->next=list_info->head->next;\r
+      value=list_info->head->value;\r
+      next=list_info->head;\r
+      list_info->head=list_info->head->next;\r
+      next=(ElementInfo *) RelinquishMagickMemory(next);\r
+    }\r
+  else\r
+    {\r
+      ElementInfo\r
+        *element;\r
+\r
+      next=list_info->head;\r
+      for (i=1; i < (ssize_t) index; i++)\r
+        next=next->next;\r
+      element=next->next;\r
+      next->next=element->next;\r
+      if (element == list_info->tail)\r
+        list_info->tail=next;\r
+      if (list_info->next == element)\r
+        list_info->next=element->next;\r
+      value=element->value;\r
+      element=(ElementInfo *) RelinquishMagickMemory(element);\r
+    }\r
+  list_info->elements--;\r
+  UnlockSemaphoreInfo(list_info->semaphore);\r
+  return(value);\r
+}\r
+\f\r
+/*\r
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\r
+%                                                                             %\r
+%                                                                             %\r
+%                                                                             %\r
+%   R e m o v e E n t r y F r o m H a s h m a p                               %\r
+%                                                                             %\r
+%                                                                             %\r
+%                                                                             %\r
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\r
+%\r
+%  RemoveEntryFromHashmap() removes an entry from the hash-map by its key.\r
+%\r
+%  The format of the RemoveEntryFromHashmap method is:\r
+%\r
+%      void *RemoveEntryFromHashmap(HashmapInfo *hashmap_info,void *key)\r
+%\r
+%  A description of each parameter follows:\r
+%\r
+%    o hashmap_info: the hashmap info.\r
+%\r
+%    o key: the key.\r
+%\r
+*/\r
+MagickExport void *RemoveEntryFromHashmap(HashmapInfo *hashmap_info,\r
+  const void *key)\r
+{\r
+  EntryInfo\r
+    *entry;\r
+\r
+  LinkedListInfo\r
+    *list_info;\r
+\r
+  register size_t\r
+    i;\r
+\r
+  size_t\r
+    hash;\r
+\r
+  void\r
+    *value;\r
+\r
+  assert(hashmap_info != (HashmapInfo *) NULL);\r
+  assert(hashmap_info->signature == MagickCoreSignature);\r
+  if (key == (const void *) NULL)\r
+    return((void *) NULL);\r
+  LockSemaphoreInfo(hashmap_info->semaphore);\r
+  hash=hashmap_info->hash(key);\r
+  list_info=hashmap_info->map[hash % hashmap_info->capacity];\r
+  if (list_info != (LinkedListInfo *) NULL)\r
+    {\r
+      list_info->next=list_info->head;\r
+      entry=(EntryInfo *) GetNextValueInLinkedList(list_info);\r
+      for (i=0; entry != (EntryInfo *) NULL; i++)\r
+      {\r
+        if (entry->hash == hash)\r
+          {\r
+            MagickBooleanType\r
+              compare;\r
+\r
+            compare=MagickTrue;\r
+            if (hashmap_info->compare !=\r
+                (MagickBooleanType (*)(const void *,const void *)) NULL)\r
+              compare=hashmap_info->compare(key,entry->key);\r
+            if (compare != MagickFalse)\r
+              {\r
+                entry=(EntryInfo *) RemoveElementFromLinkedList(list_info,i);\r
+                if (entry == (EntryInfo *) NULL)\r
+                  {\r
+                    UnlockSemaphoreInfo(hashmap_info->semaphore);\r
+                    return((void *) NULL);\r
+                  }\r
+                if (hashmap_info->relinquish_key != (void *(*)(void *)) NULL)\r
+                  entry->key=hashmap_info->relinquish_key(entry->key);\r
+                value=entry->value;\r
+                entry=(EntryInfo *) RelinquishMagickMemory(entry);\r
+                hashmap_info->entries--;\r
+                UnlockSemaphoreInfo(hashmap_info->semaphore);\r
+                return(value);\r
+              }\r
+          }\r
+        entry=(EntryInfo *) GetNextValueInLinkedList(list_info);\r
+      }\r
+    }\r
+  UnlockSemaphoreInfo(hashmap_info->semaphore);\r
+  return((void *) NULL);\r
+}\r
+\f\r
+/*\r
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\r
+%                                                                             %\r
+%                                                                             %\r
+%                                                                             %\r
+%   R e m o v e L a s t E l e m e n t F r o m L i n k e d L i s t             %\r
+%                                                                             %\r
+%                                                                             %\r
+%                                                                             %\r
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\r
+%\r
+%  RemoveLastElementFromLinkedList() removes the last element from the\r
+%  linked-list.\r
+%\r
+%  The format of the RemoveLastElementFromLinkedList method is:\r
+%\r
+%      void *RemoveLastElementFromLinkedList(LinkedListInfo *list_info)\r
+%\r
+%  A description of each parameter follows:\r
+%\r
+%    o list_info: the linked-list info.\r
+%\r
+*/\r
+MagickExport void *RemoveLastElementFromLinkedList(LinkedListInfo *list_info)\r
+{\r
+  void\r
+    *value;\r
+\r
+  assert(list_info != (LinkedListInfo *) NULL);\r
+  assert(list_info->signature == MagickCoreSignature);\r
+  if (list_info->elements == 0)\r
+    return((void *) NULL);\r
+  LockSemaphoreInfo(list_info->semaphore);\r
+  if (list_info->next == list_info->tail)\r
+    list_info->next=(ElementInfo *) NULL;\r
+  if (list_info->elements == 1UL)\r
+    {\r
+      value=list_info->head->value;\r
+      list_info->head=(ElementInfo *) NULL;\r
+      list_info->tail=(ElementInfo *) RelinquishMagickMemory(list_info->tail);\r
+    }\r
+  else\r
+    {\r
+      ElementInfo\r
+        *next;\r
+\r
+      value=list_info->tail->value;\r
+      next=list_info->head;\r
+      while (next->next != list_info->tail)\r
+        next=next->next;\r
+      list_info->tail=(ElementInfo *) RelinquishMagickMemory(list_info->tail);\r
+      list_info->tail=next;\r
+      next->next=(ElementInfo *) NULL;\r
+    }\r
+  list_info->elements--;\r
+  UnlockSemaphoreInfo(list_info->semaphore);\r
+  return(value);\r
+}\r
+\f\r
+/*\r
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\r
+%                                                                             %\r
+%                                                                             %\r
+%                                                                             %\r
+%   R e s e t H a s h m a p I t e r a t o r                                   %\r
+%                                                                             %\r
+%                                                                             %\r
+%                                                                             %\r
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\r
+%\r
+%  ResetHashmapIterator() resets the hash-map iterator.  Use it in conjunction\r
+%  with GetNextKeyInHashmap() to iterate over all the keys in the hash-map.\r
+%\r
+%  The format of the ResetHashmapIterator method is:\r
+%\r
+%      ResetHashmapIterator(HashmapInfo *hashmap_info)\r
+%\r
+%  A description of each parameter follows:\r
+%\r
+%    o hashmap_info: the hashmap info.\r
+%\r
+*/\r
+MagickExport void ResetHashmapIterator(HashmapInfo *hashmap_info)\r
+{\r
+  assert(hashmap_info != (HashmapInfo *) NULL);\r
+  assert(hashmap_info->signature == MagickCoreSignature);\r
+  LockSemaphoreInfo(hashmap_info->semaphore);\r
+  hashmap_info->next=0;\r
+  hashmap_info->head_of_list=MagickFalse;\r
+  UnlockSemaphoreInfo(hashmap_info->semaphore);\r
+}\r
+\f\r
+/*\r
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\r
+%                                                                             %\r
+%                                                                             %\r
+%                                                                             %\r
+%   R e s e t L i n k e d L i s t I t e r a t o r                             %\r
+%                                                                             %\r
+%                                                                             %\r
+%                                                                             %\r
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\r
+%\r
+%  ResetLinkedListIterator() resets the lined-list iterator.  Use it in\r
+%  conjunction with GetNextValueInLinkedList() to iterate over all the values\r
+%  in the linked-list.\r
+%\r
+%  The format of the ResetLinkedListIterator method is:\r
+%\r
+%      ResetLinkedListIterator(LinkedListInfo *list_info)\r
+%\r
+%  A description of each parameter follows:\r
+%\r
+%    o list_info: the linked-list info.\r
+%\r
+*/\r
+MagickExport void ResetLinkedListIterator(LinkedListInfo *list_info)\r
+{\r
+  assert(list_info != (LinkedListInfo *) NULL);\r
+  assert(list_info->signature == MagickCoreSignature);\r
+  LockSemaphoreInfo(list_info->semaphore);\r
+  list_info->next=list_info->head;\r
+  UnlockSemaphoreInfo(list_info->semaphore);\r
+}\r
index 96858de8387f1964655df42bff9100fa7102069b..1e08272483bd48ab4945b4ebf5b2b23c7ca2e7c9 100644 (file)
@@ -974,7 +974,7 @@ MagickExport MagickBooleanType IdentifyImage(Image *image,FILE *file,
       else
         {
           artifact=GetImageArtifact(image,"identify:unique-colors");
-          if (IfMagickTrue(IsStringTrue(artifact)))
+          if (IsStringTrue(artifact != MagickFalse))
             (void) FormatLocaleFile(file,"  Colors: %.20g\n",(double)
               GetNumberColors(image,(FILE *) NULL,exception));
         }
index b25dbe34d88f659c596722e1c4a8ccc9a7b69c35..f7d8990fa0a621b90fa1a95d4759d9cc1cccf5bc 100644 (file)
@@ -160,11 +160,9 @@ typedef enum
 */
 #if 1
 /* Fast C typing method assumes MagickBooleanType match 0,1 values */
-#  define IfMagickTrue(v)  ((int)(v))
 #  define IfMagickFalse(v) (!(int)(v))
 #else
 /* Do not depend MagickBooleanType's values */
-#  define IfMagickTrue(v)  ((v) != MagickFalse)
 #  define IfMagickFalse(v) ((v) == MagickFalse)
 #endif
 
index e5b90f79be691de9833d557297c334508cf0a0bd..53923b6996603fcade863640432c68fc79ae4db7 100644 (file)
@@ -3732,7 +3732,7 @@ MagickPrivate Image *MorphologyApply(const Image *image,
 
       changed=MorphologyPrimitiveDirect(rslt_image,method,kernel,exception);
 
-      if ( IfMagickTrue(verbose) )
+      if (verbose != MagickFalse)
         (void) (void) FormatLocaleFile(stderr,
           "%s:%.20g.%.20g #%.20g => Changed %.20g\n",
           CommandOptionToMnemonic(MagickMorphologyOptions, method),
@@ -3880,7 +3880,7 @@ MagickPrivate Image *MorphologyApply(const Image *image,
         assert( this_kernel != (KernelInfo *) NULL );
 
         /* Extra information for debugging compound operations */
-        if ( IfMagickTrue(verbose) ) {
+        if (verbose != MagickFalse) {
           if ( stage_limit > 1 )
             (void) FormatLocaleString(v_info,MagickPathExtent,"%s:%.20g.%.20g -> ",
              CommandOptionToMnemonic(MagickMorphologyOptions,method),(double)
@@ -3914,7 +3914,7 @@ MagickPrivate Image *MorphologyApply(const Image *image,
           count++;
           changed = MorphologyPrimitive(curr_image, work_image, primitive,
                        this_kernel, bias, exception);
-          if ( IfMagickTrue(verbose) ) {
+          if (verbose != MagickFalse) {
             if ( kernel_loop > 1 )
               (void) FormatLocaleFile(stderr, "\n"); /* add end-of-line from previous */
             (void) (void) FormatLocaleFile(stderr,
@@ -3939,9 +3939,9 @@ MagickPrivate Image *MorphologyApply(const Image *image,
 
         } /* End Loop 4: Iterate the kernel with primitive */
 
-        if ( IfMagickTrue(verbose) && kernel_changed != (size_t)changed )
+        if (verbose != MagickFalse && kernel_changed != (size_t)changed)
           (void) FormatLocaleFile(stderr, "   Total %.20g",(double) kernel_changed);
-        if ( IfMagickTrue(verbose) && stage_loop < stage_limit )
+        if (verbose != MagickFalse && stage_loop < stage_limit)
           (void) FormatLocaleFile(stderr, "\n"); /* add end-of-line before looping */
 
 #if 0
@@ -3966,7 +3966,7 @@ MagickPrivate Image *MorphologyApply(const Image *image,
         case EdgeInMorphology:
         case TopHatMorphology:
         case BottomHatMorphology:
-          if ( IfMagickTrue(verbose) )
+          if (verbose != MagickFalse)
             (void) FormatLocaleFile(stderr,
               "\n%s: Difference with original image",CommandOptionToMnemonic(
               MagickMorphologyOptions, method) );
@@ -3974,7 +3974,7 @@ MagickPrivate Image *MorphologyApply(const Image *image,
             MagickTrue,0,0,exception);
           break;
         case EdgeMorphology:
-          if ( IfMagickTrue(verbose) )
+          if (verbose != MagickFalse)
             (void) FormatLocaleFile(stderr,
               "\n%s: Difference of Dilate and Erode",CommandOptionToMnemonic(
               MagickMorphologyOptions, method) );
@@ -3990,7 +3990,7 @@ MagickPrivate Image *MorphologyApply(const Image *image,
       if ( kernel->next == (KernelInfo *) NULL )
         rslt_image = curr_image;   /* just return the resulting image */
       else if ( rslt_compose == NoCompositeOp )
-        { if ( IfMagickTrue(verbose) ) {
+        { if (verbose != MagickFalse) {
             if ( this_kernel->next != (KernelInfo *) NULL )
               (void) FormatLocaleFile(stderr, " (re-iterate)");
             else
@@ -3999,7 +3999,7 @@ MagickPrivate Image *MorphologyApply(const Image *image,
           rslt_image = curr_image; /* return result, and re-iterate */
         }
       else if ( rslt_image == (Image *) NULL)
-        { if ( IfMagickTrue(verbose) )
+        { if (verbose != MagickFalse)
             (void) FormatLocaleFile(stderr, " (save for compose)");
           rslt_image = curr_image;
           curr_image = (Image *) image;  /* continue with original image */
@@ -4012,7 +4012,7 @@ MagickPrivate Image *MorphologyApply(const Image *image,
           ** purely mathematical way, and only to the selected channels.
           ** IE: Turn off SVG composition 'alpha blending'.
           */
-          if ( IfMagickTrue(verbose) )
+          if (verbose != MagickFalse)
             (void) FormatLocaleFile(stderr, " (compose \"%s\")",
               CommandOptionToMnemonic(MagickComposeOptions, rslt_compose) );
           (void) CompositeImage(rslt_image,curr_image,rslt_compose,MagickTrue,
@@ -4020,7 +4020,7 @@ MagickPrivate Image *MorphologyApply(const Image *image,
           curr_image = DestroyImage(curr_image);
           curr_image = (Image *) image;  /* continue with original image */
         }
-      if ( IfMagickTrue(verbose) )
+      if (verbose != MagickFalse)
         (void) FormatLocaleFile(stderr, "\n");
 
       /* loop to the next kernel in a multi-kernel list */
index 343e260f5c1e1b8081c38aded80bf0e48e562c63..a13bf5c5e3f8411edbb9972b7b38c1a434bb920f 100644 (file)
@@ -139,7 +139,7 @@ MagickExport MagickBooleanType CloneImageProperties(Image *image,
     (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",image->filename);
   assert(clone_image != (const Image *) NULL);
   assert(clone_image->signature == MagickCoreSignature);
-  if( IfMagickTrue(clone_image->debug) )
+  if (clone_image->debug != MagickFalse)
     (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",
       clone_image->filename);
   (void) CopyMagickString(image->filename,clone_image->filename,MagickPathExtent);
@@ -2084,7 +2084,7 @@ MagickExport const char *GetImageProperty(const Image *image,
 
   assert(image != (Image *) NULL);
   assert(image->signature == MagickCoreSignature);
-  if (IfMagickTrue(image->debug))
+  if (image->debug != MagickFalse)
     (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",image->filename);
   p=(const char *) NULL;
   if (image->properties != (void *) NULL)
@@ -2275,9 +2275,9 @@ static const char *GetMagickPropertyLetter(ImageInfo *image_info,
   const char
     *string;     /* return a string already stored somewher */
 
-  if (image != (Image *) NULL && IfMagickTrue(image->debug))
+  if (image != (Image *) NULL && image->debug != MagickFalse)
     (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",image->filename);
-  else if( image_info != (ImageInfo *) NULL && IfMagickTrue(image_info->debug))
+  else if( image_info != (ImageInfo *) NULL && image_info->debug != MagickFalse)
     (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s","no-images");
 
   *value='\0';           /* formatted string */
@@ -2401,7 +2401,7 @@ static const char *GetMagickPropertyLetter(ImageInfo *image_info,
 
       WarnNoImageReturn("\"%%%c\"",letter);
       colorspace=image->colorspace;
-      if (IfMagickTrue(SetImageGray(image,exception)))
+      if (SetImageGray(image,exception != MagickFalse))
         colorspace=GRAYColorspace;   /* FUTURE: this is IMv6 not IMv7 */
       (void) FormatLocaleString(value,MagickPathExtent,"%s %s %s",
         CommandOptionToMnemonic(MagickClassOptions,(ssize_t) image->storage_class),
@@ -2647,9 +2647,9 @@ MagickExport const char *GetMagickProperty(ImageInfo *image_info,
   if (property[1] == '\0')  /* single letter property request */
     return(GetMagickPropertyLetter(image_info,image,*property,exception));
 
-  if (image != (Image *) NULL && IfMagickTrue(image->debug))
+  if (image != (Image *) NULL && image->debug != MagickFalse)
     (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",image->filename);
-  else if( image_info != (ImageInfo *) NULL && IfMagickTrue(image_info->debug))
+  else if( image_info != (ImageInfo *) NULL && image_info->debug != MagickFalse)
     (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s","no-images");
 
   *value='\0';           /* formated string */
@@ -3236,9 +3236,9 @@ MagickExport char *InterpretImageProperties(ImageInfo *image_info,
   assert(image == NULL || image->signature == MagickCoreSignature);
   assert(image_info == NULL || image_info->signature == MagickCoreSignature);
 
-  if (image != (Image *) NULL && IfMagickTrue(image->debug))
+  if (image != (Image *) NULL && image->debug != MagickFalse)
     (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",image->filename);
-  else if( image_info != (ImageInfo *) NULL && IfMagickTrue(image_info->debug))
+  else if( image_info != (ImageInfo *) NULL && image_info->debug != MagickFalse)
     (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s","no-image");
 
   if (embed_text == (const char *) NULL)
index f46cee8cd0418a26110742da128e89203932409c..ccfe0cc10ef7bab4e5f44f433b331628d887d24a 100644 (file)
@@ -880,7 +880,7 @@ MagickPrivate ResizeFilter *AcquireResizeFilter(const Image *image,
   window_type=mapping[filter].window;
   resize_filter->blur=1.0;
   /* Promote 1D Windowed Sinc Filters to a 2D Windowed Jinc filters */
-  if ( IfMagickTrue(cylindrical) && (filter_type == SincFastFilter) &&
+  if ( cylindrical != MagickFalse && (filter_type == SincFastFilter) &&
       (filter != SincFastFilter))
     filter_type=JincFilter;  /* 1D Windowed Sinc => 2D Windowed Jinc filters */
 
@@ -918,7 +918,7 @@ MagickPrivate ResizeFilter *AcquireResizeFilter(const Image *image,
           option=ParseCommandOption(MagickFilterOptions,MagickFalse,artifact);
           if ((UndefinedFilter < option) && (option < SentinelFilter))
             {
-              filter_type= IfMagickTrue(cylindrical) ? JincFilter
+              filter_type= cylindrical != MagickFalse ? JincFilter
                                                      : SincFastFilter;
               window_type=(FilterTypes) option;
             }
@@ -3677,7 +3677,7 @@ MagickExport Image *ThumbnailImage(const Image *image,const size_t columns,
       image->magick_filename);
   (void) SetImageProperty(thumbnail_image,"Thumb::URI",value,exception);
   (void) CopyMagickString(value,image->magick_filename,MagickPathExtent);
-  if ( IfMagickTrue(GetPathAttributes(image->filename,&attributes)) )
+  if ( GetPathAttributes(image->filename,&attributes) != MagickFalse )
     {
       (void) FormatLocaleString(value,MagickPathExtent,"%.20g",(double)
         attributes.st_mtime);