if (endian == LSBEndian)
{
value=(ssize_t) (*q++);
- value|=(*q++) << 8;
- value|=(*q++) << 16;
- value|=(*q++) << 24;
+ value|=((ssize_t) *q++) << 8;
+ value|=((ssize_t) *q++) << 16;
+ value|=((ssize_t) *q++) << 24;
}
else
{
value=(ssize_t) (*q++) << 24;
- value|=(*q++) << 16;
- value|=(*q++) << 8;
- value|=(*q++);
+ value|=((ssize_t) *q++) << 16;
+ value|=((ssize_t) *q++) << 8;
+ value|=((ssize_t) *q++);
}
if (p->mask == 0)
{
}
p=(const MimeInfo *) GetNextValueInLinkedList(mime_cache);
}
- if (p != (const MimeInfo *) NULL)
+ if (mime_info != (const MimeInfo *) NULL)
(void) InsertValueInLinkedList(mime_cache,0,
RemoveElementByValueFromLinkedList(mime_cache,p));
UnlockSemaphoreInfo(mime_semaphore);
- return(p);
+ return(mime_info);
}
\f
/*
% %
% %
% %
-+ L o a d M i m e L i s t %
++ L o a d M i m e C a c h e %
% %
% %
% %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
-% LoadMimeCache() loads the magic configurations which provides a mapping
-% between magic attributes and a magic name.
+% LoadMimeCache() loads the mime configurations which provides a mapping
+% between mime attributes and a mime name.
%
% The format of the LoadMimeCache method is:
%
if (attribute != (const char *) NULL)
mime_info->priority=(ssize_t) strtol(attribute,(char **) NULL,0);
attribute=GetXMLTreeAttribute(mime,"stealth");
- mime_info->stealth=IsStringTrue(attribute);
+ if (attribute != (const char *) NULL)
+ mime_info->stealth=IsStringTrue(attribute);
attribute=GetXMLTreeAttribute(mime,"type");
if (attribute != (const char *) NULL)
mime_info->type=ConstantString(attribute);
*/
MagickPrivate MagickBooleanType MimeComponentGenesis(void)
{
- mime_semaphore=AcquireSemaphoreInfo();
+ if (mime_semaphore == (SemaphoreInfo *) NULL)
+ mime_semaphore=AcquireSemaphoreInfo();
return(MagickTrue);
}
\f