]> granicus.if.org Git - imagemagick/commitdiff
Minor refactoring.
authordirk <dirk@git.imagemagick.org>
Sun, 27 Apr 2014 16:42:54 +0000 (16:42 +0000)
committerdirk <dirk@git.imagemagick.org>
Sun, 27 Apr 2014 16:42:54 +0000 (16:42 +0000)
MagickCore/exception.c

index b3a5e1e97ed7b3ed57c9cbc789c963dd55ba93c8..f6d9e57e6747c9db4683d5cb250ac92b65ada1ff 100644 (file)
@@ -152,22 +152,13 @@ static void *DestroyExceptionElement(void *exception)
 
 MagickExport void ClearMagickException(ExceptionInfo *exception)
 {
-  register ExceptionInfo
-    *p;
-
   assert(exception != (ExceptionInfo *) NULL);
   assert(exception->signature == MagickSignature);
-  if (exception->exceptions  == (void *) NULL)
+  if (exception->exceptions == (void *) NULL)
     return;
   LockSemaphoreInfo(exception->semaphore);
-  p=(ExceptionInfo *) RemoveLastElementFromLinkedList((LinkedListInfo *)
-    exception->exceptions);
-  while (p != (ExceptionInfo *) NULL)
-  {
-    (void) DestroyExceptionElement(p);
-    p=(ExceptionInfo *) RemoveLastElementFromLinkedList((LinkedListInfo *)
-      exception->exceptions);
-  }
+  ClearLinkedList((LinkedListInfo *) exception->exceptions,
+      DestroyExceptionElement);
   exception->severity=UndefinedException;
   exception->reason=(char *) NULL;
   exception->description=(char *) NULL;