Code: Select all
Compiling src\modules\physics\bullet\build\Bullet\LinearMath\btAlignedAllocator.cpp
=====
src\modules\physics\bullet\Bullet\LinearMath\btAlignedAllocator.cpp: In function 'void* btAlignedAllocDefault(size_t, int)':
src\modules\physics\bullet\Bullet\LinearMath\btAlignedAllocator.cpp:69:64: error: cast from 'char*' to 'long unsigned int' loses precision
src\modules\physics\bullet\Bullet\LinearMath\btAlignedAllocator.cpp: In function 'void* btAlignedAllocInternal(size_t, int)':
src\modules\physics\bullet\Bullet\LinearMath\btAlignedAllocator.cpp:172:64: error: cast from 'char*' to 'long unsigned int' loses precision
Code: Select all
static inline void *btAlignedAllocDefault(size_t size, int alignment)
{
void *ret;
char *real;
unsigned long offset;
real = (char *)sAllocFunc(size + sizeof(void *) + (alignment-1));
if (real) {
offset = (alignment - (unsigned long)(real + sizeof(void *))) & (alignment-1);
ret = (void *)((real + sizeof(void *)) + offset);
*((void **)(ret)-1) = (void *)(real);
} else {
ret = (void *)(real);
}
return (ret);
}
Code: Select all
void* btAlignedAllocInternal (size_t size, int alignment)
{
gNumAlignedAllocs++;
void* ptr;
#if defined (BT_HAS_ALIGNED_ALLOCATOR) || defined(__CELLOS_LV2__)
ptr = sAlignedAllocFunc(size, alignment);
#else
char *real;
unsigned long offset;
real = (char *)sAllocFunc(size + sizeof(void *) + (alignment-1));
if (real) {
offset = (alignment - (unsigned long)(real + sizeof(void *))) & (alignment-1);
ptr = (void *)((real + sizeof(void *)) + offset);
*((void **)(ptr)-1) = (void *)(real);
} else {
ptr = (void *)(real);
}
#endif // defined (BT_HAS_ALIGNED_ALLOCATOR) || defined(__CELLOS_LV2__)
// printf("btAlignedAllocInternal %d, %x\n",size,ptr);
return ptr;
}