struct _LinkedListInfo
{
- unsigned long
+ size_t
capacity,
elements;
SemaphoreInfo
*semaphore;
- unsigned long
+ size_t
signature;
};
*(*relinquish_key)(void *),
*(*relinquish_value)(void *);
- unsigned long
+ size_t
capacity,
entries,
next;
SemaphoreInfo
*semaphore;
- unsigned long
+ size_t
signature;
};
\f
register EntryInfo
*entry;
- register long
+ register ssize_t
i;
assert(hashmap_info != (HashmapInfo *) NULL);
if (hashmap_info->debug != MagickFalse)
(void) LogMagickEvent(TraceEvent,GetMagickModule(),"...");
LockSemaphoreInfo(hashmap_info->semaphore);
- for (i=0; i < (long) hashmap_info->capacity; i++)
+ for (i=0; i < (ssize_t) hashmap_info->capacity; i++)
{
list_info=hashmap_info->map[i];
if (list_info != (LinkedListInfo *) NULL)
%
% The format of the GetNumberOfEntriesInHashmap method is:
%
-% unsigned long GetNumberOfEntriesInHashmap(const HashmapInfo *hashmap_info)
+% size_t GetNumberOfEntriesInHashmap(const HashmapInfo *hashmap_info)
%
% A description of each parameter follows:
%
% o hashmap_info: the hashmap info.
%
*/
-MagickExport unsigned long GetNumberOfEntriesInHashmap(
+MagickExport size_t GetNumberOfEntriesInHashmap(
const HashmapInfo *hashmap_info)
{
assert(hashmap_info != (HashmapInfo *) NULL);
%
% The format of the GetNumberOfElementsInLinkedList method is:
%
-% unsigned long GetNumberOfElementsInLinkedList(
+% size_t GetNumberOfElementsInLinkedList(
% const LinkedListInfo *list_info)
%
% A description of each parameter follows:
% o list_info: the linked-list info.
%
*/
-MagickExport unsigned long GetNumberOfElementsInLinkedList(
+MagickExport size_t GetNumberOfElementsInLinkedList(
const LinkedListInfo *list_info)
{
assert(list_info != (LinkedListInfo *) NULL);
% The format of the GetValueFromLinkedList method is:
%
% void *GetValueFromLinkedList(LinkedListInfo *list_info,
-% const unsigned long index)
+% const size_t index)
%
% A description of each parameter follows:
%
%
*/
MagickExport void *GetValueFromLinkedList(LinkedListInfo *list_info,
- const unsigned long index)
+ const size_t index)
{
register ElementInfo
*next;
- register long
+ register ssize_t
i;
void
return(value);
}
next=list_info->head;
- for (i=0; i < (long) index; i++)
+ for (i=0; i < (ssize_t) index; i++)
next=next->next;
value=next->value;
UnlockSemaphoreInfo(list_info->semaphore);
const unsigned char
*digest;
- register long
+ register ssize_t
i;
SignatureInfo
const unsigned char
*digest;
- register long
+ register ssize_t
i;
SignatureInfo
% The format of the InsertValueInLinkedList method is:
%
% MagickBooleanType InsertValueInLinkedList(ListInfo *list_info,
-% const unsigned long index,const void *value)
+% const size_t index,const void *value)
%
% A description of each parameter follows:
%
%
*/
MagickExport MagickBooleanType InsertValueInLinkedList(
- LinkedListInfo *list_info,const unsigned long index,const void *value)
+ LinkedListInfo *list_info,const size_t index,const void *value)
{
register ElementInfo
*next;
- register long
+ register ssize_t
i;
assert(list_info != (LinkedListInfo *) NULL);
element=list_info->head;
next->next=element->next;
- for (i=1; i < (long) index; i++)
+ for (i=1; i < (ssize_t) index; i++)
{
element=element->next;
next->next=element->next;
register ElementInfo
*next;
- register long
+ register ssize_t
i;
assert(list_info != (LinkedListInfo *) NULL);
next->next=list_info->head;
while (next->next != (ElementInfo *) NULL)
{
- i=compare(value,next->next->value);
+ i=(ssize_t) compare(value,next->next->value);
if ((i < 0) || ((replace != (void **) NULL) && (i == 0)))
{
if (i == 0)
register ElementInfo
*next;
- register long
+ register ssize_t
i;
assert(list_info != (LinkedListInfo *) NULL);
%
% The format of the NewHashmap method is:
%
-% HashmapInfo *NewHashmap(const unsigned long capacity,
+% HashmapInfo *NewHashmap(const size_t capacity,
% size_t (*hash)(const void *),
% MagickBooleanType (*compare)(const void *,const void *),
% void *(*relinquish_key)(void *),void *(*relinquish_value)(void *))
% the hash-map.
%
*/
-MagickExport HashmapInfo *NewHashmap(const unsigned long capacity,
+MagickExport HashmapInfo *NewHashmap(const size_t capacity,
size_t (*hash)(const void *),
MagickBooleanType (*compare)(const void *,const void *),
void *(*relinquish_key)(void *),void *(*relinquish_value)(void *))
%
% The format of the NewLinkedList method is:
%
-% LinkedListInfo *NewLinkedList(const unsigned long capacity)
+% LinkedListInfo *NewLinkedList(const size_t capacity)
%
% A description of each parameter follows:
%
% o capacity: the maximum number of elements in the list.
%
*/
-MagickExport LinkedListInfo *NewLinkedList(const unsigned long capacity)
+MagickExport LinkedListInfo *NewLinkedList(const size_t capacity)
{
LinkedListInfo
*list_info;
if (list_info == (LinkedListInfo *) NULL)
ThrowFatalException(ResourceLimitFatalError,"MemoryAllocationFailed");
(void) ResetMagickMemory(list_info,0,sizeof(*list_info));
- list_info->capacity=capacity == 0 ? (unsigned long) (~0) : capacity;
+ list_info->capacity=capacity == 0 ? (size_t) (~0) : capacity;
list_info->elements=0;
list_info->head=(ElementInfo *) NULL;
list_info->tail=(ElementInfo *) NULL;
{
#define MaxCapacities 20
- const unsigned long
+ const size_t
capacities[MaxCapacities] =
{
17, 31, 61, 131, 257, 509, 1021, 2053, 4099, 8191, 16381, 32771,
register ElementInfo
*next;
- register long
+ register ssize_t
i;
- unsigned long
+ size_t
capacity;
/*
/*
Copy entries to new hashmap with increased capacity.
*/
- for (i=0; i < (long) hashmap_info->capacity; i++)
+ for (i=0; i < (ssize_t) hashmap_info->capacity; i++)
{
list_info=hashmap_info->map[i];
if (list_info == (LinkedListInfo *) NULL)
LinkedListInfo
*list_info;
- register unsigned long
+ register size_t
i;
assert(hashmap_info != (HashmapInfo *) NULL);
% The format of the RemoveElementFromLinkedList method is:
%
% void *RemoveElementFromLinkedList(LinkedListInfo *list_info,
-% const unsigned long index)
+% const size_t index)
%
% A description of each parameter follows:
%
%
*/
MagickExport void *RemoveElementFromLinkedList(LinkedListInfo *list_info,
- const unsigned long index)
+ const size_t index)
{
ElementInfo
*next;
- register long
+ register ssize_t
i;
void
*element;
next=list_info->head;
- for (i=1; i < (long) index; i++)
+ for (i=1; i < (ssize_t) index; i++)
next=next->next;
element=next->next;
next->next=element->next;
LinkedListInfo
*list_info;
- register unsigned long
+ register size_t
i;
size_t