diff --git a/MagickCore/accelerate.c b/MagickCore/accelerate.c
index ac39ab9..ac37294 100644
--- a/MagickCore/accelerate.c
+++ b/MagickCore/accelerate.c
@@ -1060,7 +1060,7 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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);
diff --git a/MagickCore/layer.c b/MagickCore/layer.c
index 4a12367..d15a031 100644
--- a/MagickCore/layer.c
+++ b/MagickCore/layer.c
@@ -1014,8 +1014,8 @@
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 @@
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 )
diff --git a/MagickCore/matrix.c b/MagickCore/matrix.c
index defcd2b..7d1a2a7 100644
--- a/MagickCore/matrix.c
+++ b/MagickCore/matrix.c
@@ -335,7 +335,7 @@
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]));
diff --git a/MagickCore/morphology.c b/MagickCore/morphology.c
index b266d88..acf863a 100644
--- a/MagickCore/morphology.c
+++ b/MagickCore/morphology.c
@@ -244,7 +244,7 @@
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 @@
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 @@
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 @@
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 @@
/* 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'",
diff --git a/MagickCore/nt-base.c b/MagickCore/nt-base.c
index 448d153..fadd42f 100644
--- a/MagickCore/nt-base.c
+++ b/MagickCore/nt-base.c
@@ -1588,7 +1588,7 @@
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 @@
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);
diff --git a/MagickCore/opencl.c b/MagickCore/opencl.c
index ecfefb7..e7a1e1c 100644
--- a/MagickCore/opencl.c
+++ b/MagickCore/opencl.c
@@ -198,7 +198,7 @@
MagickExport MagickBooleanType RelinquishMagickOpenCLEnv(MagickCLEnv clEnv)
{
- if (clEnv != (MagickCLEnv)NULL)
+ if (clEnv != (MagickCLEnv) NULL)
{
RelinquishSemaphoreInfo(&clEnv->lock);
RelinquishMagickMemory(clEnv);
@@ -2725,7 +2725,7 @@
magick_unreferenced(program);
magick_unreferenced(kernelName);
- return (cl_kernel)NULL;
+ return (cl_kernel) NULL;
}
MagickPrivate MagickBooleanType RelinquishOpenCLKernel(
diff --git a/MagickCore/property.c b/MagickCore/property.c
index 03ebf29..1b97551 100644
--- a/MagickCore/property.c
+++ b/MagickCore/property.c
@@ -2214,13 +2214,13 @@
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 @@
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 @@
/*
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 @@
return(GetImageOption(image_info,"get-property"));
}
}
- return((char *)NULL);
+ return((char *) NULL);
}
MagickExport const char *GetMagickProperty(ImageInfo *image_info,
@@ -2602,7 +2602,7 @@
*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 @@
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 @@
return(GetImageOption(image_info,"get-property"));
}
}
- return((char *)NULL);
+ return((char *) NULL);
}
#undef WarnNoImageReturn
@@ -3164,7 +3164,7 @@
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 @@
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 @@
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 @@
(void) ThrowMagickException(exception,GetMagickModule(),
OptionError,"UnbalancedBraces","\"%%[%s\"",pattern);
interpret_text=DestroyString(interpret_text);
- return((char *)NULL);
+ return((char *) NULL);
}
/*
@@ -3569,7 +3569,7 @@
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 @@
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)
diff --git a/MagickCore/threshold.c b/MagickCore/threshold.c
index c13e476..e411353 100644
--- a/MagickCore/threshold.c
+++ b/MagickCore/threshold.c
@@ -1143,12 +1143,12 @@
*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,
diff --git a/MagickWand/magick-cli.c b/MagickWand/magick-cli.c
index fe18872..9f2eeba 100644
--- a/MagickWand/magick-cli.c
+++ b/MagickWand/magick-cli.c
@@ -125,7 +125,7 @@
*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 @@
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 @@
#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 @@
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 @@
CloneString(&arg2,token_info->token);
}
else
- CloneString(&arg2,(char *)NULL);
+ CloneString(&arg2,(char *) NULL);
/*
Process Options
@@ -270,9 +270,9 @@
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 @@
/* 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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
/* 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 @@
"\"%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));
diff --git a/MagickWand/mogrify.c b/MagickWand/mogrify.c
index d8a5d46..b110bfb 100644
--- a/MagickWand/mogrify.c
+++ b/MagickWand/mogrify.c
@@ -499,7 +499,7 @@
(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 @@
(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 @@
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 @@
(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 @@
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':
diff --git a/MagickWand/operation.c b/MagickWand/operation.c
index d9e0c10..e2701d5 100644
--- a/MagickWand/operation.c
+++ b/MagickWand/operation.c
@@ -243,7 +243,7 @@
(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 @@
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 @@
(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 @@
"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 @@
}
/* 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 @@
{
(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 @@
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 @@
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 @@
/* 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 @@
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 @@
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 @@
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 @@
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 @@
*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 @@
/* 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 @@
*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 @@
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 @@
}
/* 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 @@
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 @@
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 @@
/* 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 @@
/* 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);
diff --git a/MagickWand/script-token.c b/MagickWand/script-token.c
index 38d8251..c841bc4 100644
--- a/MagickWand/script-token.c
+++ b/MagickWand/script-token.c
@@ -224,7 +224,7 @@
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 @@
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 @@
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 @@
( 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';
diff --git a/MagickWand/wandcli.c b/MagickWand/wandcli.c
index 23f3bde..b312e11 100644
--- a/MagickWand/wandcli.c
+++ b/MagickWand/wandcli.c
@@ -100,11 +100,11 @@
(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 @@
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 @@
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 @@
RelinquishWandId(cli_wand->wand.id);
cli_wand->wand.signature=(~WandSignature);
- return((MagickCLI *)NULL);
+ return((MagickCLI *) NULL);
}
/*
diff --git a/api_examples/cli_operators.c b/api_examples/cli_operators.c
index 7cff593..f16be94 100644
--- a/api_examples/cli_operators.c
+++ b/api_examples/cli_operators.c
@@ -32,7 +32,7 @@
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");
diff --git a/api_examples/cli_process.c b/api_examples/cli_process.c
index e7be3b2..1eb662d 100644
--- a/api_examples/cli_process.c
+++ b/api_examples/cli_process.c
@@ -32,11 +32,11 @@
"(", "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);
diff --git a/api_examples/magick_command.c b/api_examples/magick_command.c
index c732cbe..1b97345 100644
--- a/api_examples/magick_command.c
+++ b/api_examples/magick_command.c
@@ -39,7 +39,7 @@
"(", "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);
diff --git a/coders/mat.c b/coders/mat.c
index 001c4b0..d5b9e89 100644
--- a/coders/mat.c
+++ b/coders/mat.c
@@ -887,7 +887,7 @@
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 @@
*/
p=image;
image=NULL;
- while (p != (Image *)NULL)
+ while (p != (Image *) NULL)
{
Image *tmp=p;
if ((p->rows == 0) || (p->columns == 0)) {
diff --git a/coders/meta.c b/coders/meta.c
index 17b38b1..5f9c5f7 100644
--- a/coders/meta.c
+++ b/coders/meta.c
@@ -196,7 +196,7 @@
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 @@
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 @@
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 @@
/* 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";
diff --git a/coders/msl.c b/coders/msl.c
index 03e081d..d5de506 100644
--- a/coders/msl.c
+++ b/coders/msl.c
@@ -6763,7 +6763,7 @@
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 @@
else if (LocaleCompare((const char *) tag,"stereo") == 0)
{
Image *
- stereoImage = (Image*)NULL;
+ stereoImage = (Image*) NULL;
if (msl_info->image[n] == (Image *) NULL)
{
diff --git a/coders/pcx.c b/coders/pcx.c
index c7b261e..af394bc 100644
--- a/coders/pcx.c
+++ b/coders/pcx.c
@@ -401,7 +401,7 @@
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))
{
diff --git a/coders/pict.c b/coders/pict.c
index 437eb9e..83de827 100644
--- a/coders/pict.c
+++ b/coders/pict.c
@@ -474,7 +474,8 @@
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)
diff --git a/coders/psd.c b/coders/psd.c
index 2efab18..f97e449 100644
--- a/coders/psd.c
+++ b/coders/psd.c
@@ -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 @@
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 @@
" 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 @@
" 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 @@
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);
diff --git a/coders/wmf.c b/coders/wmf.c
index 611ec58..3b5a7bb 100644
--- a/coders/wmf.c
+++ b/coders/wmf.c
@@ -2126,7 +2126,7 @@
case PS_SOLID:
default:
{
- (void) DrawSetStrokeDashArray(WmfDrawingWand,0,(double *)NULL);
+ (void) DrawSetStrokeDashArray(WmfDrawingWand,0,(double *) NULL);
break;
}
}
diff --git a/coders/wpg.c b/coders/wpg.c
index a584c9f..0577a2c 100644
--- a/coders/wpg.c
+++ b/coders/wpg.c
@@ -465,7 +465,7 @@
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)
diff --git a/coders/xpm.c b/coders/xpm.c
index e7e7f12..b78b0f9 100644
--- a/coders/xpm.c
+++ b/coders/xpm.c
@@ -165,7 +165,7 @@
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 @@
{
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));
diff --git a/tests/drawtest.c b/tests/drawtest.c
index 961f431..3cebfa9 100644
--- a/tests/drawtest.c
+++ b/tests/drawtest.c
@@ -113,7 +113,7 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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);