Skip to content

Commit

Permalink
Linux implementation. Include changes for gcc x64.
Browse files Browse the repository at this point in the history
  • Loading branch information
LuisAntonRebollo committed Jan 24, 2015
1 parent 4e52824 commit 4e90348
Show file tree
Hide file tree
Showing 56 changed files with 1,108 additions and 3,075 deletions.
3 changes: 2 additions & 1 deletion Engine/lib/opcode/OPC_HybridModel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
#include "Opcode.h"
#include <stdint.h>

using namespace Opcode;

Expand Down Expand Up @@ -208,7 +209,7 @@ bool HybridModel::Build(const OPCODECREATE& create)
Data->mLeaves[Data->mNbLeaves] = *current->GetAABB();

// Setup leaf data
udword Index = (udword(current->GetPrimitives()) - udword(Data->mBase))/sizeof(udword);
udword Index = (uintptr_t(current->GetPrimitives()) - uintptr_t(Data->mBase))/sizeof(uintptr_t);
Data->mTriangles[Data->mNbLeaves].SetData(current->GetNbPrimitives(), Index);

Data->mNbLeaves++;
Expand Down
5 changes: 3 additions & 2 deletions Engine/lib/opcode/OPC_SweepAndPrune.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
#include "Opcode.h"
#include <stdint.h>

using namespace Opcode;

Expand Down Expand Up @@ -163,7 +164,7 @@ bool SAP_PairData::Init(udword nb_objects)
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
inline_ void Remap(SAP_Element*& element, udword delta)
{
if(element) element = (SAP_Element*)(udword(element) + delta);
if(element) element = (SAP_Element*)(element + delta);
}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
Expand Down Expand Up @@ -199,7 +200,7 @@ SAP_Element* SAP_PairData::GetFreeElem(udword id, SAP_Element* next, udword* rem

// Remap everything
{
udword Delta = udword(NewElems) - udword(mElementPool);
udword Delta = uintptr_t(NewElems) - uintptr_t(mElementPool);

for(udword i=0;i<mNbUsedElements;i++) Remap(NewElems[i].mNext, Delta);
for(udword i=0;i<mNbObjects;i++) Remap(mArray[i], Delta);
Expand Down
2 changes: 1 addition & 1 deletion Engine/source/T3D/cameraSpline.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ void CameraSpline::renderTimeMap()
void *ptr = vb.lock();
if(!ptr) return;

MRandomLCG random(1376312589 * (U32)this);
MRandomLCG random(1376312589 * (uintptr_t)this);
S32 index = 0;
for(Vector<TimeMap>::iterator itr=mTimeMap.begin(); itr != mTimeMap.end(); itr++)
{
Expand Down
2 changes: 1 addition & 1 deletion Engine/source/T3D/convexShape.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -573,7 +573,7 @@ void ConvexShape::prepRenderImage( SceneRenderState *state )

// We sort by the material then vertex buffer.
ri->defaultKey = matInst->getStateHint();
ri->defaultKey2 = (U32)ri->vertBuff; // Not 64bit safe!
ri->defaultKey2 = (uintptr_t)ri->vertBuff; // Not 64bit safe!

// Submit our RenderInst to the RenderPassManager
state->getRenderPass()->addInst( ri );
Expand Down
2 changes: 1 addition & 1 deletion Engine/source/T3D/debris.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ void DebrisData::packData(BitStream* stream)

if( stream->writeFlag( explosion ) )
{
stream->writeRangedU32(packed? SimObjectId(explosion):
stream->writeRangedU32(packed? SimObjectId((uintptr_t)explosion):

This comment has been minimized.

Copy link
@jamesu

jamesu Jan 30, 2015

Contributor

Just a thought, perhaps it would be better to use a template'd union for these fields that way you wouldn't have to have an ugly cast.

This comment has been minimized.

Copy link
@LuisAntonRebollo

LuisAntonRebollo Jan 30, 2015

Author Contributor

Yes, current code is horrible :(

We need to rewrite this part. Added to #1144

This comment has been minimized.

Copy link
@crabmusket

crabmusket Jan 30, 2015

Contributor

Wait a sec, why is SimObjectId going hand-in-hand with uintptr_t? SimObjectId is the script ID number. Nothing to do with pointers.

This comment has been minimized.

Copy link
@jamesu

jamesu Jan 30, 2015

Contributor

The pointer to the object is used as temporary storage to read an object id from the net code which is then loaded and converted to an object instance client side.

This comment has been minimized.

Copy link
@crabmusket

crabmusket Jan 30, 2015

Contributor

That... seems like a bad idea. Turns out I don't understand this bit of code though. It seems like if packed is true, we're sending a raw pointer to a datablock...? Which is then unpacked as an object ID? Oh, so packed means somehow that we haven't yet converted the ID number we got from scripts into a proper pointer?

This comment has been minimized.

Copy link
@jamesu

jamesu Jan 30, 2015

Contributor

This is documented in the GameBaseData and SimDataBlock classes. It's related to the demo recording.

explosion->getId(),DataBlockObjectIdFirst,DataBlockObjectIdLast);
}

Expand Down
2 changes: 1 addition & 1 deletion Engine/source/T3D/examples/renderMeshExample.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,7 @@ void RenderMeshExample::prepRenderImage( SceneRenderState *state )

// We sort by the material then vertex buffer
ri->defaultKey = matInst->getStateHint();
ri->defaultKey2 = (U32)ri->vertBuff; // Not 64bit safe!
ri->defaultKey2 = (uintptr_t)ri->vertBuff; // Not 64bit safe!

// Submit our RenderInst to the RenderPassManager
state->getRenderPass()->addInst( ri );
Expand Down
2 changes: 1 addition & 1 deletion Engine/source/T3D/fx/particleEmitter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -926,7 +926,7 @@ void ParticleEmitter::prepRenderImage(SceneRenderState* state)
ri->softnessDistance = mDataBlock->softnessDistance;

// Sort by texture too.
ri->defaultKey = ri->diffuseTex ? (U32)ri->diffuseTex : (U32)ri->vertBuff;
ri->defaultKey = ri->diffuseTex ? (uintptr_t)ri->diffuseTex : (uintptr_t)ri->vertBuff;

renderManager->addInst( ri );

Expand Down
2 changes: 1 addition & 1 deletion Engine/source/T3D/fx/ribbon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -527,7 +527,7 @@ void Ribbon::prepRenderImage(SceneRenderState *state)
} else {
ri->defaultKey = 1;
}
ri->defaultKey2 = (U32)ri->vertBuff; // Not 64bit safe!
ri->defaultKey2 = (uintptr_t)ri->vertBuff; // Not 64bit safe!

state->getRenderPass()->addInst(ri);
}
Expand Down
2 changes: 1 addition & 1 deletion Engine/source/T3D/lightFlareData.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -608,7 +608,7 @@ void LightFlareData::prepRender( SceneRenderState *state, LightFlareState *flare
ri->blendStyle = ParticleRenderInst::BlendGreyscale;
ri->diffuseTex = mFlareTexture;
ri->softnessDistance = 1.0f;
ri->defaultKey = ri->diffuseTex ? (U32)ri->diffuseTex : (U32)ri->vertBuff; // Sort by texture too.
ri->defaultKey = ri->diffuseTex ? (uintptr_t)ri->diffuseTex : (uintptr_t)ri->vertBuff; // Sort by texture too.

// NOTE: Offscreen partical code is currently disabled.
ri->systemState = PSS_AwaitingHighResDraw;
Expand Down
4 changes: 2 additions & 2 deletions Engine/source/T3D/shapeBase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -707,7 +707,7 @@ void ShapeBaseData::packData(BitStream* stream)

if( stream->writeFlag( debris != NULL ) )
{
stream->writeRangedU32(packed? SimObjectId(debris):
stream->writeRangedU32(packed? SimObjectId((uintptr_t)debris):
debris->getId(),DataBlockObjectIdFirst,DataBlockObjectIdLast);
}

Expand Down Expand Up @@ -2090,7 +2090,7 @@ void ShapeBase::updateAudioState(Sound& st)
{
if ( isGhost() )
{
if ( Sim::findObject( SimObjectId( st.profile ), st.profile ) )
if ( Sim::findObject( SimObjectId((uintptr_t)st.profile), st.profile ) )
{
st.sound = SFX->createSource( st.profile, &getTransform() );
if ( st.sound )
Expand Down
10 changes: 5 additions & 5 deletions Engine/source/T3D/shapeImage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -405,12 +405,12 @@ bool ShapeBaseImageData::preload(bool server, String &errorStr)
// Resolve objects transmitted from server
if (!server) {
if (projectile)
if (Sim::findObject(SimObjectId(projectile), projectile) == false)
if (Sim::findObject(SimObjectId((uintptr_t)projectile), projectile) == false)
Con::errorf(ConsoleLogEntry::General, "Error, unable to load projectile for shapebaseimagedata");

for (U32 i = 0; i < MaxStates; i++) {
if (state[i].emitter)
if (!Sim::findObject(SimObjectId(state[i].emitter), state[i].emitter))
if (!Sim::findObject(SimObjectId((uintptr_t)state[i].emitter), state[i].emitter))
Con::errorf(ConsoleLogEntry::General, "Error, unable to load emitter for image datablock");

String str;
Expand Down Expand Up @@ -1008,7 +1008,7 @@ void ShapeBaseImageData::packData(BitStream* stream)

// Write the projectile datablock
if (stream->writeFlag(projectile))
stream->writeRangedU32(packed? SimObjectId(projectile):
stream->writeRangedU32(packed? SimObjectId((uintptr_t)projectile):
projectile->getId(),DataBlockObjectIdFirst,DataBlockObjectIdLast);

stream->writeFlag(cloakable);
Expand Down Expand Up @@ -1036,7 +1036,7 @@ void ShapeBaseImageData::packData(BitStream* stream)

if( stream->writeFlag( casing ) )
{
stream->writeRangedU32(packed? SimObjectId(casing):
stream->writeRangedU32(packed? SimObjectId((uintptr_t)casing):
casing->getId(),DataBlockObjectIdFirst,DataBlockObjectIdLast);
}

Expand Down Expand Up @@ -1125,7 +1125,7 @@ void ShapeBaseImageData::packData(BitStream* stream)

if (stream->writeFlag(s.emitter))
{
stream->writeRangedU32(packed? SimObjectId(s.emitter):
stream->writeRangedU32(packed? SimObjectId((uintptr_t)s.emitter):
s.emitter->getId(),DataBlockObjectIdFirst,DataBlockObjectIdLast);
stream->write(s.emitterTime);

Expand Down
2 changes: 1 addition & 1 deletion Engine/source/T3D/tsStatic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1019,7 +1019,7 @@ void TSStaticPolysoupConvex::getPolyList(AbstractPolyList *list)
list->addPoint(verts[2]);
list->addPoint(verts[1]);

list->begin(0, (U32)idx ^ (U32)mesh);
list->begin(0, (U32)idx ^ (uintptr_t)mesh);
list->vertex(base + 2);
list->vertex(base + 1);
list->vertex(base + 0);
Expand Down
8 changes: 4 additions & 4 deletions Engine/source/T3D/vehicles/flyingVehicle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -134,11 +134,11 @@ bool FlyingVehicleData::preload(bool server, String &errorStr)
if (!server) {
for (S32 i = 0; i < MaxSounds; i++)
if (sound[i])
Sim::findObject(SimObjectId(sound[i]),sound[i]);
Sim::findObject(SimObjectId((uintptr_t)sound[i]),sound[i]);

for (S32 j = 0; j < MaxJetEmitters; j++)
if (jetEmitter[j])
Sim::findObject(SimObjectId(jetEmitter[j]),jetEmitter[j]);
Sim::findObject(SimObjectId((uintptr_t)jetEmitter[j]),jetEmitter[j]);
}

// Extract collision planes from shape collision detail level
Expand Down Expand Up @@ -244,7 +244,7 @@ void FlyingVehicleData::packData(BitStream* stream)
{
if (stream->writeFlag(sound[i]))
{
SimObjectId writtenId = packed ? SimObjectId(sound[i]) : sound[i]->getId();
SimObjectId writtenId = packed ? SimObjectId((uintptr_t)sound[i]) : sound[i]->getId();
stream->writeRangedU32(writtenId, DataBlockObjectIdFirst, DataBlockObjectIdLast);
}
}
Expand All @@ -253,7 +253,7 @@ void FlyingVehicleData::packData(BitStream* stream)
{
if (stream->writeFlag(jetEmitter[j]))
{
SimObjectId writtenId = packed ? SimObjectId(jetEmitter[j]) : jetEmitter[j]->getId();
SimObjectId writtenId = packed ? SimObjectId((uintptr_t)jetEmitter[j]) : jetEmitter[j]->getId();
stream->writeRangedU32(writtenId, DataBlockObjectIdFirst,DataBlockObjectIdLast);
}
}
Expand Down
8 changes: 4 additions & 4 deletions Engine/source/T3D/vehicles/hoverVehicle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -315,10 +315,10 @@ bool HoverVehicleData::preload(bool server, String &errorStr)
if (!server) {
for (S32 i = 0; i < MaxSounds; i++)
if (sound[i])
Sim::findObject(SimObjectId(sound[i]),sound[i]);
Sim::findObject(SimObjectId((uintptr_t)sound[i]),sound[i]);
for (S32 j = 0; j < MaxJetEmitters; j++)
if (jetEmitter[j])
Sim::findObject(SimObjectId(jetEmitter[j]),jetEmitter[j]);
Sim::findObject(SimObjectId((uintptr_t)jetEmitter[j]),jetEmitter[j]);
}

if( !dustTrailEmitter && dustTrailID != 0 )
Expand Down Expand Up @@ -364,14 +364,14 @@ void HoverVehicleData::packData(BitStream* stream)

for (S32 i = 0; i < MaxSounds; i++)
if (stream->writeFlag(sound[i]))
stream->writeRangedU32(packed? SimObjectId(sound[i]):
stream->writeRangedU32(packed? SimObjectId((uintptr_t)sound[i]):
sound[i]->getId(),DataBlockObjectIdFirst,DataBlockObjectIdLast);

for (S32 j = 0; j < MaxJetEmitters; j++)
{
if (stream->writeFlag(jetEmitter[j]))
{
SimObjectId writtenId = packed ? SimObjectId(jetEmitter[j]) : jetEmitter[j]->getId();
SimObjectId writtenId = packed ? SimObjectId((uintptr_t)jetEmitter[j]) : jetEmitter[j]->getId();
stream->writeRangedU32(writtenId, DataBlockObjectIdFirst,DataBlockObjectIdLast);
}
}
Expand Down
4 changes: 2 additions & 2 deletions Engine/source/T3D/vehicles/vehicle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ bool VehicleData::preload(bool server, String &errorStr)
if (!server) {
for (S32 i = 0; i < Body::MaxSounds; i++)
if (body.sound[i])
Sim::findObject(SimObjectId(body.sound[i]),body.sound[i]);
Sim::findObject(SimObjectId((uintptr_t)body.sound[i]),body.sound[i]);
}

if( !dustEmitter && dustID != 0 )
Expand Down Expand Up @@ -275,7 +275,7 @@ void VehicleData::packData(BitStream* stream)
stream->write(body.friction);
for (i = 0; i < Body::MaxSounds; i++)
if (stream->writeFlag(body.sound[i]))
stream->writeRangedU32(packed? SimObjectId(body.sound[i]):
stream->writeRangedU32(packed? SimObjectId((uintptr_t)body.sound[i]):
body.sound[i]->getId(),DataBlockObjectIdFirst,
DataBlockObjectIdLast);

Expand Down
4 changes: 2 additions & 2 deletions Engine/source/T3D/vehicles/wheeledVehicle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,7 @@ bool WheeledVehicleData::preload(bool server, String &errorStr)
return false;

if (tireEmitter)
Sim::findObject(SimObjectId(tireEmitter),tireEmitter);
Sim::findObject(SimObjectId((uintptr_t)tireEmitter),tireEmitter);
}

// Extract wheel information from the shape
Expand Down Expand Up @@ -477,7 +477,7 @@ void WheeledVehicleData::packData(BitStream* stream)
Parent::packData(stream);

if (stream->writeFlag(tireEmitter))
stream->writeRangedU32(packed? SimObjectId(tireEmitter):
stream->writeRangedU32(packed? SimObjectId((uintptr_t)tireEmitter):
tireEmitter->getId(),DataBlockObjectIdFirst,DataBlockObjectIdLast);

for (S32 i = 0; i < MaxSounds; i++)
Expand Down
2 changes: 1 addition & 1 deletion Engine/source/console/engineTypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -575,7 +575,7 @@ namespace _Private {

///
#define FIELDOFFSET( fieldName ) \
U32( ( ( const char* ) &( ( ( ThisType* ) 16 )->fieldName ) ) - 16 ) // Artificial offset to avoid compiler warnings.
uintptr_t( ( ( const char* ) &( ( ( ThisType* ) 16 )->fieldName ) ) - 16 ) // Artificial offset to avoid compiler warnings.

This comment has been minimized.

Copy link
@jamesu

jamesu Jan 30, 2015

Contributor

This doesn't seem to work with OSX x64. I'm getting "Non-constant-expression cannot be narrowed from type 'uintptr_t' (aka 'unsigned long') to 'U32' (aka 'unsigned int') in initializer list" when this macro is invoked

This comment has been minimized.

Copy link
@LuisAntonRebollo

LuisAntonRebollo Jan 30, 2015

Author Contributor

mmmmm i think i need some help with this :p

Added to #1144

This comment has been minimized.

Copy link
@jamesu

jamesu Jan 30, 2015

Contributor

Changing FIELD to this seems to fix the problem for me, though note I have not tested it properly yet since I haven't made a successful build yet.

[code]

define FIELD( fieldName, exportName, numElements, doc ) \

{ #exportName, doc, numElements, TYPE( ( ( ThisType* ) 16 )->fieldName ), (U32)FIELDOFFSET( fieldName ) }, // Artificial offset to avoid compiler warnings.
[/code]

This comment has been minimized.

Copy link
@LuisAntonRebollo

LuisAntonRebollo Jan 30, 2015

Author Contributor

Thx for the idea, we need to find a good way to test/fix this.

This comment has been minimized.

Copy link
@jamesu

jamesu Jan 30, 2015

Contributor

The aforementioned fix works. Can now build a 64bit OSX build on my end (- some carbon and font stuff)

This comment has been minimized.

Copy link
@LuisAntonRebollo

LuisAntonRebollo Jan 30, 2015

Author Contributor

Thx for feedback, i will try test on Windows/Ubuntu and add the change this weekend.

This comment has been minimized.

Copy link
@LuisAntonRebollo

LuisAntonRebollo Jan 31, 2015

Author Contributor

@jamesu, can you test this change?

#define FIELDOFFSET( fieldName ) \
   (dsize_t)uintptr_t( ( ( const char* ) &( ( ( ThisType* ) 16 )->fieldName ) ) - 16 ) // Artificial offset to avoid compiler warnings.

This comment has been minimized.

Copy link
@jamesu

jamesu Feb 1, 2015

Contributor

@LuisAntonRebollo that doesn't work here as dsize_t is 64bit whereas the field offset is stored as 32bit. It's simpler just casting to U32 in the struct initializer.

This comment has been minimized.

Copy link
@LuisAntonRebollo

LuisAntonRebollo Feb 1, 2015

Author Contributor

Your right, sorry i was thinking on function addField that use dsize_t for offset. Thx for test... fixed on #1149.


///
#define CLASSDOC( className, doc ) \
Expand Down
2 changes: 1 addition & 1 deletion Engine/source/core/util/tDictionary.h
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ namespace DictHash

inline U32 hash(const void *data)
{
return (U32)data;
return (uintptr_t)data;

This comment has been minimized.

Copy link
@jamesu

jamesu Jan 30, 2015

Contributor

Might be an idea to make a type for this, like UPTR? Just for consistency with the other typedefs.

This comment has been minimized.

Copy link
@LuisAntonRebollo

LuisAntonRebollo Jan 30, 2015

Author Contributor

I prefer to use c++ library types, but for consistency its better a new type.

Added to #1144

}

template<class A, class B>
Expand Down
2 changes: 1 addition & 1 deletion Engine/source/environment/meshRoad.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -864,7 +864,7 @@ void MeshRoad::prepRenderImage( SceneRenderState* state )

// We sort by the material then vertex buffer.
ri->defaultKey = matInst->getStateHint();
ri->defaultKey2 = (U32)ri->vertBuff; // Not 64bit safe!
ri->defaultKey2 = (uintptr_t)ri->vertBuff; // Not 64bit safe!

renderPass->addInst( ri );
}
Expand Down
6 changes: 3 additions & 3 deletions Engine/source/forest/editor/forestUndo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ void ForestCreateUndoAction::redo()
// We store the datablock ID rather than the actual pointer
// since the pointer could go bad.
ForestItemData *data;
if ( !Sim::findObject( (SimObjectId)(item.getData()), data ) )
if ( !Sim::findObject( (SimObjectId)(uintptr_t)(item.getData()), data ) )
{
Con::errorf( "ForestCreateUndoAction::redo() - ForestItemData for item to restore does not seem to exist. Undo stack may be hosed." );
continue;
Expand Down Expand Up @@ -140,7 +140,7 @@ void ForestDeleteUndoAction::undo()
// We store the datablock ID rather than the actual pointer
// since the pointer could go bad.
ForestItemData *data;
if ( !Sim::findObject( (SimObjectId)(item.getData()), data ) )
if ( !Sim::findObject( (SimObjectId)(uintptr_t)(item.getData()), data ) )
{
Con::errorf( "ForestDeleteUndoAction::undo() - ForestItemData for item to restore does not seem to exist. Undo stack may be hosed." );
continue;
Expand Down Expand Up @@ -201,7 +201,7 @@ void ForestUpdateAction::_swapState()
// We store the datablock ID rather than the actual pointer
// since the pointer could go bad.
ForestItemData *data;
if ( !Sim::findObject( (SimObjectId)(item.getData()), data ) )
if ( !Sim::findObject( (SimObjectId)(uintptr_t)(item.getData()), data ) )
{
Con::errorf( "ForestUpdateAction::_swapState() - ForestItemData for item to restore does not seem to exist. Undo stack may be hosed." );
continue;
Expand Down
4 changes: 2 additions & 2 deletions Engine/source/gfx/gfxStringEnumTranslate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,9 @@ _STRING_VALUE_LOOKUP_FXN(GFXStringBlendOp);

#define VALIDATE_LOOKUPTABLE( tablearray, enumprefix ) \
for( S32 i = enumprefix##_FIRST; i < enumprefix##_COUNT; i++ ) \
if( (S32)tablearray[i] == GFX_UNINIT_VAL ) \
if( (intptr_t)tablearray[i] == GFX_UNINIT_VAL ) \
Con::warnf( "GFXStringEnumTranslate: Unassigned value in " #tablearray ": %i", i ); \
else if( (S32)tablearray[i] == GFX_UNSUPPORTED_VAL ) \
else if( (intptr_t)tablearray[i] == GFX_UNSUPPORTED_VAL ) \
Con::warnf( "GFXStringEnumTranslate: Unsupported value in " #tablearray ": %i", i );

//------------------------------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion Engine/source/gfx/gl/gfxGLVertexDecl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ void GFXGLVertexDecl::prepareVertexFormat() const
{
const glVertexAttribData &glElement = glVerticesFormat[i];

glVertexAttribFormat( glElement.attrIndex, glElement.elementCount, glElement.type, glElement.normalized, (U32)glElement.pointerFirst );
glVertexAttribFormat( glElement.attrIndex, glElement.elementCount, glElement.type, glElement.normalized, (uintptr_t)glElement.pointerFirst );
glVertexAttribBinding( glElement.attrIndex, glElement.stream );
}

Expand Down
8 changes: 4 additions & 4 deletions Engine/source/gui/controls/guiListBoxCtrl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -924,7 +924,7 @@ SimObject* GuiListBoxCtrl::getItemObject( S32 index )
}

SimObject *outObj;
Sim::findObject( (SimObjectId)(mItems[ index ]->itemData), outObj );
Sim::findObject( (SimObjectId)(uintptr_t)(mItems[ index ]->itemData), outObj );

return outObj;
}
Expand Down Expand Up @@ -1481,7 +1481,7 @@ void GuiListBoxCtrl::_mirror()

for ( U32 i = 0; i < mItems.size(); i++ )
{
curId = (SimObjectId)mItems[i]->itemData;
curId = (SimObjectId)(uintptr_t)mItems[i]->itemData;

Sim::findObject( curId, curObj );

Expand Down Expand Up @@ -1515,7 +1515,7 @@ void GuiListBoxCtrl::_mirror()

for ( U32 j = 0; j < mItems.size(); j++ )
{
if ( (SimObjectId)(mItems[j]->itemData) == curId )
if ( (SimObjectId)(uintptr_t)(mItems[j]->itemData) == curId )
{
found = true;
break;
Expand All @@ -1524,7 +1524,7 @@ void GuiListBoxCtrl::_mirror()

for ( U32 j = 0; j < mFilteredItems.size(); j++ )
{
if ( (SimObjectId)(mFilteredItems[j]->itemData) == curId )
if ( (SimObjectId)(uintptr_t)(mFilteredItems[j]->itemData) == curId )
{
found = true;
break;
Expand Down
4 changes: 2 additions & 2 deletions Engine/source/math/util/matrixSet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ MatrixSet::MatrixSet()
// this class will provide a place where aligned/specalized matrix math can take place.
// We should be able to plug in any kind of platform-specific optimization
// behind the delgates.
AssertFatal( ((int)this & 0xF) == 0, "MatrixSet has been allocated off a 16-byte boundary!" );
AssertFatal( ((intptr_t)this & 0xF) == 0, "MatrixSet has been allocated off a 16-byte boundary!" );

// Must be initialized by name, not a for(), it's macro magic
MATRIX_SET_BIND_VALUE(ObjectToWorld);
Expand All @@ -47,4 +47,4 @@ MatrixSet::MatrixSet()

mViewSource = NULL;
mProjectionSource = NULL;
}
}
Loading

1 comment on commit 4e90348

@dragutux
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

congratulation, this breaks the windows build when using bullet by creating a redefinitin of uint64_t, i have deduced that the inclusion of stdint.h was probably the source, note that bullet has a keyword to skip their definition.

Please sign in to comment.