1
0
forked from 0ad/0ad

Fix GCC build error

This was SVN commit r7181.
This commit is contained in:
Ykkrosh 2009-11-07 13:34:11 +00:00
parent 43e26aa3f6
commit 934bc31246

View File

@ -99,7 +99,7 @@ public:
}
// will the allocator survive a series of random but valid Allocate/Deallocate?
void test_Randomized() // XXX: No it won't (on Linux/amd64)
void test_Randomized()
{
const size_t poolSize = 1024*1024;
HeaderlessAllocator a(poolSize);
@ -115,7 +115,8 @@ public:
if(rand() >= RAND_MAX/2)
{
const size_t maxSize = (size_t)((rand() / (float)RAND_MAX) * poolSize);
const size_t size = std::max(HeaderlessAllocator::minAllocationSize, round_down(maxSize, HeaderlessAllocator::allocationGranularity));
const size_t size = std::max((size_t)HeaderlessAllocator::minAllocationSize, round_down(maxSize, HeaderlessAllocator::allocationGranularity));
// (the size_t cast on minAllocationSize prevents max taking a reference to the non-defined variable)
void* p = a.Allocate(size);
if(!p)
continue;