break;
for (x=0; x < (ssize_t) image->columns; x++)
{
- register ssize_t
- i;
-
if (GetPixelReadMask(image,p) == 0)
{
p+=GetPixelChannels(image);
x=0;
if (image->alpha_trait != UndefinedPixelTrait)
{
- register const Quantum
- *p;
-
p=(const Quantum *) NULL;
for (y=0; y < (ssize_t) image->rows; y++)
{
if (image->colors <= 1024)
{
char
- color[MagickPathExtent],
hex[MagickPathExtent],
tuple[MagickPathExtent];
pixel;
register PixelInfo
- *magick_restrict p;
+ *magick_restrict c;
GetPixelInfo(image,&pixel);
- p=image->colormap;
+ c=image->colormap;
for (i=0; i < (ssize_t) image->colors; i++)
{
- pixel=(*p);
+ pixel=(*c);
(void) CopyMagickString(tuple,"(",MagickPathExtent);
ConcatenateColorComponent(&pixel,RedPixelChannel,X11Compliance,
tuple);
GetColorTuple(&pixel,MagickTrue,hex);
(void) FormatLocaleFile(file," %8ld: %s %s %s\n",(long) i,tuple,
hex,color);
- p++;
+ c++;
}
}
}
*image_info;
register char
- *p,
+ *d,
*q;
WarningHandler
image_info=AcquireImageInfo();
(void) CloneString(&image_info->size,"64x64");
(void) FormatLocaleFile(file," Directory:\n");
- for (p=image->directory; *p != '\0'; p++)
+ for (d=image->directory; *d != '\0'; d++)
{
- q=p;
+ q=d;
while ((*q != '\n') && (*q != '\0'))
q++;
- (void) CopyMagickString(image_info->filename,p,(size_t) (q-p+1));
- p=q;
+ (void) CopyMagickString(image_info->filename,d,(size_t) (q-d+1));
+ d=q;
(void) FormatLocaleFile(file," %s",image_info->filename);
handler=SetWarningHandler((WarningHandler) NULL);
tile=ReadImage(image_info,exception);
case 'm':
{
register const char
- *p;
+ *r;
- for (p=module+strlen(module)-1; p > module; p--)
- if (*p == *DirectorySeparator)
+ for (r=module+strlen(module)-1; r > module; r--)
+ if (*r == *DirectorySeparator)
{
- p++;
+ r++;
break;
}
- q+=CopyMagickString(q,p,extent);
+ q+=CopyMagickString(q,r,extent);
break;
}
case 'n':
magic_info=GetMagicInfoList("*",&number_aliases,exception);
if (magic_info == (const MagicInfo **) NULL)
return(MagickFalse);
- j=0;
path=(const char *) NULL;
for (i=0; i < (ssize_t) number_aliases; i++)
{
(void) FormatLocaleFile(file,"%6ld ",(long) magic_info[i]->offset);
if (magic_info[i]->target != (char *) NULL)
{
- register ssize_t
- j;
-
for (j=0; magic_info[i]->target[j] != '\0'; j++)
if (isprint((int) ((unsigned char) magic_info[i]->target[j])) != 0)
(void) FormatLocaleFile(file,"%c",magic_info[i]->target[j]);
*p;
register unsigned char
- *q;
+ *r;
size_t
length;
length=strlen(token);
magic_info->target=ConstantString(token);
magic_info->magic=(unsigned char *) ConstantString(token);
- q=magic_info->magic;
+ r=magic_info->magic;
for (p=magic_info->target; *p != '\0'; )
{
if (*p == '\\')
char
*end;
- *q++=(unsigned char) strtol(p,&end,8);
+ *r++=(unsigned char) strtol(p,&end,8);
p+=(end-p);
magic_info->length++;
continue;
}
switch (*p)
{
- case 'b': *q='\b'; break;
- case 'f': *q='\f'; break;
- case 'n': *q='\n'; break;
- case 'r': *q='\r'; break;
- case 't': *q='\t'; break;
- case 'v': *q='\v'; break;
- case 'a': *q='a'; break;
- case '?': *q='\?'; break;
- default: *q=(unsigned char) (*p); break;
+ case 'b': *r='\b'; break;
+ case 'f': *r='\f'; break;
+ case 'n': *r='\n'; break;
+ case 'r': *r='\r'; break;
+ case 't': *r='\t'; break;
+ case 'v': *r='\v'; break;
+ case 'a': *r='a'; break;
+ case '?': *r='\?'; break;
+ default: *r=(unsigned char) (*p); break;
}
p++;
- q++;
+ r++;
magic_info->length++;
continue;
}
else
if (LocaleNCompare(p,"&",5) == 0)
(void) CopyMagickString(p+1,p+5,length-magic_info->length);
- *q++=(unsigned char) (*p++);
+ *r++=(unsigned char) (*p++);
magic_info->length++;
}
break;
(void) TextureImage(montage,texture,exception);
if (montage_info->title != (char *) NULL)
{
- char
- geometry[MagickPathExtent];
-
DrawInfo
- *clone_info;
+ *draw_clone_info;
TypeMetric
- metrics;
+ tile_metrics;
/*
Annotate composite image with title.
*/
- clone_info=CloneDrawInfo(image_info,draw_info);
- clone_info->gravity=CenterGravity;
- clone_info->pointsize*=2.0;
- (void) GetTypeMetrics(image_list[0],clone_info,&metrics,exception);
- (void) FormatLocaleString(geometry,MagickPathExtent,
+ draw_clone_info=CloneDrawInfo(image_info,draw_info);
+ draw_clone_info->gravity=CenterGravity;
+ draw_clone_info->pointsize*=2.0;
+ (void) GetTypeMetrics(image_list[0],draw_clone_info,&tile_metrics,
+ exception);
+ (void) FormatLocaleString(tile_geometry,MagickPathExtent,
"%.20gx%.20g%+.20g%+.20g",(double) montage->columns,(double)
- (metrics.ascent-metrics.descent),0.0,(double) extract_info.y+4);
- (void) CloneString(&clone_info->geometry,geometry);
- (void) CloneString(&clone_info->text,title);
- (void) AnnotateImage(montage,clone_info,exception);
- clone_info=DestroyDrawInfo(clone_info);
+ (tile_metrics.ascent-tile_metrics.descent),0.0,
+ (double) extract_info.y+4);
+ (void) CloneString(&draw_clone_info->geometry,tile_geometry);
+ (void) CloneString(&draw_clone_info->text,title);
+ (void) AnnotateImage(montage,draw_clone_info,exception);
+ draw_clone_info=DestroyDrawInfo(draw_clone_info);
}
(void) SetImageProgressMonitor(montage,progress_monitor,
montage->client_data);
if ((montage_info->frame != (char *) NULL) && (bevel_width != 0))
{
FrameInfo
- extract_info;
+ frame_clone;
Image
*frame_image;
/*
Put an ornamental border around this tile.
*/
- extract_info=frame_info;
- extract_info.width=width+2*frame_info.width;
- extract_info.height=height+2*frame_info.height;
+ frame_clone=frame_info;
+ frame_clone.width=width+2*frame_info.width;
+ frame_clone.height=height+2*frame_info.height;
value=GetImageProperty(image,"label",exception);
if (value != (const char *) NULL)
- extract_info.height+=(size_t) ((metrics.ascent-metrics.descent+4)*
+ frame_clone.height+=(size_t) ((metrics.ascent-metrics.descent+4)*
MultilineCensus(value));
- frame_image=FrameImage(image,&extract_info,image->compose,exception);
+ frame_image=FrameImage(image,&frame_clone,image->compose,exception);
if (frame_image != (Image *) NULL)
{
image=DestroyImage(image);
value=GetImageProperty(image,"label",exception);
if (value != (const char *) NULL)
{
- char
- geometry[MagickPathExtent];
-
/*
Annotate composite tile with label.
*/
- (void) FormatLocaleString(geometry,MagickPathExtent,
+ (void) FormatLocaleString(tile_geometry,MagickPathExtent,
"%.20gx%.20g%+.20g%+.20g",(double) ((montage_info->frame ?
image->columns : width)-2*border_width),(double)
(metrics.ascent-metrics.descent+4)*MultilineCensus(value),
((montage_info->frame ? y_offset+height+border_width+4 :
y_offset+extract_info.height+border_width+
(montage_info->shadow != MagickFalse ? 4 : 0))+bevel_width));
- (void) CloneString(&draw_info->geometry,geometry);
+ (void) CloneString(&draw_info->geometry,tile_geometry);
(void) CloneString(&draw_info->text,value);
(void) AnnotateImage(montage,draw_info,exception);
}
}
if (images->progress_monitor != (MagickProgressMonitor) NULL)
{
- MagickBooleanType
- proceed;
-
proceed=SetImageProgress(image,MontageImageTag,tiles,total_tiles);
if (proceed == MagickFalse)
status=MagickFalse;
component; \
\
size_t \
- length; \
+ length1; \
\
unsigned char \
*p1; \
\
- length=0; \
+ length1=0; \
p1=p; \
for (component=0; component < components; component++) \
{ \
- length+=FormatLocaleString(buffer+length,MagickPathExtent-length, \
+ length1+=FormatLocaleString(buffer+length1,MagickPathExtent-length1, \
format", ",arg); \
- if (length >= (MagickPathExtent-1)) \
- length=MagickPathExtent-1; \
+ if (length1 >= (MagickPathExtent-1)) \
+ length1=MagickPathExtent-1; \
p1+=size; \
} \
- if (length > 1) \
- buffer[length-2]='\0'; \
+ if (length1 > 1) \
+ buffer[length1-2]='\0'; \
value=AcquireString(buffer); \
}
component; \
\
size_t \
- length; \
+ length1; \
\
unsigned char \
*p1; \
\
- length=0; \
+ length1=0; \
p1=p; \
for (component=0; component < components; component++) \
{ \
- length+=FormatLocaleString(buffer+length,MagickPathExtent-length, \
+ length1+=FormatLocaleString(buffer+length1,MagickPathExtent-length1, \
format", ",(arg1),(arg2)); \
- if (length >= (MagickPathExtent-1)) \
- length=MagickPathExtent-1; \
+ if (length1 >= (MagickPathExtent-1)) \
+ length1=MagickPathExtent-1; \
p1+=size; \
} \
- if (length > 1) \
- buffer[length-2]='\0'; \
+ if (length1 > 1) \
+ buffer[length1-2]='\0'; \
value=AcquireString(buffer); \
}
p=q+8;
else
{
- ssize_t
- offset;
-
/*
The directory entry contains an offset.
*/
sizeof(*value));
if (value != (char *) NULL)
{
- register ssize_t
- i;
-
for (i=0; i < (ssize_t) number_bytes; i++)
{
value[i]='.';
char
*key;
- register const char
- *p;
-
key=AcquireString(property);
switch (all)
{
const char
*description;
- register ssize_t
- i;
-
description="unknown";
for (i=0; ; i++)
{
(void) SubstituteString(&key,"exif:","exif:thumbnail:");
}
}
- p=(const char *) NULL;
- if (image->properties != (void *) NULL)
- p=(const char *) GetValueFromSplayTree((SplayTreeInfo *)
- image->properties,key);
- if (p == (const char *) NULL)
+ if (GetImageProperty(image,key,exception) == (const char *) NULL)
(void) SetImageProperty((Image *) image,key,value,exception);
value=DestroyString(value);
key=DestroyString(key);
if ((tag_value == TAG_EXIF_OFFSET) ||
(tag_value == TAG_INTEROP_OFFSET) || (tag_value == TAG_GPS_OFFSET))
{
- ssize_t
- offset;
-
offset=(ssize_t) ReadPropertySignedLong(endian,p);
if (((size_t) offset < length) && (level < (MaxDirectoryStack-2)))
{
#if defined(MAGICKCORE_WINDOWS_SUPPORT)
{
double
- seconds;
+ datum;
LARGE_INTEGER
- nanoseconds;
-
- MagickBooleanType
- status;
+ datum1;
/*
Not crytographically strong but better than nothing.
*/
- seconds=NTElapsedTime()+NTUserTime();
- SetStringInfoLength(chaos,sizeof(seconds));
- SetStringInfoDatum(chaos,(unsigned char *) &seconds);
+ datum=NTElapsedTime()+NTUserTime();
+ SetStringInfoLength(chaos,sizeof(datum));
+ SetStringInfoDatum(chaos,(unsigned char *) &datum);
ConcatenateStringInfo(entropy,chaos);
- if (QueryPerformanceCounter(&nanoseconds) != 0)
+ if (QueryPerformanceCounter(&datum1) != 0)
{
- SetStringInfoLength(chaos,sizeof(nanoseconds));
- SetStringInfoDatum(chaos,(unsigned char *) &nanoseconds);
+ SetStringInfoLength(chaos,sizeof(datum1));
+ SetStringInfoDatum(chaos,(unsigned char *) &datum1);
ConcatenateStringInfo(entropy,chaos);
}
/*
Our best hope for true entropy.
*/
SetStringInfoLength(chaos,MaxEntropyExtent);
- status=NTGatherRandomData(MaxEntropyExtent,GetStringInfoDatum(chaos));
- (void) status;
+ (void) NTGatherRandomData(MaxEntropyExtent,GetStringInfoDatum(chaos));
ConcatenateStringInfo(entropy,chaos);
}
#else
while (lqr_carver_scan_ext(carver,&x_offset,&y_offset,(void **) &packet) != 0)
{
register Quantum
- *magick_restrict q;
+ *magick_restrict p;
register ssize_t
i;
- q=QueueCacheViewAuthenticPixels(rescale_view,x_offset,y_offset,1,1,
+ p=QueueCacheViewAuthenticPixels(rescale_view,x_offset,y_offset,1,1,
exception);
- if (q == (Quantum *) NULL)
+ if (p == (Quantum *) NULL)
break;
for (i=0; i < (ssize_t) GetPixelChannels(image); i++)
{
(rescale_traits == UndefinedPixelTrait))
continue;
SetPixelChannel(rescale_image,channel,ClampToQuantum(QuantumRange*
- packet[i]),q);
+ packet[i]),p);
}
if (SyncCacheViewAuthenticPixels(rescale_view,exception) == MagickFalse)
break;
progress;
register ssize_t
- x;
+ x1;
ssize_t
*x_offset,
sample_image=DestroyImage(sample_image);
ThrowImageException(ResourceLimitError,"MemoryAllocationFailed");
}
- for (x=0; x < (ssize_t) sample_image->columns; x++)
- x_offset[x]=(ssize_t) ((((double) x+sample_offset.x)*image->columns)/
+ for (x1=0; x1 < (ssize_t) sample_image->columns; x1++)
+ x_offset[x1]=(ssize_t) ((((double) x1+sample_offset.x)*image->columns)/
sample_image->columns);
/*
Sample each row.
proceed,
status;
- PixelChannel
- channel;
-
PixelTrait
- scale_traits,
- traits;
+ scale_traits;
PointInfo
scale,
}
for (i=0; i < (ssize_t) GetPixelChannels(image); i++)
{
- channel=GetPixelChannelChannel(image,i);
- traits=GetPixelChannelTraits(image,channel);
+ PixelChannel channel=GetPixelChannelChannel(image,i);
+ PixelTrait traits=GetPixelChannelTraits(image,channel);
scale_traits=GetPixelChannelTraits(scale_image,channel);
if ((traits == UndefinedPixelTrait) ||
(scale_traits == UndefinedPixelTrait))
for (y=0; y < (ssize_t) image->rows; y++)
{
Cluster
- *cluster;
+ *clust;
register const PixelInfo
*magick_restrict p;
for (x=0; x < (ssize_t) image->columns; x++)
{
SetPixelIndex(image,0,q);
- for (cluster=head; cluster != (Cluster *) NULL; cluster=cluster->next)
+ for (clust=head; clust != (Cluster *) NULL; clust=clust->next)
{
if (((ssize_t) ScaleQuantumToChar(GetPixelRed(image,q)) >=
- (cluster->red.left-SafeMargin)) &&
+ (clust->red.left-SafeMargin)) &&
((ssize_t) ScaleQuantumToChar(GetPixelRed(image,q)) <=
- (cluster->red.right+SafeMargin)) &&
+ (clust->red.right+SafeMargin)) &&
((ssize_t) ScaleQuantumToChar(GetPixelGreen(image,q)) >=
- (cluster->green.left-SafeMargin)) &&
+ (clust->green.left-SafeMargin)) &&
((ssize_t) ScaleQuantumToChar(GetPixelGreen(image,q)) <=
- (cluster->green.right+SafeMargin)) &&
+ (clust->green.right+SafeMargin)) &&
((ssize_t) ScaleQuantumToChar(GetPixelBlue(image,q)) >=
- (cluster->blue.left-SafeMargin)) &&
+ (clust->blue.left-SafeMargin)) &&
((ssize_t) ScaleQuantumToChar(GetPixelBlue(image,q)) <=
- (cluster->blue.right+SafeMargin)))
+ (clust->blue.right+SafeMargin)))
{
/*
Classify this pixel.
*/
- SetPixelIndex(image,(Quantum) cluster->id,q);
+ SetPixelIndex(image,(Quantum) clust->id,q);
break;
}
}
- if (cluster == (Cluster *) NULL)
+ if (clust == (Cluster *) NULL)
{
double
distance_squared,
if (font_path != (char *) NULL)
{
char
- *option;
+ *xml;
/*
Search MAGICK_FONT_PATH.
*/
(void) FormatLocaleString(path,MagickPathExtent,"%s%s%s",font_path,
DirectorySeparator,filename);
- option=FileToString(path,~0UL,exception);
- if (option != (void *) NULL)
+ xml=FileToString(path,~0UL,exception);
+ if (xml != (void *) NULL)
{
- status&=LoadTypeCache(cache,option,path,0,exception);
- option=DestroyString(option);
+ status&=LoadTypeCache(cache,xml,path,0,exception);
+ xml=DestroyString(xml);
}
font_path=DestroyString(font_path);
}
{
char
path[MagickPathExtent],
- *xml;
+ *file_xml;
ExceptionInfo
*sans_exception;
else
(void) ConcatenateMagickString(path,token,MagickPathExtent);
sans_exception=AcquireExceptionInfo();
- xml=FileToString(path,~0UL,sans_exception);
+ file_xml=FileToString(path,~0UL,sans_exception);
sans_exception=DestroyExceptionInfo(sans_exception);
- if (xml != (char *) NULL)
+ if (file_xml != (char *) NULL)
{
- status&=LoadTypeCache(cache,xml,path,depth+1,exception);
- xml=(char *) RelinquishMagickMemory(xml);
+ status&=LoadTypeCache(cache,file_xml,path,depth+1,
+ exception);
+ file_xml=(char *) RelinquishMagickMemory(file_xml);
}
}
}
if (IsPathDirectory(filename) <= 0)
{
char
- path[MagickPathExtent];
+ file_path[MagickPathExtent];
- *path='\0';
+ *file_path='\0';
if (*magick != '\0')
{
- (void) ConcatenateMagickString(path,magick,MagickPathExtent);
- (void) ConcatenateMagickString(path,":",MagickPathExtent);
+ (void) ConcatenateMagickString(file_path,magick,
+ MagickPathExtent);
+ (void) ConcatenateMagickString(file_path,":",MagickPathExtent);
}
- (void) ConcatenateMagickString(path,filename,MagickPathExtent);
+ (void) ConcatenateMagickString(file_path,filename,MagickPathExtent);
if (*subimage != '\0')
{
- (void) ConcatenateMagickString(path,"[",MagickPathExtent);
- (void) ConcatenateMagickString(path,subimage,MagickPathExtent);
- (void) ConcatenateMagickString(path,"]",MagickPathExtent);
+ (void) ConcatenateMagickString(file_path,"[",MagickPathExtent);
+ (void) ConcatenateMagickString(file_path,subimage,
+ MagickPathExtent);
+ (void) ConcatenateMagickString(file_path,"]",MagickPathExtent);
}
- if (strlen(path) >= (MagickPathExtent-1))
+ if (strlen(file_path) >= (MagickPathExtent-1))
ThrowFatalException(OptionFatalError,"FilenameTruncated");
if (destroy != MagickFalse)
{
vector[count]=DestroyString(vector[count]);
destroy=MagickFalse;
}
- vector[count++]=ConstantString(path);
+ vector[count++]=ConstantString(file_path);
}
}
filelist=(char **) RelinquishMagickMemory(filelist);
if (crc_initial == MagickFalse)
{
register unsigned int
- i;
+ j;
unsigned int
alpha;
- for (i=0; i < 256; i++)
+ for (j=0; j < 256; j++)
{
register ssize_t
- j;
+ k;
- alpha=i;
- for (j=0; j < 8; j++)
+ alpha=j;
+ for (k=0; k < 8; k++)
alpha=(alpha & 0x01) ? (0xEDB88320 ^ (alpha >> 1)) : (alpha >> 1);
- crc_xor[i]=alpha;
+ crc_xor[j]=alpha;
}
crc_initial=MagickTrue;
}
if (image->storage_class == PseudoClass)
{
size_t
- length,
packet_size;
unsigned char
pixels=(unsigned char *) GetQuantumPixels(quantum_info);
for (y=0; y < (ssize_t) image->rows; y++)
{
- int
- status;
-
register Quantum
*magick_restrict q;
break;
if ((image->colors == 0) && (bpp != 24))
{
- size_t
- one;
-
- one=1;
image->colors=one << bpp;
if (!AcquireImageColormap(image,image->colors,exception))
goto NoMemory;