GarageGames / Torque2D

MIT Licensed Open Source version of Torque 2D game engine from GarageGames
MIT License
1.67k stars 1.56k forks source link

Pointers can get cast to this type, so use uintptr_t. #289

Closed bentley closed 8 years ago

bentley commented 8 years ago

I was getting this error on OpenBSD:

Building debug object Debug/2d/scene/Scene.cc.o
gcc -c -I/usr/local/include -I../../source -ggdb -DTORQUE_DEBUG -DTORQUE_DEBUG_GUARD -DTORQUE_NET_STATS ../../source/2d/scene/Scene.cc -o Debug/2d/scene/Scene.cc.o
In file included from ../../source/platform/types.gcc.h:85,
                 from ../../source/platform/types.h:87,
                 from ../../source/platform/platform.h:31,
                 from ../../source/math/mPoint.h:32,
                 from ../../source/math/mMath.h:27,
                 from ../../source/2d/scene/Scene.h:27,
                 from ../../source/2d/scene/Scene.cc:24:
../../source/platform/types.posix.h:32:2: error: #error
../../source/2d/scene/Scene.cc: In static member function 'static void Scene::initPersistFields()':
../../source/2d/scene/Scene.cc:315: error: cast from 'SceneRenderQueue::RenderSort*' to 'dsize_t' loses precision
Torque2D:464: recipe for target 'Debug/2d/scene/Scene.cc.o' failed
gmake: *** [Debug/2d/scene/Scene.cc.o] Error 1

So this seems to require an integer type big enough to hold a pointer.

bentley commented 8 years ago

This is not quite right yet. I'll work on it.

greenfire27 commented 8 years ago

Ok, and please request that these are merged into the Development branch, not the Master. Also, have you signed the Open Source Software Agreement? You can find details here. You are required to sign the OSSA before we can merge in your code.

camporter commented 8 years ago

Just to note, when I've been testing 64-bit linux builds, I change dsize_t to use size_t and all is well. I'm not quite sure the exact reason for the comment above the def, as size_t should behave properly for its uses. I'll try to get the 64 bit linux/unix stuff together.