mirror of
https://github.com/SWG-Source/src.git
synced 2026-07-28 22:15:49 -04:00
attempt converting these to uintptr_t
This commit is contained in:
@@ -20,7 +20,7 @@ namespace Base
|
||||
void returnBlock(unsigned *handle);
|
||||
|
||||
private:
|
||||
unsigned *m_blocks[31];
|
||||
uintptr_t *m_blocks[31];
|
||||
};
|
||||
};
|
||||
#ifdef EXTERNAL_DISTRO
|
||||
|
||||
@@ -23,8 +23,8 @@ namespace Base
|
||||
{
|
||||
while(m_blocks[i] != NULL)
|
||||
{
|
||||
unsigned *tmp = m_blocks[i];
|
||||
m_blocks[i] = (unsigned *)*m_blocks[i];
|
||||
uintptr_t *tmp = m_blocks[i];
|
||||
m_blocks[i] = (uintptr_t *)*m_blocks[i];
|
||||
free(tmp);
|
||||
}
|
||||
}
|
||||
@@ -36,7 +36,7 @@ namespace Base
|
||||
void *BlockAllocator::getBlock(unsigned bytes)
|
||||
{
|
||||
unsigned accum = 16, bits = 16;
|
||||
unsigned *handle = NULL;
|
||||
uintptr_t *handle = NULL;
|
||||
|
||||
// Perform a binary search looking for the highest bit.
|
||||
|
||||
@@ -79,7 +79,7 @@ namespace Base
|
||||
if(m_blocks[accum] == 0)
|
||||
{
|
||||
// remove the pre allocated block from the linked list
|
||||
handle = (unsigned *)calloc(((1 << accum) / 4) + 2, sizeof(unsigned));
|
||||
handle = (uintptr_t *)calloc(((1 << accum) / 4) + 2, sizeof(unsigned));
|
||||
handle[1] = accum;
|
||||
handle[0] = 0;
|
||||
}
|
||||
@@ -87,7 +87,7 @@ namespace Base
|
||||
{
|
||||
// Allocate a new block
|
||||
handle = m_blocks[accum];
|
||||
m_blocks[accum] = (unsigned *)handle[0];
|
||||
m_blocks[accum] = (uintptr_t *)handle[0];
|
||||
handle[0] = 0;
|
||||
}
|
||||
// return a pointer that skips over the header used for the allocator's purposes
|
||||
@@ -100,7 +100,7 @@ namespace Base
|
||||
if(handle)
|
||||
{
|
||||
// Update the allocator linked list, insert this entry at the head
|
||||
*(handle - 2) = (unsigned)m_blocks[*(handle - 1)];
|
||||
*(handle - 2) = (uintptr_t)m_blocks[*(handle - 1)];
|
||||
// Add this entry to the proper linked list node
|
||||
m_blocks[*(handle - 1)] = (handle - 2);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user