]> granicus.if.org Git - imagemagick/commitdiff
(no commit message)
authorcristy <urban-warrior@git.imagemagick.org>
Sun, 7 Dec 2014 15:11:28 +0000 (15:11 +0000)
committercristy <urban-warrior@git.imagemagick.org>
Sun, 7 Dec 2014 15:11:28 +0000 (15:11 +0000)
26 files changed:
MagickCore/accelerate.c
MagickCore/layer.c
MagickCore/matrix.c
MagickCore/morphology.c
MagickCore/nt-base.c
MagickCore/opencl.c
MagickCore/property.c
MagickCore/threshold.c
MagickWand/magick-cli.c
MagickWand/mogrify.c
MagickWand/operation.c
MagickWand/script-token.c
MagickWand/wandcli.c
api_examples/cli_operators.c
api_examples/cli_process.c
api_examples/magick_command.c
coders/mat.c
coders/meta.c
coders/msl.c
coders/pcx.c
coders/pict.c
coders/psd.c
coders/wmf.c
coders/wpg.c
coders/xpm.c
tests/drawtest.c

index ac39ab9bcb36484647f8bb04684f372f22eb8850..ac37294e819a3c72f7deb52b89c210876702980d 100644 (file)
@@ -1060,7 +1060,7 @@ static Image *ComputeBlurImage(const Image* image,const ChannelType channel,
         clStatus|=clEnv->library->clSetKernelArg(blurRowKernel,i++,sizeof(unsigned int),(void *)&kernelWidth);
         clStatus|=clEnv->library->clSetKernelArg(blurRowKernel,i++,sizeof(unsigned int),(void *)&imageColumns);
         clStatus|=clEnv->library->clSetKernelArg(blurRowKernel,i++,sizeof(unsigned int),(void *)&imageRows);
-        clStatus|=clEnv->library->clSetKernelArg(blurRowKernel,i++,sizeof(CLPixelPacket)*(chunkSize+kernel->width),(void *)NULL);
+        clStatus|=clEnv->library->clSetKernelArg(blurRowKernel,i++,sizeof(CLPixelPacket)*(chunkSize+kernel->width),(void *) NULL);
         if (clStatus != CL_SUCCESS)
         {
           (void) OpenCLThrowMagickException(exception, GetMagickModule(), ResourceLimitWarning, "clEnv->library->clSetKernelArg failed.", "'%s'", ".");
@@ -1106,7 +1106,7 @@ static Image *ComputeBlurImage(const Image* image,const ChannelType channel,
         clStatus|=clEnv->library->clSetKernelArg(blurColumnKernel,i++,sizeof(unsigned int),(void *)&kernelWidth);
         clStatus|=clEnv->library->clSetKernelArg(blurColumnKernel,i++,sizeof(unsigned int),(void *)&imageColumns);
         clStatus|=clEnv->library->clSetKernelArg(blurColumnKernel,i++,sizeof(unsigned int),(void *)&imageRows);
-        clStatus|=clEnv->library->clSetKernelArg(blurColumnKernel,i++,sizeof(cl_float4)*(chunkSize+kernel->width),(void *)NULL);
+        clStatus|=clEnv->library->clSetKernelArg(blurColumnKernel,i++,sizeof(cl_float4)*(chunkSize+kernel->width),(void *) NULL);
         if (clStatus != CL_SUCCESS)
         {
           (void) OpenCLThrowMagickException(exception, GetMagickModule(), ResourceLimitWarning, "clEnv->library->clSetKernelArg failed.", "'%s'", ".");
@@ -1418,7 +1418,7 @@ static Image* ComputeBlurImageSection(const Image* image,
           clStatus|=clEnv->library->clSetKernelArg(blurRowKernel,i++,sizeof(unsigned int),(void *)&kernelWidth);
           clStatus|=clEnv->library->clSetKernelArg(blurRowKernel,i++,sizeof(unsigned int),(void *)&imageColumns);
           clStatus|=clEnv->library->clSetKernelArg(blurRowKernel,i++,sizeof(unsigned int),(void *)&imageRows);
-          clStatus|=clEnv->library->clSetKernelArg(blurRowKernel,i++,sizeof(CLPixelPacket)*(chunkSize+kernel->width),(void *)NULL);
+          clStatus|=clEnv->library->clSetKernelArg(blurRowKernel,i++,sizeof(CLPixelPacket)*(chunkSize+kernel->width),(void *) NULL);
           clStatus|=clEnv->library->clSetKernelArg(blurRowKernel,i++,sizeof(unsigned int),(void *)&offsetRows);
           clStatus|=clEnv->library->clSetKernelArg(blurRowKernel,i++,sizeof(unsigned int),(void *)&sec);
           if (clStatus != CL_SUCCESS)
@@ -1472,7 +1472,7 @@ static Image* ComputeBlurImageSection(const Image* image,
           clStatus|=clEnv->library->clSetKernelArg(blurColumnKernel,i++,sizeof(unsigned int),(void *)&kernelWidth);
           clStatus|=clEnv->library->clSetKernelArg(blurColumnKernel,i++,sizeof(unsigned int),(void *)&imageColumns);
           clStatus|=clEnv->library->clSetKernelArg(blurColumnKernel,i++,sizeof(unsigned int),(void *)&imageRows);
-          clStatus|=clEnv->library->clSetKernelArg(blurColumnKernel,i++,sizeof(cl_float4)*(chunkSize+kernel->width),(void *)NULL);
+          clStatus|=clEnv->library->clSetKernelArg(blurColumnKernel,i++,sizeof(cl_float4)*(chunkSize+kernel->width),(void *) NULL);
           clStatus|=clEnv->library->clSetKernelArg(blurColumnKernel,i++,sizeof(unsigned int),(void *)&offsetRows);
           clStatus|=clEnv->library->clSetKernelArg(blurColumnKernel,i++,sizeof(unsigned int),(void *)&sec);
           if (clStatus != CL_SUCCESS)
@@ -2211,7 +2211,7 @@ static Image *ComputeUnsharpMaskImage(const Image *image,
       clStatus|=clEnv->library->clSetKernelArg(blurRowKernel,i++,sizeof(unsigned int),(void *)&kernelWidth);
       clStatus|=clEnv->library->clSetKernelArg(blurRowKernel,i++,sizeof(unsigned int),(void *)&imageColumns);
       clStatus|=clEnv->library->clSetKernelArg(blurRowKernel,i++,sizeof(unsigned int),(void *)&imageRows);
-      clStatus|=clEnv->library->clSetKernelArg(blurRowKernel,i++,sizeof(CLPixelPacket)*(chunkSize+kernel->width),(void *)NULL);
+      clStatus|=clEnv->library->clSetKernelArg(blurRowKernel,i++,sizeof(CLPixelPacket)*(chunkSize+kernel->width),(void *) NULL);
       if (clStatus != CL_SUCCESS)
       {
         (void) OpenCLThrowMagickException(exception, GetMagickModule(), ResourceLimitWarning, "clEnv->library->clSetKernelArg failed.", "'%s'", ".");
@@ -2582,7 +2582,7 @@ static Image *ComputeUnsharpMaskImageSection(const Image *image,
         clStatus|=clEnv->library->clSetKernelArg(blurRowKernel,i++,sizeof(unsigned int),(void *)&kernelWidth);
         clStatus|=clEnv->library->clSetKernelArg(blurRowKernel,i++,sizeof(unsigned int),(void *)&imageColumns);
         clStatus|=clEnv->library->clSetKernelArg(blurRowKernel,i++,sizeof(unsigned int),(void *)&imageRows);
-        clStatus|=clEnv->library->clSetKernelArg(blurRowKernel,i++,sizeof(CLPixelPacket)*(chunkSize+kernel->width),(void *)NULL);
+        clStatus|=clEnv->library->clSetKernelArg(blurRowKernel,i++,sizeof(CLPixelPacket)*(chunkSize+kernel->width),(void *) NULL);
         clStatus|=clEnv->library->clSetKernelArg(blurRowKernel,i++,sizeof(unsigned int),(void *)&offsetRows);
         clStatus|=clEnv->library->clSetKernelArg(blurRowKernel,i++,sizeof(unsigned int),(void *)&sec);
         if (clStatus != CL_SUCCESS)
@@ -2929,7 +2929,7 @@ static Image *ComputeUnsharpMaskImageSingle(const Image *image,
       clStatus|=clEnv->library->clSetKernelArg(unsharpMaskKernel,i++,sizeof(unsigned int),(void *)&kernelWidth);
       clStatus|=clEnv->library->clSetKernelArg(unsharpMaskKernel,i++,sizeof(unsigned int),(void *)&imageColumns);
       clStatus|=clEnv->library->clSetKernelArg(unsharpMaskKernel,i++,sizeof(unsigned int),(void *)&imageRows);
-      clStatus|=clEnv->library->clSetKernelArg(unsharpMaskKernel,i++,sizeof(cl_float4)*(8 * (32 + kernel->width)),(void *)NULL);
+      clStatus|=clEnv->library->clSetKernelArg(unsharpMaskKernel,i++,sizeof(cl_float4)*(8 * (32 + kernel->width)),(void *) NULL);
       clStatus|=clEnv->library->clSetKernelArg(unsharpMaskKernel,i++,sizeof(float),(void *)&fGain);
       clStatus|=clEnv->library->clSetKernelArg(unsharpMaskKernel,i++,sizeof(float),(void *)&fThreshold);
       clStatus|=clEnv->library->clSetKernelArg(unsharpMaskKernel,i++,sizeof(cl_uint),(void *)&justBlur);
index 4a1236765fb1e5a94b73f791cc56f4f778d9b07a..d15a0311878b51943bb5dc5c64b29e84dc82d9fb 100644 (file)
@@ -1014,8 +1014,8 @@ static Image *OptimizeLayerFrames(const Image *image,
     Compute the bounding box of changes for each pair of images.
   */
   i=1;
-  bgnd_image=(Image *)NULL;
-  dup_image=(Image *)NULL;
+  bgnd_image=(Image *) NULL;
+  dup_image=(Image *) NULL;
   dup_bounds.width=0;
   dup_bounds.height=0;
   dup_bounds.x=0;
@@ -1268,7 +1268,7 @@ static Image *OptimizeLayerFrames(const Image *image,
         if ( disposals[i-1] != PreviousDispose )
           prev_image=DestroyImage(prev_image);
         if ( disposals[i-1] == BackgroundDispose )
-          prev_image=bgnd_image,  bgnd_image=(Image *)NULL;
+          prev_image=bgnd_image,  bgnd_image=(Image *) NULL;
         if (bgnd_image != (Image *) NULL)
           bgnd_image=DestroyImage(bgnd_image);
         if ( disposals[i-1] == NoneDispose )
index defcd2beb2a1f6781c8868c1ca293c7f7f02977c..7d1a2a7a5f7033e038a25328554dd5a0e230b972 100644 (file)
@@ -335,7 +335,7 @@ MagickExport double **AcquireMagickMatrix(const size_t number_rows,
 
   matrix=(double **) AcquireQuantumMemory(number_rows,sizeof(*matrix));
   if (matrix == (double **) NULL)
-    return((double **)NULL);
+    return((double **) NULL);
   for (i=0; i < (ssize_t) number_rows; i++)
   {
     matrix[i]=(double *) AcquireQuantumMemory(size,sizeof(*matrix[i]));
index b266d88527cfdf23ef2eecad4e9d92fe9b5e9f32..acf863ad61ea6a38c700a96232f6b7340f6b6d6e 100644 (file)
@@ -244,7 +244,7 @@ static KernelInfo *ParseKernelArray(const char *kernel_string)
     args;
 
   kernel=(KernelInfo *) AcquireQuantumMemory(1,sizeof(*kernel));
-  if (kernel == (KernelInfo *)NULL)
+  if (kernel == (KernelInfo *) NULL)
     return(kernel);
   (void) ResetMagickMemory(kernel,0,sizeof(*kernel));
   kernel->minimum = kernel->maximum = kernel->angle = 0.0;
@@ -404,7 +404,7 @@ static KernelInfo *ParseKernelName(const char *kernel_string,
   GetMagickToken(kernel_string,&p,token);
   type=ParseCommandOption(MagickKernelOptions,MagickFalse,token);
   if ( type < 0 || type == UserDefinedKernel )
-    return((KernelInfo *)NULL);  /* not a valid named kernel */
+    return((KernelInfo *) NULL);  /* not a valid named kernel */
 
   while (((isspace((int) ((unsigned char) *p)) != 0) ||
           (*p == ',') || (*p == ':' )) && (*p != '\0') && (*p != ';'))
@@ -977,7 +977,7 @@ MagickExport KernelInfo *AcquireKernelBuiltIn(const KernelInfoType type,
   switch(type) {
     case UndefinedKernel:    /* These should not call this function */
     case UserDefinedKernel:
-      assert("Should not call this function" != (char *)NULL);
+      assert("Should not call this function" != (char *) NULL);
       break;
     case LaplacianKernel:   /* Named Descrete Convolution Kernels */
     case SobelKernel:       /* these are defined using other kernels */
@@ -3683,7 +3683,7 @@ MagickPrivate Image *MorphologyApply(const Image *image,
 
   count = 0;      /* number of low-level morphology primitives performed */
   if ( iterations == 0 )
-    return((Image *)NULL);   /* null operation - nothing to do! */
+    return((Image *) NULL);   /* null operation - nothing to do! */
 
   kernel_limit = (size_t) iterations;
   if ( iterations < 0 )  /* negative interations = infinite (well alomst) */
@@ -4162,7 +4162,7 @@ MagickExport Image *MorphologyImage(const Image *image,
 
       /* Scale kernel according to user wishes */
       artifact = GetImageArtifact(image,"convolve:scale");
-      if ( artifact != (const char *)NULL ) {
+      if ( artifact != (const char *) NULL ) {
         if (IfMagickFalse(IsGeometry(artifact)))
           (void) ThrowMagickException(exception,GetMagickModule(),
                OptionWarning,"InvalidSetting","'%s' '%s'",
index 448d15331784e77f2a69e888c5e7a46e8159ffd0..fadd42fd28eee9bc5f2b2852b0a669b2040121ca 100644 (file)
@@ -1588,7 +1588,7 @@ MagickPrivate DIR *NTOpenDirectory(const char *path)
   if (length == 0)
     return((DIR *) NULL);
   if(wcsncat(file_specification,(const wchar_t*) DirectorySeparator,
-       MaxTextExtent-wcslen(file_specification)-1) == (wchar_t*)NULL)
+       MaxTextExtent-wcslen(file_specification)-1) == (wchar_t*) NULL)
     return((DIR *) NULL);
   entry=(DIR *) AcquireMagickMemory(sizeof(DIR));
   if (entry != (DIR *) NULL)
@@ -1599,7 +1599,7 @@ MagickPrivate DIR *NTOpenDirectory(const char *path)
   if (entry->hSearch == INVALID_HANDLE_VALUE)
     {
       if(wcsncat(file_specification,L"*.*",
-        MaxTextExtent-wcslen(file_specification)-1) == (wchar_t*)NULL)
+        MaxTextExtent-wcslen(file_specification)-1) == (wchar_t*) NULL)
         {
           entry=(DIR *) RelinquishMagickMemory(entry);
           return((DIR *) NULL);
index ecfefb7687339ddf43819931086a85434ea88220..e7a1e1c0af894d0b9978ec5514fd243b096e16b2 100644 (file)
@@ -198,7 +198,7 @@ MagickExport MagickCLEnv AcquireMagickOpenCLEnv()
 
 MagickExport MagickBooleanType RelinquishMagickOpenCLEnv(MagickCLEnv clEnv)
 {
-  if (clEnv != (MagickCLEnv)NULL)
+  if (clEnv != (MagickCLEnv) NULL)
   {
     RelinquishSemaphoreInfo(&clEnv->lock);
     RelinquishMagickMemory(clEnv);
@@ -2725,7 +2725,7 @@ MagickPrivate cl_kernel AcquireOpenCLKernel(
   magick_unreferenced(program);
   magick_unreferenced(kernelName);
 
-  return (cl_kernel)NULL;
+  return (cl_kernel) NULL;
 }
 
 MagickPrivate MagickBooleanType RelinquishOpenCLKernel(
index 03ebf2980aa18b6ad67011e1dcb30fba20340aec..1b9755105389eb3512a761e67148fe46f87032e6 100644 (file)
@@ -2214,13 +2214,13 @@ MagickExport const char *GetImageProperty(const Image *image,
   if (image == (Image *) NULL ) { \
     (void) ThrowMagickException(exception,GetMagickModule(),OptionWarning, \
         "NoImageForProperty",format,arg); \
-    return((const char *)NULL); \
+    return((const char *) NULL); \
   }
 #define WarnNoImageInfoReturn(format,arg) \
   if (image_info == (ImageInfo *) NULL ) { \
     (void) ThrowMagickException(exception,GetMagickModule(),OptionWarning, \
         "NoImageInfoForProperty",format,arg); \
-    return((const char *)NULL); \
+    return((const char *) NULL); \
   }
 
 static const char *GetMagickPropertyLetter(ImageInfo *image_info,
@@ -2375,7 +2375,7 @@ static const char *GetMagickPropertyLetter(ImageInfo *image_info,
       if (image_info->number_scenes != 0)
         (void) FormatLocaleString(value,MaxTextExtent,"%.20g",(double)
           image_info->scene);
-      else if (image != (Image *)NULL)
+      else if (image != (Image *) NULL)
         (void) FormatLocaleString(value,MaxTextExtent,"%.20g",(double)
           image->scene);
       else
@@ -2578,7 +2578,7 @@ static const char *GetMagickPropertyLetter(ImageInfo *image_info,
       /*
         Create a cloned copy of result.
       */
-      if (image != (Image *)NULL)
+      if (image != (Image *) NULL)
         {
           (void) SetImageArtifact(image,"get-property",value);
           return(GetImageArtifact(image,"get-property"));
@@ -2589,7 +2589,7 @@ static const char *GetMagickPropertyLetter(ImageInfo *image_info,
           return(GetImageOption(image_info,"get-property"));
         }
     }
-  return((char *)NULL);
+  return((char *) NULL);
 }
 
 MagickExport const char *GetMagickProperty(ImageInfo *image_info,
@@ -2602,7 +2602,7 @@ MagickExport const char *GetMagickProperty(ImageInfo *image_info,
     *string;
 
   assert(property[0] != '\0');
-  assert(image != (Image *)NULL || image_info != (ImageInfo *)NULL );
+  assert(image != (Image *) NULL || image_info != (ImageInfo *) NULL );
 
   if (property[1] == '\0')  /* single letter property request */
     return(GetMagickPropertyLetter(image_info,image,*property,exception));
@@ -3051,7 +3051,7 @@ MagickExport const char *GetMagickProperty(ImageInfo *image_info,
   if (*value != '\0')
   {
     /* create a cloned copy of result, that will get cleaned up, eventually */
-    if (image != (Image *)NULL)
+    if (image != (Image *) NULL)
       {
         (void) SetImageArtifact(image,"get-property",value);
         return(GetImageArtifact(image,"get-property"));
@@ -3062,7 +3062,7 @@ MagickExport const char *GetMagickProperty(ImageInfo *image_info,
         return(GetImageOption(image_info,"get-property"));
       }
   }
-  return((char *)NULL);
+  return((char *) NULL);
 }
 #undef WarnNoImageReturn
 \f
@@ -3164,7 +3164,7 @@ DisableMSCWarning(4127) \
        interpret_text=(char *) ResizeQuantumMemory(interpret_text, \
              extent+MaxTextExtent,sizeof(*interpret_text)); \
        if (interpret_text == (char *) NULL) \
-         return((char *)NULL); \
+         return((char *) NULL); \
        q=interpret_text+strlen(interpret_text); \
    } } while (0)  /* no trailing ; */ \
 RestoreMSCWarning
@@ -3178,7 +3178,7 @@ DisableMSCWarning(4127) \
        interpret_text=(char *) ResizeQuantumMemory(interpret_text, \
              extent+MaxTextExtent,sizeof(*interpret_text)); \
        if (interpret_text == (char *) NULL) \
-         return((char *)NULL); \
+         return((char *) NULL); \
        q=interpret_text+strlen(interpret_text); \
       } \
      (void) CopyMagickString(q,(string),extent); \
@@ -3195,7 +3195,7 @@ DisableMSCWarning(4127) \
       interpret_text=(char *) ResizeQuantumMemory(interpret_text, \
               extent+MaxTextExtent,sizeof(*interpret_text)); \
       if (interpret_text == (char *) NULL) \
-        return((char *)NULL); \
+        return((char *) NULL); \
       q=interpret_text+strlen(interpret_text); \
      } \
      q+=FormatLocaleString(q,extent,"%s=%s\n",(key),(string)); \
@@ -3394,7 +3394,7 @@ MagickExport char *InterpretImageProperties(ImageInfo *image_info,
         (void) ThrowMagickException(exception,GetMagickModule(),
             OptionError,"UnbalancedBraces","\"%%[%s\"",pattern);
         interpret_text=DestroyString(interpret_text);
-        return((char *)NULL);
+        return((char *) NULL);
       }
 
       /*
@@ -3569,7 +3569,7 @@ MagickExport char *InterpretImageProperties(ImageInfo *image_info,
          This handles attributes, properties, and profiles such as %[exif:...]
          Note the profile properties may also include a glob expansion pattern.
       */
-      if ( image != (Image *)NULL )
+      if ( image != (Image *) NULL )
         {
           string=GetImageProperty(image,pattern,exception);
           if (string != (const char *) NULL)
@@ -3616,7 +3616,7 @@ MagickExport char *InterpretImageProperties(ImageInfo *image_info,
         Look for a per-image Artifact
         This includes option lookup (FUTURE: interpreted according to image)
       */
-      if (image != (Image *)NULL)
+      if (image != (Image *) NULL)
         {
           string=GetImageArtifact(image,pattern);
           if (string != (char *) NULL)
index c13e476ca0ffa2f42ec676d8ad49d8c41effaad2..e4113536248a61ede623e768f5db39b69fded000 100644 (file)
@@ -1143,12 +1143,12 @@ MagickBooleanType ListThresholdMapFile(FILE *file,const char *xml,
     *threshold,
     *thresholds;
 
-  assert( xml != (char *)NULL );
-  assert( file != (FILE *)NULL );
+  assert( xml != (char *) NULL );
+  assert( file != (FILE *) NULL );
   (void) LogMagickEvent(ConfigureEvent,GetMagickModule(),
     "Loading threshold map file \"%s\" ...",filename);
   thresholds=NewXMLTree(xml,exception);
-  if ( thresholds == (XMLTreeInfo *)NULL )
+  if ( thresholds == (XMLTreeInfo *) NULL )
     return(MagickFalse);
   (void) FormatLocaleFile(file,"%-16s %-12s %s\n","Map","Alias","Description");
   (void) FormatLocaleFile(file,
index fe188727e8c83abd34448f1bc6c3bf1649cdc500..9f2eebaee34f8a1fa9ec2f8312c158186fb2f969 100644 (file)
@@ -125,7 +125,7 @@ WandExport void ProcessScriptOptions(MagickCLI *cli_wand,const char *filename,
     *arg1,
     *arg2;
 
-  assert(filename != (char *)NULL ); /* at least one argument - script name */
+  assert(filename != (char *) NULL ); /* at least one argument - script name */
   assert(cli_wand != (MagickCLI *) NULL);
   assert(cli_wand->signature == WandSignature);
   if (IfMagickTrue(cli_wand->wand.debug))
@@ -148,7 +148,7 @@ WandExport void ProcessScriptOptions(MagickCLI *cli_wand,const char *filename,
     cli_wand->filename=filename;
 
   /* Process Options from Script */
-  option = arg1 = arg2 = (char*)NULL;
+  option = arg1 = arg2 = (char*) NULL;
 DisableMSCWarning(4127)
   while (1) {
 RestoreMSCWarning
@@ -183,7 +183,7 @@ RestoreMSCWarning
 #endif
         if ( IfMagickFalse(IsCommandOption(option))) {
           /* non-option -- treat as a image read */
-          cli_wand->command=(const OptionInfo *)NULL;
+          cli_wand->command=(const OptionInfo *) NULL;
           CLIOption(cli_wand,"-read",option);
           break; /* next option */
         }
@@ -197,7 +197,7 @@ RestoreMSCWarning
         CloneString(&arg1,token_info->token);
       }
       else
-        CloneString(&arg1,(char *)NULL);
+        CloneString(&arg1,(char *) NULL);
 
       if ( count >= 2 ) {
         if( IfMagickFalse(GetScriptToken(token_info)) )
@@ -205,7 +205,7 @@ RestoreMSCWarning
         CloneString(&arg2,token_info->token);
       }
       else
-        CloneString(&arg2,(char *)NULL);
+        CloneString(&arg2,(char *) NULL);
 
       /*
         Process Options
@@ -270,9 +270,9 @@ loop_exit:
   switch( token_info->status ) {
     case TokenStatusOK:
     case TokenStatusEOF:
-      if (cli_wand->image_list_stack != (Stack *)NULL)
+      if (cli_wand->image_list_stack != (Stack *) NULL)
         CLIWandException(OptionError,"UnbalancedParenthesis", "(eof)");
-      else if (cli_wand->image_info_stack != (Stack *)NULL)
+      else if (cli_wand->image_info_stack != (Stack *) NULL)
         CLIWandException(OptionError,"UnbalancedBraces", "(eof)");
       break;
     case TokenStatusBadQuotes:
@@ -302,9 +302,9 @@ loop_exit:
   /* Clean up */
   token_info = DestroyScriptTokenInfo(token_info);
 
-  CloneString(&option,(char *)NULL);
-  CloneString(&arg1,(char *)NULL);
-  CloneString(&arg2,(char *)NULL);
+  CloneString(&option,(char *) NULL);
+  CloneString(&arg1,(char *) NULL);
+  CloneString(&arg2,(char *) NULL);
 
   return;
 }
@@ -369,9 +369,9 @@ WandExport int ProcessCommandOptions(MagickCLI *cli_wand,int argc,char **argv,
     option_type;
 
   assert(argc>=index); /* you may have no arguments left! */
-  assert(argv != (char **)NULL);
-  assert(argv[index] != (char *)NULL);
-  assert(argv[argc-1] != (char *)NULL);
+  assert(argv != (char **) NULL);
+  assert(argv[index] != (char *) NULL);
+  assert(argv[argc-1] != (char *) NULL);
   assert(cli_wand != (MagickCLI *) NULL);
   assert(cli_wand->signature == WandSignature);
 
@@ -417,7 +417,7 @@ WandExport int ProcessCommandOptions(MagickCLI *cli_wand,int argc,char **argv,
         if ( IfMagickFalse(IsCommandOption(option)) ) {
           if ( (cli_wand->process_flags & ProcessImplictRead) != 0 ) {
             /* non-option -- treat as a image read */
-            cli_wand->command=(const OptionInfo *)NULL;
+            cli_wand->command=(const OptionInfo *) NULL;
             CLIOption(cli_wand,"-read",option);
             break; /* next option */
           }
@@ -447,8 +447,8 @@ WandExport int ProcessCommandOptions(MagickCLI *cli_wand,int argc,char **argv,
         break; /* next option - not that their is any! */
       }
 
-      arg1 = ( count >= 1 ) ? argv[i+1] : (char *)NULL;
-      arg2 = ( count >= 2 ) ? argv[i+2] : (char *)NULL;
+      arg1 = ( count >= 1 ) ? argv[i+1] : (char *) NULL;
+      arg2 = ( count >= 2 ) ? argv[i+2] : (char *) NULL;
 
       /*
         Process Known Options
@@ -498,9 +498,9 @@ RestoreMSCWarning
   cli_wand->line=i;
 
   /* check that stacks are empty - or cause exception */
-  if (cli_wand->image_list_stack != (Stack *)NULL)
+  if (cli_wand->image_list_stack != (Stack *) NULL)
     CLIWandException(OptionError,"UnbalancedParenthesis", "(end of cli)");
-  else if (cli_wand->image_info_stack != (Stack *)NULL)
+  else if (cli_wand->image_info_stack != (Stack *) NULL)
     CLIWandException(OptionError,"UnbalancedBraces", "(end of cli)");
   if ( CLICatchException(cli_wand, MagickFalse) != MagickFalse )
     return(argc);
@@ -522,7 +522,7 @@ RestoreMSCWarning
     return(argc);
   }
 
-  cli_wand->command=(const OptionInfo *)NULL;
+  cli_wand->command=(const OptionInfo *) NULL;
   CLIOption(cli_wand,"-write",option);
   return(argc);
 }
@@ -684,7 +684,7 @@ WandExport MagickBooleanType MagickImageCommand(ImageInfo *image_info,int argc,
   size_t
     len;
 
-  assert(image_info != (ImageInfo *)NULL);
+  assert(image_info != (ImageInfo *) NULL);
 
   /* For specific OS command line requirements */
   ReadCommandlLine(argc,&argv);
@@ -796,9 +796,9 @@ Magick_Command_Cleanup:
 
   /* recover original image_info and clean up stacks
      FUTURE: "-reset stacks" option  */
-  while (cli_wand->image_list_stack != (Stack *)NULL)
+  while (cli_wand->image_list_stack != (Stack *) NULL)
     CLIOption(cli_wand,")");
-  while (cli_wand->image_info_stack != (Stack *)NULL)
+  while (cli_wand->image_info_stack != (Stack *) NULL)
     CLIOption(cli_wand,"}");
 
   /* assert we have recovered the original structures */
@@ -834,8 +834,8 @@ Magick_Command_Exit:
          "\"%s\"",argv[0]);
 
   /* Destroy the special CLI Wand */
-  cli_wand->wand.image_info = (ImageInfo *)NULL; /* not these */
-  cli_wand->wand.exception = (ExceptionInfo *)NULL;
+  cli_wand->wand.image_info = (ImageInfo *) NULL; /* not these */
+  cli_wand->wand.exception = (ExceptionInfo *) NULL;
   cli_wand=DestroyMagickCLI(cli_wand);
 
   return(IsMagickTrue(exception->severity < ErrorException));
index d8a5d46aafbd26162e5eaa95a7048baafd6454c4..b110bfb39b443e50bff88e6ecd780e1f42261595 100644 (file)
@@ -499,7 +499,7 @@ static Image *SparseColorOption(const Image *image,
         (void) ThrowMagickException(exception,GetMagickModule(),
             OptionError, "InvalidArgument", "'%s': %s", "sparse-color",
             "Color arg given, when colors are coming from image");
-        return( (Image *)NULL);
+        return( (Image *) NULL);
       }
       x += number_colors;  /* color argument */
     }
@@ -522,7 +522,7 @@ static Image *SparseColorOption(const Image *image,
     (void) ThrowMagickException(exception,GetMagickModule(),
                OptionError, "InvalidArgument", "'%s': %s", "sparse-color",
                "Invalid number of Arguments");
-    return( (Image *)NULL);
+    return( (Image *) NULL);
   }
 
   /* Allocate and fill in the floating point arguments */
@@ -531,7 +531,7 @@ static Image *SparseColorOption(const Image *image,
   if (sparse_arguments == (double *) NULL) {
     (void) ThrowMagickException(exception,GetMagickModule(),ResourceLimitError,
       "MemoryAllocationFailed","%s","SparseColorOption");
-    return( (Image *)NULL);
+    return( (Image *) NULL);
   }
   (void) ResetMagickMemory(sparse_arguments,0,number_arguments*
     sizeof(*sparse_arguments));
@@ -640,10 +640,10 @@ static Image *SparseColorOption(const Image *image,
     (void) ThrowMagickException(exception,GetMagickModule(),OptionError,
       "InvalidArgument","'%s': %s","sparse-color","Argument Parsing Error");
     sparse_arguments=(double *) RelinquishMagickMemory(sparse_arguments);
-    return( (Image *)NULL);
+    return( (Image *) NULL);
   }
   if ( error )
-    return( (Image *)NULL);
+    return( (Image *) NULL);
 
   /* Call the Interpolation function with the parsed arguments */
   sparse_image=SparseColorImage(image,method,number_arguments,sparse_arguments,
@@ -741,7 +741,7 @@ WandExport MagickBooleanType MogrifyImage(ImageInfo *image_info,const int argc,
     if ((i+count) >= (ssize_t) argc)
       break;
     status=MogrifyImageInfo(mogrify_info,(int) count+1,argv+i,exception);
-    mogrify_image=(Image *)NULL;
+    mogrify_image=(Image *) NULL;
     switch (*(option+1))
     {
       case 'a':
index d9e0c10bb49c10899650c70b9f5ff65d18e97800..e2701d551401d18619d89cbe2c4569a15cf459c5 100644 (file)
@@ -243,7 +243,7 @@ static Image *SparseColorOption(const Image *image,
     (void) ThrowMagickException(exception,GetMagickModule(),
                OptionError, "InvalidArgument", "'%s': %s", "sparse-color",
                "Invalid number of Arguments");
-    return( (Image *)NULL);
+    return( (Image *) NULL);
   }
 
   /* Allocate and fill in the floating point arguments */
@@ -252,7 +252,7 @@ static Image *SparseColorOption(const Image *image,
   if (sparse_arguments == (double *) NULL) {
     (void) ThrowMagickException(exception,GetMagickModule(),ResourceLimitError,
       "MemoryAllocationFailed","%s","SparseColorOption");
-    return( (Image *)NULL);
+    return( (Image *) NULL);
   }
   (void) ResetMagickMemory(sparse_arguments,0,number_arguments*
     sizeof(*sparse_arguments));
@@ -352,10 +352,10 @@ static Image *SparseColorOption(const Image *image,
     (void) ThrowMagickException(exception,GetMagickModule(),OptionError,
       "InvalidArgument","'%s': %s","sparse-color","Argument Parsing Error");
     sparse_arguments=(double *) RelinquishMagickMemory(sparse_arguments);
-    return( (Image *)NULL);
+    return( (Image *) NULL);
   }
   if ( error )
-    return( (Image *)NULL);
+    return( (Image *) NULL);
 
   /* Call the Sparse Color Interpolation function with the parsed arguments */
   sparse_image=SparseColorImage(image,method,number_arguments,sparse_arguments,
@@ -1735,7 +1735,7 @@ static MagickBooleanType CLISimpleOperatorImage(MagickCLI *cli_wand,
     "CLISimpleOperatorImage: \"%s\" \"%s\" \"%s\"\n",option,arg1,arg2);
 #endif
 
-  new_image = (Image *)NULL; /* the replacement image, if not null at end */
+  new_image = (Image *) NULL; /* the replacement image, if not null at end */
   SetGeometryInfo(&geometry_info);
 
   switch (*(option+1))
@@ -2252,7 +2252,7 @@ static MagickBooleanType CLISimpleOperatorImage(MagickCLI *cli_wand,
             }
           /* convert argument string into an array of doubles */
           args = StringToArrayOfDoubles(arg2,&count,_exception);
-          if (args == (double *)NULL )
+          if (args == (double *) NULL )
             CLIWandExceptArgBreak(OptionError,"InvalidNumberList",option,arg2);
 
           new_image=DistortImage(_image,(DistortImageMethod) parse,(size_t)
@@ -2264,7 +2264,7 @@ static MagickBooleanType CLISimpleOperatorImage(MagickCLI *cli_wand,
         {
           (void) CloneString(&_draw_info->primitive,arg1);
           (void) DrawImage(_image,_draw_info,_exception);
-          (void) CloneString(&_draw_info->primitive,(char *)NULL);
+          (void) CloneString(&_draw_info->primitive,(char *) NULL);
           break;
         }
       CLIWandExceptionBreak(OptionError,"UnrecognizedOption",option);
@@ -2413,7 +2413,7 @@ static MagickBooleanType CLISimpleOperatorImage(MagickCLI *cli_wand,
                  option,arg1);
           /* convert argument string into an array of doubles */
           args = StringToArrayOfDoubles(arg2,&count,_exception);
-          if (args == (double *)NULL )
+          if (args == (double *) NULL )
             CLIWandExceptArgBreak(OptionError,"InvalidNumberList",option,arg2);
 
           (void) FunctionImage(_image,(MagickFunction)parse,(size_t) count,args,
@@ -3882,7 +3882,7 @@ WandPrivate MagickBooleanType CLIListOperatorImages(MagickCLI *cli_wand,
           else
             new_images=DuplicateImages(_images,1,"-1",_exception);
           AppendImageToList(&_images, new_images);
-          new_images=(Image *)NULL;
+          new_images=(Image *) NULL;
           break;
         }
       CLIWandExceptionBreak(OptionError,"UnrecognizedOption",option);
@@ -4184,7 +4184,7 @@ WandPrivate MagickBooleanType CLIListOperatorImages(MagickCLI *cli_wand,
 
           /* convert argument string into an array of doubles */
           args = StringToArrayOfDoubles(arg2,&count,_exception);
-          if (args == (double *)NULL )
+          if (args == (double *) NULL )
             CLIWandExceptArgBreak(OptionError,"InvalidNumberList",option,arg2);
           new_images=PolynomialImage(_images,(size_t) (count >> 1),args,_exception);
           args=(double *) RelinquishMagickMemory(args);
@@ -4321,7 +4321,7 @@ WandPrivate MagickBooleanType CLIListOperatorImages(MagickCLI *cli_wand,
           new_images=SimilarityImage(base_image,compare_image,metric,0.0,
                &offset,&similarity,_exception);
 
-          if ( new_images != (Image *)NULL ) {
+          if ( new_images != (Image *) NULL ) {
             char
               result[MaxTextExtent];
 
@@ -4612,7 +4612,7 @@ WandPrivate void CLINoImageOperator(MagickCLI *cli_wand,
 
       size=0;
       node=cli_wand->image_list_stack;
-      for ( ; node != (Stack *)NULL; node=node->next)
+      for ( ; node != (Stack *) NULL; node=node->next)
         size++;
       if ( size >= MAX_STACK_DEPTH )
         CLIWandExceptionBreak(OptionError,"ParenthesisNestedTooDeeply",option);
@@ -4643,7 +4643,7 @@ WandPrivate void CLINoImageOperator(MagickCLI *cli_wand,
 
       size=0;
       node=cli_wand->image_info_stack;
-      for ( ; node != (Stack *)NULL; node=node->next)
+      for ( ; node != (Stack *) NULL; node=node->next)
         size++;
       if ( size >= MAX_STACK_DEPTH )
         CLIWandExceptionBreak(OptionError,"CurlyBracesNestedTooDeeply",option);
@@ -4657,7 +4657,7 @@ WandPrivate void CLINoImageOperator(MagickCLI *cli_wand,
 
       cli_wand->image_info_stack = node;
       cli_wand->wand.image_info = CloneImageInfo(cli_wand->wand.image_info);
-      if (cli_wand->wand.image_info == (ImageInfo *)NULL) {
+      if (cli_wand->wand.image_info == (ImageInfo *) NULL) {
         CLIWandException(ResourceLimitFatalError,"MemoryAllocationFailed",
             option);
         cli_wand->wand.image_info = (ImageInfo *)node->data;
@@ -4673,7 +4673,7 @@ WandPrivate void CLINoImageOperator(MagickCLI *cli_wand,
         *node;
 
       node = (Stack *)cli_wand->image_list_stack;
-      if ( node == (Stack *)NULL)
+      if ( node == (Stack *) NULL)
         CLIWandExceptionBreak(OptionError,"UnbalancedParenthesis",option);
       cli_wand->image_list_stack = node->next;
 
@@ -4683,7 +4683,7 @@ WandPrivate void CLINoImageOperator(MagickCLI *cli_wand,
 
       /* handle respect-parenthesis - of the previous 'pushed' settings */
       node = cli_wand->image_info_stack;
-      if ( node != (Stack *)NULL)
+      if ( node != (Stack *) NULL)
         {
           if (IfMagickTrue(IsStringTrue(GetImageOption(
                 cli_wand->wand.image_info,"respect-parenthesis"))))
@@ -4701,7 +4701,7 @@ WandPrivate void CLINoImageOperator(MagickCLI *cli_wand,
         *node;
 
       node = (Stack *)cli_wand->image_info_stack;
-      if ( node == (Stack *)NULL)
+      if ( node == (Stack *) NULL)
         CLIWandExceptionBreak(OptionError,"UnbalancedCurlyBraces",option);
       cli_wand->image_info_stack = node->next;
 
@@ -4756,7 +4756,7 @@ WandPrivate void CLINoImageOperator(MagickCLI *cli_wand,
         if (LocaleNCompare(arg1,"option:",7) == 0)
           {
             /* delete equivelent artifact from all images (if any) */
-            if (_images != (Image *)NULL)
+            if (_images != (Image *) NULL)
               {
                 MagickResetIterator(&cli_wand->wand);
                 while ( IfMagickTrue(MagickNextImage(&cli_wand->wand)) )
@@ -4765,7 +4765,7 @@ WandPrivate void CLINoImageOperator(MagickCLI *cli_wand,
               }
             /* now set/delete the global option as needed */
             /* FUTURE: make escapes in a global 'option:' delayed */
-            arg2=(char *)NULL;
+            arg2=(char *) NULL;
             if (IfNormalOp)
               {
                 arg2=InterpretImageProperties(_image_info,_images,arg2n,_exception);
@@ -4785,7 +4785,7 @@ WandPrivate void CLINoImageOperator(MagickCLI *cli_wand,
         MagickResetIterator(&cli_wand->wand);
         while ( IfMagickTrue(MagickNextImage(&cli_wand->wand)) )
           {
-            arg2=(char *)NULL;
+            arg2=(char *) NULL;
             if (IfNormalOp)
               {
                 arg2=InterpretImageProperties(_image_info,_images,arg2n,_exception);
@@ -4813,7 +4813,7 @@ WandPrivate void CLINoImageOperator(MagickCLI *cli_wand,
           arg1=AcquireString("-1");
         if (IfMagickFalse(IsSceneGeometry(arg1,MagickFalse)))
           CLIWandExceptionBreak(OptionError,"InvalidArgument",option);
-        if ( cli_wand->image_list_stack == (Stack *)NULL)
+        if ( cli_wand->image_list_stack == (Stack *) NULL)
           CLIWandExceptionBreak(OptionError,"UnableToCloneImage",option);
         new_images = (Image *)cli_wand->image_list_stack->data;
         if (new_images == (Image *) NULL)
@@ -5042,7 +5042,7 @@ WandExport void CLIOption(MagickCLI *cli_wand,const char *option,...)
 
     /* FUTURE: this is temporary - get 'settings' to handle distribution of
       settings to images attributes,proprieties,artifacts */
-    if ( cli_wand->wand.images != (Image *)NULL )
+    if ( cli_wand->wand.images != (Image *) NULL )
       (void) SyncImagesSettings(cli_wand->wand.image_info,cli_wand->wand.images,
         cli_wand->wand.exception);
 
@@ -5058,14 +5058,14 @@ WandExport void CLIOption(MagickCLI *cli_wand,const char *option,...)
     /* FUTURE: The not a setting part below is a temporary hack due to
     * some options being both a Setting and a Simple operator.
     * Specifically -monitor, -depth, and  -colorspace */
-    if ( cli_wand->wand.images == (Image *)NULL )
+    if ( cli_wand->wand.images == (Image *) NULL )
       if ( ((option_type & (SimpleOperatorFlag|ListOperatorFlag)) != 0 ) &&
           ((option_type & SettingOptionFlags) == 0 ))  /* temp hack */
         CLIWandExceptionBreak(OptionError,"NoImagesFound",option);
 
     /* Operators which loop of individual images, simply */
     if ( (option_type & SimpleOperatorFlag) != 0 &&
-         cli_wand->wand.images != (Image *)NULL) /* temp hack */
+         cli_wand->wand.images != (Image *) NULL) /* temp hack */
       {
         ExceptionInfo *exception=AcquireExceptionInfo();
         (void) CLISimpleOperatorImages(cli_wand, option, arg1, arg2,exception);
index 38d8251ccb92ebefacbcb829303c4a6e61e137ce..c841bc4759c20a313a526822bc8129c2925d13d1 100644 (file)
@@ -224,7 +224,7 @@ WandExport ScriptTokenInfo *AcquireScriptTokenInfo(const char *filename)
   else {
     token_info->stream=fopen_utf8(filename, "r");
   }
-  if ( token_info->stream == (FILE *)NULL ) {
+  if ( token_info->stream == (FILE *) NULL ) {
     token_info=(ScriptTokenInfo *) RelinquishMagickMemory(token_info);
     return(token_info);
   }
@@ -233,7 +233,7 @@ WandExport ScriptTokenInfo *AcquireScriptTokenInfo(const char *filename)
   token_info->length=INITAL_TOKEN_LENGTH;
   token_info->token=(char *) AcquireMagickMemory(token_info->length);
 
-  token_info->status=(token_info->token != (char *)NULL)
+  token_info->status=(token_info->token != (char *) NULL)
                       ? TokenStatusOK : TokenStatusMemoryFailed;
   token_info->signature=WandSignature;
 
@@ -343,7 +343,7 @@ WandExport ScriptTokenInfo * DestroyScriptTokenInfo(ScriptTokenInfo *token_info)
       token_info->length *= 4; \
     token_info->token = (char *) \
          ResizeMagickMemory(token_info->token, token_info->length); \
-    if ( token_info->token == (char *)NULL ) { \
+    if ( token_info->token == (char *) NULL ) { \
       token_info->status=TokenStatusMemoryFailed; \
       break; \
     } \
@@ -393,7 +393,7 @@ RestoreMSCWarning
            ( token_info->curr_column==1 && (c == ':' || c == '@' ) ) )
         state=IN_COMMENT;
     /* whitespace token separator character */
-    if (strchr(" \n\r\t",c) != (char *)NULL) {
+    if (strchr(" \n\r\t",c) != (char *) NULL) {
       switch (state) {
         case IN_TOKEN:
           token_info->token[offset]='\0';
index 23f3bdeb6f2e9547c47b0e41761f2d2f2de3a0d3..b312e110fa2a075b4ae91b48304f5877fd2f63aa 100644 (file)
@@ -100,11 +100,11 @@ WandExport MagickCLI *AcquireMagickCLI(ImageInfo *image_info,
   (void) FormatLocaleString(cli_wand->wand.name,MaxTextExtent,
            "%s-%.20g","MagickWandCLI", (double) cli_wand->wand.id);
   cli_wand->wand.images=NewImageList();
-  if ( image_info == (ImageInfo *)NULL)
+  if ( image_info == (ImageInfo *) NULL)
     cli_wand->wand.image_info=AcquireImageInfo();
   else
     cli_wand->wand.image_info=image_info;
-  if ( exception == (ExceptionInfo *)NULL)
+  if ( exception == (ExceptionInfo *) NULL)
     cli_wand->wand.exception=AcquireExceptionInfo();
   else
     cli_wand->wand.exception=exception;
@@ -115,9 +115,9 @@ WandExport MagickCLI *AcquireMagickCLI(ImageInfo *image_info,
   cli_wand->draw_info=CloneDrawInfo(cli_wand->wand.image_info,(DrawInfo *) NULL);
   cli_wand->quantize_info=AcquireQuantizeInfo(cli_wand->wand.image_info);
   cli_wand->process_flags=MagickCommandOptionFlags;  /* assume "magick" CLI */
-  cli_wand->command=(const OptionInfo *)NULL;     /* no option at this time */
-  cli_wand->image_list_stack=(Stack *)NULL;
-  cli_wand->image_info_stack=(Stack *)NULL;
+  cli_wand->command=(const OptionInfo *) NULL;     /* no option at this time */
+  cli_wand->image_list_stack=(Stack *) NULL;
+  cli_wand->image_info_stack=(Stack *) NULL;
 
   /* default exception location...
      EG: sprintf(locaiton, filename, line, column);
@@ -170,14 +170,14 @@ WandExport MagickCLI *DestroyMagickCLI(MagickCLI *cli_wand)
     cli_wand->draw_info=DestroyDrawInfo(cli_wand->draw_info);
   if (cli_wand->quantize_info != (QuantizeInfo *) NULL )
     cli_wand->quantize_info=DestroyQuantizeInfo(cli_wand->quantize_info);
-  while(cli_wand->image_list_stack != (Stack *)NULL)
+  while(cli_wand->image_list_stack != (Stack *) NULL)
     {
       node=cli_wand->image_list_stack;
       cli_wand->image_list_stack=node->next;
       (void) DestroyImageList((Image *)node->data);
       (void) RelinquishMagickMemory(node);
     }
-  while(cli_wand->image_info_stack != (Stack *)NULL)
+  while(cli_wand->image_info_stack != (Stack *) NULL)
     {
       node=cli_wand->image_info_stack;
       cli_wand->image_info_stack=node->next;
@@ -195,7 +195,7 @@ WandExport MagickCLI *DestroyMagickCLI(MagickCLI *cli_wand)
   RelinquishWandId(cli_wand->wand.id);
   cli_wand->wand.signature=(~WandSignature);
 
-  return((MagickCLI *)NULL);
+  return((MagickCLI *) NULL);
 }
 \f
 /*
index 7cff593a6584f0d489fc026e6ec0e07e077e14c9..f16be94864e594dc49165aaf460fd61d027c32f6 100644 (file)
@@ -32,7 +32,7 @@ int main(int argc, char **argv)
 
   MagickCoreGenesis(argv[0],MagickFalse);
 
-  cli_wand = AcquireMagickCLI((ImageInfo *)NULL,(ExceptionInfo *)NULL);
+  cli_wand = AcquireMagickCLI((ImageInfo *) NULL,(ExceptionInfo *) NULL);
 
   CLISettingOptionInfo    (cli_wand, "-size", "100x100");
   CLISpecialOperator      (cli_wand, "-read", "xc:red");
index e7be3b2eb316dada91b30ed82284d28e3f4f8399..1eb662df8fda76d6b3a0676439a7c0481fc326e7 100644 (file)
@@ -32,11 +32,11 @@ int main(int argc, char **argv)
                    "(", "rose:", "-rotate", "-90", ")",
                    "+append", "show:", NULL };
 
-  for(arg_count = 0; args[arg_count] != (char *)NULL; arg_count++);
+  for(arg_count = 0; args[arg_count] != (char *) NULL; arg_count++);
 
 
   MagickCoreGenesis(argv[0],MagickFalse);
-  cli_wand = AcquireMagickCLI((ImageInfo *)NULL,(ExceptionInfo *)NULL);
+  cli_wand = AcquireMagickCLI((ImageInfo *) NULL,(ExceptionInfo *) NULL);
 
   ProcessCommandOptions(cli_wand, arg_count, args, 0, MagickCommandOptionFlags);
 
index c732cbe6aa044012f369a29b5cef0bc3cf3afe58..1b973458501774e5792b655d8c015235aa89db03 100644 (file)
@@ -39,7 +39,7 @@ int main(int argc, char **argv)
                      "(", "rose:", "-rotate", "-90", ")",
                      "+append", "show:", NULL };
 
-    for(arg_count = 0; args[arg_count] != (char *)NULL; arg_count++);
+    for(arg_count = 0; args[arg_count] != (char *) NULL; arg_count++);
 
     (void) MagickImageCommand(image_info, arg_count, args, NULL, exception);
 
index 001c4b09d6e5315a3eaa18dab14fef905123fc20..d5b9e892922b3a0ac88ceea61632766d991a7d8a 100644 (file)
@@ -887,7 +887,7 @@ RestoreMSCWarning
       for (i = 0; i < (ssize_t) MATLAB_HDR.SizeY; i++)
       {
         q=GetAuthenticPixels(image,0,MATLAB_HDR.SizeY-i-1,image->columns,1,exception);
-        if (q == (Quantum *)NULL)
+        if (q == (Quantum *) NULL)
   {
     if (logging) (void)LogMagickEvent(CoderEvent,GetMagickModule(),
               "  MAT set image pixels returns unexpected NULL on a row %u.", (unsigned)(MATLAB_HDR.SizeY-i-1));
@@ -1050,7 +1050,7 @@ done_reading:
     */
     p=image;
     image=NULL;
-    while (p != (Image *)NULL)
+    while (p != (Image *) NULL)
       {
         Image *tmp=p;
         if ((p->rows == 0) || (p->columns == 0)) {
index 17b38b1ba5057b433967744658c8d153cc2dce46..5f9c5f7d6c9615c64f367397d259a7efe711866a 100644 (file)
@@ -196,7 +196,7 @@ static int stringnicmp(const char *p,const char *q,size_t n)
 
 static int convertHTMLcodes(char *s, int len)
 {
-  if (len <=0 || s==(char*)NULL || *s=='\0')
+  if (len <=0 || s==(char*) NULL || *s=='\0')
     return 0;
 
   if (s[1] == '#')
@@ -326,7 +326,7 @@ static ssize_t parse8BIM(Image *ifile, Image *ofile)
   dataset = 0;
   recnum = 0;
   line = (char *) AcquireQuantumMemory((size_t) inputlen,sizeof(*line));
-  name = token = (char *)NULL;
+  name = token = (char *) NULL;
   savedpos = 0;
   token_info=AcquireTokenInfo();
   while (super_fgets(&line,&inputlen,ifile)!=NULL)
@@ -602,7 +602,7 @@ static ssize_t parse8BIMW(Image *ifile, Image *ofile)
   dataset = 0;
   recnum = 0;
   line=(char *) AcquireQuantumMemory((size_t) inputlen,sizeof(*line));
-  name = token = (char *)NULL;
+  name = token = (char *) NULL;
   savedpos = 0;
   token_info=AcquireTokenInfo();
   while (super_fgets_w(&line,&inputlen,ifile) != NULL)
@@ -991,7 +991,7 @@ static int jpeg_embed(Image *ifile, Image *ofile, Image *iptc)
         /* APP0 is in each and every JPEG, so when we hit APP0 we insert our new APP13! */
         jpeg_skip_variable(ifile, ofile);
 
-        if (iptc != (Image *)NULL)
+        if (iptc != (Image *) NULL)
           {
             char
               psheader[] = "\xFF\xED\0\0Photoshop 3.0\0" "8BIM\x04\x04\0\0\0\0";
index 03e081da7aac9084a537d8a5568172883beb00e1..d5de506c0913cdcbd6249a64d5f6a55a93eb256f 100644 (file)
@@ -6763,7 +6763,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
       else if (LocaleCompare((const char *) tag,"stegano") == 0)
       {
         Image *
-          watermark = (Image*)NULL;
+          watermark = (Image*) NULL;
 
         if (msl_info->image[n] == (Image *) NULL)
           {
@@ -6829,7 +6829,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
       else if (LocaleCompare((const char *) tag,"stereo") == 0)
       {
         Image *
-          stereoImage = (Image*)NULL;
+          stereoImage = (Image*) NULL;
 
         if (msl_info->image[n] == (Image *) NULL)
           {
index c7b261ef905311a7c466a2a6c5fe8bcdd709a82b..af394bc4db5d9b69c0bbc3ca0dc63a4307f15ba1 100644 (file)
@@ -401,7 +401,7 @@ static Image *ReadPCXImage(const ImageInfo *image_info,ExceptionInfo *exception)
       ThrowReaderException(CorruptImageError,"ImproperImageHeader");
     scanline=(unsigned char *) AcquireQuantumMemory(MagickMax(image->columns,
       pcx_info.bytes_per_line),MagickMax(8,pcx_info.planes)*sizeof(*scanline));
-    pixel_info=AcquireVirtualMemory(pcx_packets,sizeof(*pixels));
+    pixel_info=AcquireVirtualMemory(pcx_packets,2*sizeof(*pixels));
     if ((scanline == (unsigned char *) NULL) ||
         (pixel_info == (MemoryInfo *) NULL))
       {
index 437eb9ecc314b11eeddac53e66c961770d47bc85..83de8276f639a850d2dad7505c40da0829aac703 100644 (file)
@@ -474,7 +474,8 @@ static unsigned char *DecodeImage(Image *blob,Image *image,
     return((unsigned char *) NULL);
   *extent=row_bytes*image->rows*sizeof(*pixels);
   (void) ResetMagickMemory(pixels,0,*extent);
-  scanline=(unsigned char *) AcquireQuantumMemory(row_bytes,sizeof(*scanline));
+  scanline=(unsigned char *) AcquireQuantumMemory(row_bytes,2*
+    sizeof(*scanline));
   if (scanline == (unsigned char *) NULL)
     return((unsigned char *) NULL);
   if (bytes_per_line < 8)
index 2efab1806be4ae3a7c80b60b91a3e323bf70ce47..f97e449431e610904646e25e23945586a0c8a851 100644 (file)
@@ -50,6 +50,7 @@
 #include "MagickCore/cache.h"
 #include "MagickCore/channel.h"
 #include "MagickCore/colormap.h"
+#include "MagickCore/colormap-private.h"
 #include "MagickCore/colorspace.h"
 #include "MagickCore/colorspace-private.h"
 #include "MagickCore/constitute.h"
@@ -715,7 +716,7 @@ static MagickStatusType ReadPSDChannelPixels(Image *image,
             else
               SetPixelIndex(image,ScaleQuantumToShort(pixel),q);
             SetPixelInfoPixel(image,image->colormap+(ssize_t)
-              GetPixelIndex(image,q),q);
+              ConstrainColormapIndex(image,GetPixelIndex(image,q),exception),q);
             if (image->depth == 1)
               {
                 ssize_t
@@ -803,7 +804,7 @@ static MagickStatusType ReadPSDChannelRaw(Image *image,const size_t channels,
        "      layer data is RAW");
 
   row_size=GetPSDRowSize(image);
-  pixels=(unsigned char *) AcquireQuantumMemory(8*row_size,sizeof(*pixels));
+  pixels=(unsigned char *) AcquireQuantumMemory(row_size,8*sizeof(*pixels));
   if (pixels == (unsigned char *) NULL)
     ThrowBinaryException(ResourceLimitError,"MemoryAllocationFailed",
       image->filename);
@@ -872,7 +873,7 @@ static MagickStatusType ReadPSDChannelRLE(Image *image,const PSDInfo *psd_info,
        "      layer data is RLE compressed");
 
   row_size=GetPSDRowSize(image);
-  pixels=(unsigned char *) AcquireQuantumMemory(8*row_size,sizeof(*pixels));
+  pixels=(unsigned char *) AcquireQuantumMemory(row_size,8*sizeof(*pixels));
   if (pixels == (unsigned char *) NULL)
     ThrowBinaryException(ResourceLimitError,"MemoryAllocationFailed",
       image->filename);
@@ -889,7 +890,8 @@ static MagickStatusType ReadPSDChannelRLE(Image *image,const PSDInfo *psd_info,
         image->filename);
     }
 
-  compact_pixels=(unsigned char *) AcquireQuantumMemory(length,sizeof(*pixels));
+  compact_pixels=(unsigned char *) AcquireQuantumMemory(length,
+    8*sizeof(*pixels));
   if (compact_pixels == (unsigned char *) NULL)
     {
       pixels=(unsigned char *) RelinquishMagickMemory(pixels);
index 611ec58fd44734219862173071c449fe9927c191..3b5a7bba14a0072aac89ccac54f5c5a3cf98a4ca 100644 (file)
@@ -2126,7 +2126,7 @@ static void util_set_pen(wmfAPI * API, wmfDC * dc)
       case PS_SOLID:
       default:
         {
-          (void) DrawSetStrokeDashArray(WmfDrawingWand,0,(double *)NULL);
+          (void) DrawSetStrokeDashArray(WmfDrawingWand,0,(double *) NULL);
           break;
         }
       }
index a584c9f1021f5aa4efe37e61ed6fe2b04c2b891a..0577a2c42a8f2272c607c6224b65519216dac95a 100644 (file)
@@ -465,7 +465,7 @@ static int UnpackWPGRaster(Image *image,int bpp,ExceptionInfo *exception)
 
   ldblk=(ssize_t) ((bpp*image->columns+7)/8);
   BImgBuff=(unsigned char *) AcquireQuantumMemory((size_t) ldblk,
-    4*sizeof(*BImgBuff));
+    8*sizeof(*BImgBuff));
   if(BImgBuff==NULL) return(-2);
 
   while(y<(ssize_t) image->rows)
index e7e7f1225cef9e45333fa9637dd9e8ff867c5439..b78b0f91a181e25e6ef97ce186e220b92448dc45 100644 (file)
@@ -165,7 +165,7 @@ static size_t CopyXPMColor(char *destination,const char *source,size_t length)
 
 static char *NextXPMLine(char *p)
 {
-  assert(p != (char *)NULL);
+  assert(p != (char *) NULL);
   p=strchr(p,'\n');
   if (p != (char *) NULL)
     p++;
@@ -389,6 +389,8 @@ static Image *ReadXPMImage(const ImageInfo *image_info,ExceptionInfo *exception)
       {
         while ((isspace((int) ((unsigned char) *q)) == 0) && (*q != '\0'))
           q++;
+        if ((next-q) < 0)
+          break;
         if (next != (char *) NULL)
           (void) CopyXPMColor(target,q,MagickMin((size_t) (next-q),
             MaxTextExtent));
index 961f431f9e708acef971a971c399972bb605c307..3cebfa91e160978e55680f6fffd10c7af2204c09 100644 (file)
@@ -113,7 +113,7 @@ static MagickBooleanType ScribbleImage(MagickWand *canvas)
         DrawSetStrokeWidth(picasso,4.032);
         DrawSetStrokeLineCap(picasso,RoundCap);
         DrawSetStrokeLineJoin(picasso,RoundJoin);
-        (void) DrawSetStrokeDashArray(picasso,0,(const double *)NULL);
+        (void) DrawSetStrokeDashArray(picasso,0,(const double *) NULL);
         (void) PixelSetColor(color,"#ff0000");
         DrawSetStrokeColor(picasso,color);
         DrawSetFillRule(picasso,EvenOddRule);
@@ -128,7 +128,7 @@ static MagickBooleanType ScribbleImage(MagickWand *canvas)
         DrawSetStrokeWidth(picasso,9);
         DrawSetStrokeLineCap(picasso,RoundCap);
         DrawSetStrokeLineJoin(picasso,RoundJoin);
-        (void) DrawSetStrokeDashArray(picasso,0,(const double *)NULL);
+        (void) DrawSetStrokeDashArray(picasso,0,(const double *) NULL);
         (void) PixelSetColor(color,"#00ff00");
         DrawSetStrokeColor(picasso,color);
         DrawSetFillRule(picasso,EvenOddRule);
@@ -157,7 +157,7 @@ static MagickBooleanType ScribbleImage(MagickWand *canvas)
         DrawSetStrokeWidth(picasso,2.016);
         DrawSetStrokeLineCap(picasso,RoundCap);
         DrawSetStrokeLineJoin(picasso,RoundJoin);
-        (void) DrawSetStrokeDashArray(picasso,0,(const double *)NULL);
+        (void) DrawSetStrokeDashArray(picasso,0,(const double *) NULL);
         (void) PixelSetColor(color,"#000080");
         DrawSetStrokeColor(picasso,color);
         DrawSetFillRule(picasso,EvenOddRule);
@@ -172,7 +172,7 @@ static MagickBooleanType ScribbleImage(MagickWand *canvas)
         DrawSetStrokeWidth(picasso,3.024);
         DrawSetStrokeLineCap(picasso,RoundCap);
         DrawSetStrokeLineJoin(picasso,RoundJoin);
-        (void) DrawSetStrokeDashArray(picasso,0,(const double *)NULL);
+        (void) DrawSetStrokeDashArray(picasso,0,(const double *) NULL);
         (void) PixelSetColor(color,"#000080");
         DrawSetStrokeColor(picasso,color);
         DrawSetFillRule(picasso,EvenOddRule);
@@ -203,7 +203,7 @@ static MagickBooleanType ScribbleImage(MagickWand *canvas)
         DrawSetStrokeWidth(picasso,3.024);
         DrawSetStrokeLineCap(picasso,RoundCap);
         DrawSetStrokeLineJoin(picasso,RoundJoin);
-        (void) DrawSetStrokeDashArray(picasso,0,(const double *)NULL);
+        (void) DrawSetStrokeDashArray(picasso,0,(const double *) NULL);
         (void) PixelSetColor(color,"#ff8000");
         DrawSetStrokeColor(picasso,color);
         DrawSetFillRule(picasso,EvenOddRule);
@@ -218,7 +218,7 @@ static MagickBooleanType ScribbleImage(MagickWand *canvas)
         DrawSetStrokeWidth(picasso,12.02);
         DrawSetStrokeLineCap(picasso,RoundCap);
         DrawSetStrokeLineJoin(picasso,RoundJoin);
-        (void) DrawSetStrokeDashArray(picasso,0,(const double *)NULL);
+        (void) DrawSetStrokeDashArray(picasso,0,(const double *) NULL);
         (void) PixelSetColor(color,"#4000c2");
         DrawSetStrokeColor(picasso,color);
         (void) PixelSetColor(color,"none");
@@ -232,7 +232,7 @@ static MagickBooleanType ScribbleImage(MagickWand *canvas)
         DrawSetStrokeWidth(picasso,9);
         DrawSetStrokeLineCap(picasso,RoundCap);
         DrawSetStrokeLineJoin(picasso,RoundJoin);
-        (void) DrawSetStrokeDashArray(picasso,0,(const double *)NULL);
+        (void) DrawSetStrokeDashArray(picasso,0,(const double *) NULL);
         (void) PixelSetColor(color,"#4000c2");
         DrawSetStrokeColor(picasso,color);
         DrawSetFillRule(picasso,EvenOddRule);
@@ -253,7 +253,7 @@ static MagickBooleanType ScribbleImage(MagickWand *canvas)
         DrawSetStrokeWidth(picasso,9);
         DrawSetStrokeLineCap(picasso,RoundCap);
         DrawSetStrokeLineJoin(picasso,RoundJoin);
-        (void) DrawSetStrokeDashArray(picasso,0,(const double *)NULL);
+        (void) DrawSetStrokeDashArray(picasso,0,(const double *) NULL);
         (void) PixelSetColor(color,"#4000c2");
         DrawSetStrokeColor(picasso,color);
         DrawSetFillRule(picasso,EvenOddRule);
@@ -275,7 +275,7 @@ static MagickBooleanType ScribbleImage(MagickWand *canvas)
         DrawSetStrokeWidth(picasso,9);
         DrawSetStrokeLineCap(picasso,RoundCap);
         DrawSetStrokeLineJoin(picasso,RoundJoin);
-        (void) DrawSetStrokeDashArray(picasso,0,(const double *)NULL);
+        (void) DrawSetStrokeDashArray(picasso,0,(const double *) NULL);
         (void) PixelSetColor(color,"#4000c2");
         DrawSetStrokeColor(picasso,color);
         DrawSetFillRule(picasso,EvenOddRule);
@@ -298,7 +298,7 @@ static MagickBooleanType ScribbleImage(MagickWand *canvas)
         DrawSetStrokeWidth(picasso,5.976);
         DrawSetStrokeLineCap(picasso,RoundCap);
         DrawSetStrokeLineJoin(picasso,RoundJoin);
-        (void) DrawSetStrokeDashArray(picasso,0,(const double *)NULL);
+        (void) DrawSetStrokeDashArray(picasso,0,(const double *) NULL);
         (void) PixelSetColor(color,"#4000c2");
         DrawSetStrokeColor(picasso,color);
         DrawSetFillRule(picasso,EvenOddRule);
@@ -319,7 +319,7 @@ static MagickBooleanType ScribbleImage(MagickWand *canvas)
         DrawSetStrokeWidth(picasso,5.976);
         DrawSetStrokeLineCap(picasso,RoundCap);
         DrawSetStrokeLineJoin(picasso,RoundJoin);
-        (void) DrawSetStrokeDashArray(picasso,0,(const double *)NULL);
+        (void) DrawSetStrokeDashArray(picasso,0,(const double *) NULL);
         (void) PixelSetColor(color,"#4000c2");
         DrawSetStrokeColor(picasso,color);
         DrawSetFillRule(picasso,EvenOddRule);
@@ -387,7 +387,7 @@ static MagickBooleanType ScribbleImage(MagickWand *canvas)
         DrawSetStrokeWidth(picasso,5.904);
         DrawSetStrokeLineCap(picasso,RoundCap);
         DrawSetStrokeLineJoin(picasso,RoundJoin);
-        (void) DrawSetStrokeDashArray(picasso,0,(const double *)NULL);
+        (void) DrawSetStrokeDashArray(picasso,0,(const double *) NULL);
         (void) PixelSetColor(color,"#4000c2");
         DrawSetStrokeColor(picasso,color);
         DrawSetFillRule(picasso,EvenOddRule);