Removed a few explicit casts which caused warnings. (From louisdx)
git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@3707 8092fc87-c524-0410-9efc-e669fe64eaf9
This commit is contained in:
@@ -49,7 +49,7 @@ Heap_new(HeapValue_Comparator comparator, size_t initialSize, size_t minSize,
|
|||||||
heap->minSize = minSize;
|
heap->minSize = minSize;
|
||||||
heap->minFillQuotient = minFillQuotient;
|
heap->minFillQuotient = minFillQuotient;
|
||||||
heap->size = nextPower2(initialSize);
|
heap->size = nextPower2(initialSize);
|
||||||
heap->minFill = (size_t) ceil(((double) (heap->size >> 1))
|
heap->minFill = ceil(((double) (heap->size >> 1))
|
||||||
* heap->minFillQuotient);
|
* heap->minFillQuotient);
|
||||||
heap->entries = malloc(heap->size * sizeof (HeapValue *));
|
heap->entries = malloc(heap->size * sizeof (HeapValue *));
|
||||||
heap->numEntries = 0;
|
heap->numEntries = 0;
|
||||||
|
|||||||
@@ -169,12 +169,12 @@ static void
|
|||||||
HASHTABLE_(setup)(HASHTABLE_(HashTable) *hashTable, uio_uint32 initialSize) {
|
HASHTABLE_(setup)(HASHTABLE_(HashTable) *hashTable, uio_uint32 initialSize) {
|
||||||
if (initialSize < 4)
|
if (initialSize < 4)
|
||||||
initialSize = 4;
|
initialSize = 4;
|
||||||
hashTable->size = nextPower2((uio_uint32) ceil(
|
hashTable->size = nextPower2(ceil(((double) initialSize) /
|
||||||
((double) initialSize) / hashTable->maxFillQuotient));
|
hashTable->maxFillQuotient));
|
||||||
hashTable->hashMask = hashTable->size - 1;
|
hashTable->hashMask = hashTable->size - 1;
|
||||||
hashTable->minSize = (uio_uint32) ceil(((double) (hashTable->size >> 1))
|
hashTable->minSize = ceil(((double) (hashTable->size >> 1))
|
||||||
* hashTable->minFillQuotient);
|
* hashTable->minFillQuotient);
|
||||||
hashTable->maxSize = (uio_uint32) floor(((double) hashTable->size)
|
hashTable->maxSize = floor(((double) hashTable->size)
|
||||||
* hashTable->maxFillQuotient);
|
* hashTable->maxFillQuotient);
|
||||||
hashTable->entries = uio_calloc(hashTable->size,
|
hashTable->entries = uio_calloc(hashTable->size,
|
||||||
sizeof (HASHTABLE_(HashEntry) *));
|
sizeof (HASHTABLE_(HashEntry) *));
|
||||||
|
|||||||
Reference in New Issue
Block a user