]> granicus.if.org Git - imagemagick/commitdiff
(no commit message)
authorcristy <urban-warrior@git.imagemagick.org>
Sat, 23 Jan 2010 04:02:23 +0000 (04:02 +0000)
committercristy <urban-warrior@git.imagemagick.org>
Sat, 23 Jan 2010 04:02:23 +0000 (04:02 +0000)
magick/accelerate.c
magick/exception.c

index c9a0348f113c215fa307e49b3cd09b1e7e337f2e..ec13d887daf0fb2a22f52ad157a261e2181b19d2 100644 (file)
@@ -313,8 +313,8 @@ static void ConvolveNotify(const char *message,const void *data,size_t length,
   (void) data;
   (void) length;
   exception=(ExceptionInfo *) user_context;
-  (void) ThrowMagickException(exception,GetMagickModule(),FilterError,
-    "FilterFailed","`%s'",message);
+  (void) ThrowMagickException(exception,GetMagickModule(),DelegateWarning,
+    "DelegateFailed","`%s'",message);
 }
 
 static MagickBooleanType BindConvolveParameters(ConvolveInfo *convolve_info,
@@ -486,8 +486,8 @@ static ConvolveInfo *GetConvolveInfo(const Image *image,const char *name,
   /*
     Create OpenCL context.
   */
-  convolve_info->context=clCreateContextFromType((cl_context_properties *) NULL,
-    CL_DEVICE_TYPE_GPU,ConvolveNotify,exception,&status);
+  convolve_info->context=clCreateContextFromType((cl_context_properties *)
+    NULL,CL_DEVICE_TYPE_GPU,ConvolveNotify,exception,&status);
   if ((convolve_info->context == (cl_context) NULL) || (status != CL_SUCCESS))
     convolve_info->context=clCreateContextFromType((cl_context_properties *)
       NULL,CL_DEVICE_TYPE_CPU,ConvolveNotify,exception,&status);
@@ -496,7 +496,7 @@ static ConvolveInfo *GetConvolveInfo(const Image *image,const char *name,
       NULL,CL_DEVICE_TYPE_DEFAULT,ConvolveNotify,exception,&status);
   if ((convolve_info->context == (cl_context) NULL) || (status != CL_SUCCESS))
     {
-      (void) ThrowMagickException(exception,GetMagickModule(),FilterError,
+      (void) ThrowMagickException(exception,GetMagickModule(),DelegateWarning,
         "failed to create OpenCL context","`%s' (%d)",image->filename,status);
       DestroyConvolveInfo(convolve_info);
       return((ConvolveInfo *) NULL);
@@ -566,7 +566,7 @@ static ConvolveInfo *GetConvolveInfo(const Image *image,const char *name,
         }
       status=clGetProgramBuildInfo(convolve_info->program,
         convolve_info->devices[0],CL_PROGRAM_BUILD_LOG,length,log,&length);
-      (void) ThrowMagickException(exception,GetMagickModule(),FilterError,
+      (void) ThrowMagickException(exception,GetMagickModule(),DelegateWarning,
         "failed to build OpenCL program","`%s' (%s)",image->filename,log);
       log=DestroyString(log);
       DestroyConvolveInfo(convolve_info);
index c7d3df3d986010a6f6dab7435f24c09678b0e972..39e2c4be163903cb4c7b79a51952d9a13e536b31 100644 (file)
@@ -216,7 +216,7 @@ MagickExport void CatchException(ExceptionInfo *exception)
       MagickWarning(p->severity,p->reason,p->description);
     if ((p->severity >= ErrorException) && (p->severity < FatalErrorException))
       MagickError(p->severity,p->reason,p->description);
-    if (exception->severity >= FatalErrorException)
+    if (p->severity >= FatalErrorException)
       MagickFatalError(p->severity,p->reason,p->description);
     p=(const ExceptionInfo *) GetNextValueInLinkedList((LinkedListInfo *)
       exception->exceptions);
@@ -946,7 +946,8 @@ MagickExport MagickBooleanType ThrowMagickExceptionList(
     reason[MaxTextExtent];
 
   const char
-    *locale;
+    *locale,
+    *type;
 
   int
     n;
@@ -972,8 +973,15 @@ MagickExport MagickBooleanType ThrowMagickExceptionList(
     reason[MaxTextExtent-1]='\0';
   status=LogMagickEvent(ExceptionEvent,module,function,line,"%s",reason);
   GetPathComponent(module,TailPath,path);
-  (void) FormatMagickString(message,MaxTextExtent,"%s @ %s/%s/%ld",reason,path,
-    function,line);
+  type="undefined";
+  if ((severity >= WarningException) && (severity < ErrorException))
+    type="warning";
+  if ((severity >= ErrorException) && (severity < FatalErrorException))
+    type="error";
+  if (severity >= FatalErrorException)
+    type="fatal";
+  (void) FormatMagickString(message,MaxTextExtent,"%s @ %s/%s/%s/%ld",reason,
+    type,path,function,line);
   (void) ThrowException(exception,severity,message,(char *) NULL);
   return(status);
 }