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'", ".");
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'", ".");
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)
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)
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'", ".");
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)
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);
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;
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 )
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]));
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;
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 != ';'))
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 */
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) */
/* 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'",
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)
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);
MagickExport MagickBooleanType RelinquishMagickOpenCLEnv(MagickCLEnv clEnv)
{
- if (clEnv != (MagickCLEnv)NULL)
+ if (clEnv != (MagickCLEnv) NULL)
{
RelinquishSemaphoreInfo(&clEnv->lock);
RelinquishMagickMemory(clEnv);
magick_unreferenced(program);
magick_unreferenced(kernelName);
- return (cl_kernel)NULL;
+ return (cl_kernel) NULL;
}
MagickPrivate MagickBooleanType RelinquishOpenCLKernel(
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,
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
/*
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"));
return(GetImageOption(image_info,"get-property"));
}
}
- return((char *)NULL);
+ return((char *) NULL);
}
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));
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"));
return(GetImageOption(image_info,"get-property"));
}
}
- return((char *)NULL);
+ return((char *) NULL);
}
#undef WarnNoImageReturn
\f
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
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); \
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)); \
(void) ThrowMagickException(exception,GetMagickModule(),
OptionError,"UnbalancedBraces","\"%%[%s\"",pattern);
interpret_text=DestroyString(interpret_text);
- return((char *)NULL);
+ return((char *) NULL);
}
/*
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)
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)
*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,
*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))
cli_wand->filename=filename;
/* Process Options from Script */
- option = arg1 = arg2 = (char*)NULL;
+ option = arg1 = arg2 = (char*) NULL;
DisableMSCWarning(4127)
while (1) {
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 */
}
CloneString(&arg1,token_info->token);
}
else
- CloneString(&arg1,(char *)NULL);
+ CloneString(&arg1,(char *) NULL);
if ( count >= 2 ) {
if( IfMagickFalse(GetScriptToken(token_info)) )
CloneString(&arg2,token_info->token);
}
else
- CloneString(&arg2,(char *)NULL);
+ CloneString(&arg2,(char *) NULL);
/*
Process Options
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:
/* 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;
}
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);
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 */
}
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
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);
return(argc);
}
- cli_wand->command=(const OptionInfo *)NULL;
+ cli_wand->command=(const OptionInfo *) NULL;
CLIOption(cli_wand,"-write",option);
return(argc);
}
size_t
len;
- assert(image_info != (ImageInfo *)NULL);
+ assert(image_info != (ImageInfo *) NULL);
/* For specific OS command line requirements */
ReadCommandlLine(argc,&argv);
/* 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 */
"\"%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));
(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 */
}
(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 */
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));
(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,
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':
(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 */
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));
(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,
"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))
}
/* 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)
{
(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);
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,
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);
/* 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);
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];
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);
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);
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;
*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;
/* 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"))))
*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;
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)) )
}
/* 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);
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);
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)
/* 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);
/* 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);
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);
}
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;
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; \
} \
( 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';
(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;
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);
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;
RelinquishWandId(cli_wand->wand.id);
cli_wand->wand.signature=(~WandSignature);
- return((MagickCLI *)NULL);
+ return((MagickCLI *) NULL);
}
\f
/*
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");
"(", "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);
"(", "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);
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));
*/
p=image;
image=NULL;
- while (p != (Image *)NULL)
+ while (p != (Image *) NULL)
{
Image *tmp=p;
if ((p->rows == 0) || (p->columns == 0)) {
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] == '#')
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)
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)
/* 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";
else if (LocaleCompare((const char *) tag,"stegano") == 0)
{
Image *
- watermark = (Image*)NULL;
+ watermark = (Image*) NULL;
if (msl_info->image[n] == (Image *) NULL)
{
else if (LocaleCompare((const char *) tag,"stereo") == 0)
{
Image *
- stereoImage = (Image*)NULL;
+ stereoImage = (Image*) NULL;
if (msl_info->image[n] == (Image *) NULL)
{
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))
{
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)
#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"
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
" 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);
" 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);
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);
case PS_SOLID:
default:
{
- (void) DrawSetStrokeDashArray(WmfDrawingWand,0,(double *)NULL);
+ (void) DrawSetStrokeDashArray(WmfDrawingWand,0,(double *) NULL);
break;
}
}
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)
static char *NextXPMLine(char *p)
{
- assert(p != (char *)NULL);
+ assert(p != (char *) NULL);
p=strchr(p,'\n');
if (p != (char *) NULL)
p++;
{
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));
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);
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);
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);
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);
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);
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");
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);
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);
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);
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);
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);
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);