mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-02-28 02:53:49 +00:00
Clean up MSVC warning [C4312] conversion from type to type * of greater size
This commit is contained in:
parent
265e64f6fc
commit
31d0eb16f8
21 changed files with 39 additions and 39 deletions
|
|
@ -490,7 +490,7 @@ void ParticleEmitterData::unpackData(BitStream* stream)
|
|||
#if defined(AFX_CAP_PARTICLE_POOLS)
|
||||
if (stream->readFlag())
|
||||
{
|
||||
pool_datablock = (afxParticlePoolData*)stream->readRangedU32(DataBlockObjectIdFirst, DataBlockObjectIdLast);
|
||||
pool_datablock = (afxParticlePoolData*)(uintptr_t)stream->readRangedU32(DataBlockObjectIdFirst, DataBlockObjectIdLast);
|
||||
stream->read(&pool_index);
|
||||
pool_depth_fade = stream->readFlag();
|
||||
pool_radial_fade = stream->readFlag();
|
||||
|
|
|
|||
|
|
@ -3259,7 +3259,7 @@ void ShapeBase::unpackUpdate(NetConnection *con, BitStream *stream)
|
|||
st.play = stream->readFlag();
|
||||
if ( st.play )
|
||||
{
|
||||
st.profile = (SFXTrack*) stream->readRangedU32( DataBlockObjectIdFirst,
|
||||
st.profile = (SFXTrack*)(uintptr_t)stream->readRangedU32( DataBlockObjectIdFirst,
|
||||
DataBlockObjectIdLast );
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1202,7 +1202,7 @@ void ShapeBaseImageData::unpackData(BitStream* stream)
|
|||
}
|
||||
|
||||
projectile = (stream->readFlag() ?
|
||||
(ProjectileData*)stream->readRangedU32(DataBlockObjectIdFirst,
|
||||
(ProjectileData*)(uintptr_t)stream->readRangedU32(DataBlockObjectIdFirst,
|
||||
DataBlockObjectIdLast) : 0);
|
||||
|
||||
cloakable = stream->readFlag();
|
||||
|
|
@ -1340,7 +1340,7 @@ void ShapeBaseImageData::unpackData(BitStream* stream)
|
|||
|
||||
if (stream->readFlag())
|
||||
{
|
||||
s.emitter = (ParticleEmitterData*) stream->readRangedU32(DataBlockObjectIdFirst,
|
||||
s.emitter = (ParticleEmitterData*)(uintptr_t)stream->readRangedU32(DataBlockObjectIdFirst,
|
||||
DataBlockObjectIdLast);
|
||||
stream->read(&s.emitterTime);
|
||||
|
||||
|
|
|
|||
|
|
@ -282,14 +282,14 @@ void FlyingVehicleData::unpackData(BitStream* stream)
|
|||
for (S32 i = 0; i < MaxSounds; i++) {
|
||||
sound[i] = NULL;
|
||||
if (stream->readFlag())
|
||||
sound[i] = (SFXProfile*)stream->readRangedU32(DataBlockObjectIdFirst,
|
||||
sound[i] = (SFXProfile*)(uintptr_t)stream->readRangedU32(DataBlockObjectIdFirst,
|
||||
DataBlockObjectIdLast);
|
||||
}
|
||||
|
||||
for (S32 j = 0; j < MaxJetEmitters; j++) {
|
||||
jetEmitter[j] = NULL;
|
||||
if (stream->readFlag())
|
||||
jetEmitter[j] = (ParticleEmitterData*)stream->readRangedU32(DataBlockObjectIdFirst,
|
||||
jetEmitter[j] = (ParticleEmitterData*)(uintptr_t)stream->readRangedU32(DataBlockObjectIdFirst,
|
||||
DataBlockObjectIdLast);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -411,13 +411,13 @@ void HoverVehicleData::unpackData(BitStream* stream)
|
|||
|
||||
for (S32 i = 0; i < MaxSounds; i++)
|
||||
sound[i] = stream->readFlag()?
|
||||
(SFXProfile*) stream->readRangedU32(DataBlockObjectIdFirst,
|
||||
(SFXProfile*)(uintptr_t)stream->readRangedU32(DataBlockObjectIdFirst,
|
||||
DataBlockObjectIdLast): 0;
|
||||
|
||||
for (S32 j = 0; j < MaxJetEmitters; j++) {
|
||||
jetEmitter[j] = NULL;
|
||||
if (stream->readFlag())
|
||||
jetEmitter[j] = (ParticleEmitterData*)stream->readRangedU32(DataBlockObjectIdFirst,
|
||||
jetEmitter[j] = (ParticleEmitterData*)(uintptr_t)stream->readRangedU32(DataBlockObjectIdFirst,
|
||||
DataBlockObjectIdLast);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -374,7 +374,7 @@ void VehicleData::unpackData(BitStream* stream)
|
|||
for (i = 0; i < Body::MaxSounds; i++) {
|
||||
body.sound[i] = NULL;
|
||||
if (stream->readFlag())
|
||||
body.sound[i] = (SFXProfile*)stream->readRangedU32(DataBlockObjectIdFirst,
|
||||
body.sound[i] = (SFXProfile*)(uintptr_t)stream->readRangedU32(DataBlockObjectIdFirst,
|
||||
DataBlockObjectIdLast);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -494,7 +494,7 @@ void WheeledVehicleData::unpackData(BitStream* stream)
|
|||
Parent::unpackData(stream);
|
||||
|
||||
tireEmitter = stream->readFlag()?
|
||||
(ParticleEmitterData*) stream->readRangedU32(DataBlockObjectIdFirst,
|
||||
(ParticleEmitterData*)(uintptr_t)stream->readRangedU32(DataBlockObjectIdFirst,
|
||||
DataBlockObjectIdLast): 0;
|
||||
|
||||
for (S32 i = 0; i < MaxSounds; i++)
|
||||
|
|
|
|||
|
|
@ -133,7 +133,7 @@ void afxEffectGroupData::unpack_fx(BitStream* stream, afxEffectList& fx)
|
|||
fx.clear();
|
||||
S32 n_fx = stream->readInt(EFFECTS_PER_PHRASE_BITS);
|
||||
for (int i = 0; i < n_fx; i++)
|
||||
fx.push_back((afxEffectWrapperData*)readDatablockID(stream));
|
||||
fx.push_back((afxEffectWrapperData*)(uintptr_t)readDatablockID(stream));
|
||||
}
|
||||
|
||||
#define myOffset(field) Offset(field, afxEffectGroupData)
|
||||
|
|
|
|||
|
|
@ -608,7 +608,7 @@ void afxEffectWrapperData::unpack_mods(BitStream* stream, afxXM_BaseData* mods[]
|
|||
{
|
||||
S32 n_mods = stream->readInt(6);
|
||||
for (int i = 0; i < n_mods; i++)
|
||||
mods[i] = (afxXM_BaseData*) readDatablockID(stream);
|
||||
mods[i] = (afxXM_BaseData*)(uintptr_t)readDatablockID(stream);
|
||||
}
|
||||
|
||||
bool afxEffectWrapperData::preload(bool server, String &errorStr)
|
||||
|
|
|
|||
|
|
@ -147,7 +147,7 @@ void afxEffectronData::unpack_fx(BitStream* stream, afxEffectList& fx)
|
|||
fx.clear();
|
||||
S32 n_fx = stream->readInt(EFFECTS_PER_PHRASE_BITS);
|
||||
for (int i = 0; i < n_fx; i++)
|
||||
fx.push_back((afxEffectWrapperData*)readDatablockID(stream));
|
||||
fx.push_back((afxEffectWrapperData*)(uintptr_t)readDatablockID(stream));
|
||||
}
|
||||
|
||||
void afxEffectronData::packData(BitStream* stream)
|
||||
|
|
|
|||
|
|
@ -304,7 +304,7 @@ void afxMagicSpellData::unpack_fx(BitStream* stream, afxEffectList& fx)
|
|||
fx.clear();
|
||||
S32 n_fx = stream->readInt(EFFECTS_PER_PHRASE_BITS);
|
||||
for (int i = 0; i < n_fx; i++)
|
||||
fx.push_back((afxEffectWrapperData*)readDatablockID(stream));
|
||||
fx.push_back((afxEffectWrapperData*)(uintptr_t)readDatablockID(stream));
|
||||
}
|
||||
|
||||
void afxMagicSpellData::packData(BitStream* stream)
|
||||
|
|
@ -356,7 +356,7 @@ void afxMagicSpellData::unpackData(BitStream* stream)
|
|||
mDo_move_interrupts = stream->readFlag();
|
||||
stream->read(&mMove_interrupt_speed);
|
||||
|
||||
mMissile_db = (afxMagicMissileData*) readDatablockID(stream);
|
||||
mMissile_db = (afxMagicMissileData*)(uintptr_t)readDatablockID(stream);
|
||||
stream->read(&mLaunch_on_server_signal);
|
||||
stream->read(&mPrimary_target_types);
|
||||
|
||||
|
|
|
|||
|
|
@ -214,7 +214,7 @@ void afxSelectronData::unpack_fx(BitStream* stream, afxEffectList& fx)
|
|||
fx.clear();
|
||||
S32 n_fx = stream->readInt(EFFECTS_PER_PHRASE_BITS);
|
||||
for (int i = 0; i < n_fx; i++)
|
||||
fx.push_back((afxEffectWrapperData*)readDatablockID(stream));
|
||||
fx.push_back((afxEffectWrapperData*)(uintptr_t)readDatablockID(stream));
|
||||
}
|
||||
|
||||
void afxSelectronData::packData(BitStream* stream)
|
||||
|
|
|
|||
|
|
@ -128,7 +128,7 @@ void afxSpellBookData::unpackData(BitStream* stream)
|
|||
|
||||
do_id_convert = true;
|
||||
for (S32 i = 0; i < pages_per_book*spells_per_page; i++)
|
||||
rpg_spells[i] = (afxRPGMagicSpellData*) readDatablockID(stream);
|
||||
rpg_spells[i] = (afxRPGMagicSpellData*)(uintptr_t)readDatablockID(stream);
|
||||
}
|
||||
|
||||
DefineEngineMethod(afxSpellBookData, getPageSlotIndex, S32, (Point2I bookSlot),,
|
||||
|
|
|
|||
|
|
@ -195,8 +195,8 @@ void afxT3DLightBaseData::unpackData(BitStream* stream)
|
|||
stream->read( &mAnimState.animationPhase );
|
||||
stream->read( &mFlareScale );
|
||||
|
||||
mAnimationData = (LightAnimData*) readDatablockID(stream);
|
||||
mFlareData = (LightFlareData*) readDatablockID(stream);
|
||||
mAnimationData = (LightAnimData*)(uintptr_t)readDatablockID(stream);
|
||||
mFlareData = (LightFlareData*)(uintptr_t)readDatablockID(stream);
|
||||
|
||||
do_id_convert = true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -215,7 +215,7 @@ void afxPhraseEffectData::unpack_fx(BitStream* stream, afxEffectList& fx)
|
|||
fx.clear();
|
||||
S32 n_fx = stream->readInt(EFFECTS_PER_PHRASE_BITS);
|
||||
for (int i = 0; i < n_fx; i++)
|
||||
fx.push_back((afxEffectWrapperData*)readDatablockID(stream));
|
||||
fx.push_back((afxEffectWrapperData*)(uintptr_t)readDatablockID(stream));
|
||||
}
|
||||
|
||||
void afxPhraseEffectData::packData(BitStream* stream)
|
||||
|
|
|
|||
|
|
@ -55,7 +55,7 @@ void ForestCreateUndoAction::addItem( ForestItemData *data,
|
|||
// We store the datablock ID rather than the actual pointer
|
||||
// since the pointer could go bad.
|
||||
SimObjectId dataId = item.getData()->getId();
|
||||
mItems.last().setData( (ForestItemData*)dataId );
|
||||
mItems.last().setData( (ForestItemData*)(uintptr_t)dataId );
|
||||
}
|
||||
|
||||
void ForestCreateUndoAction::redo()
|
||||
|
|
@ -110,7 +110,7 @@ void ForestDeleteUndoAction::removeItem( const ForestItem &item )
|
|||
SimObjectId dataId = item.getData()->getId();
|
||||
|
||||
mItems.push_back( item );
|
||||
mItems.last().setData( (ForestItemData*)dataId );
|
||||
mItems.last().setData( (ForestItemData*)(uintptr_t)dataId );
|
||||
mData->removeItem( item.getKey(), item.getPosition() );
|
||||
}
|
||||
|
||||
|
|
@ -171,7 +171,7 @@ void ForestUpdateAction::saveItem( const ForestItem &item )
|
|||
// We store the datablock ID rather than the actual pointer
|
||||
// since the pointer could go bad.
|
||||
SimObjectId dataId = item.getData()->getId();
|
||||
mItems.last().setData( (ForestItemData*)dataId );
|
||||
mItems.last().setData( (ForestItemData*)(uintptr_t)dataId );
|
||||
}
|
||||
|
||||
void ForestUpdateAction::_swapState()
|
||||
|
|
@ -215,7 +215,7 @@ void ForestUpdateAction::_swapState()
|
|||
item.getScale() );
|
||||
|
||||
// Save the state before this swap for the next swap.
|
||||
newItem.setData( (ForestItemData*)data->getId() );
|
||||
newItem.setData( (ForestItemData*)(uintptr_t)data->getId() );
|
||||
mItems.push_back( newItem );
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -77,11 +77,11 @@ _STRING_VALUE_LOOKUP_FXN(GFXStringBlendOp);
|
|||
|
||||
#define INIT_LOOKUPTABLE( tablearray, enumprefix, type ) \
|
||||
for( S32 i = enumprefix##_FIRST; i < enumprefix##_COUNT; i++ ) \
|
||||
tablearray[i] = (type)GFX_UNINIT_VAL;
|
||||
tablearray[i] = (type)(uintptr_t)GFX_UNINIT_VAL;
|
||||
#define INIT_LOOKUPTABLE_EX( tablearray, enumprefix, type, typeTable ) \
|
||||
for( S32 i = enumprefix##_FIRST; i < enumprefix##_COUNT; i++ ) \
|
||||
{\
|
||||
tablearray[i] = (type)GFX_UNINIT_VAL;\
|
||||
tablearray[i] = (type)(uintptr_t)GFX_UNINIT_VAL;\
|
||||
typeTable[i] = &defaultStringValueLookup;\
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -131,7 +131,7 @@ void GFXGLPrimitiveBuffer::finish()
|
|||
GLvoid* GFXGLPrimitiveBuffer::getBuffer()
|
||||
{
|
||||
// NULL specifies no offset into the hardware buffer
|
||||
return (GLvoid*)mBufferOffset;
|
||||
return (GLvoid*)(uintptr_t)mBufferOffset;
|
||||
}
|
||||
|
||||
void GFXGLPrimitiveBuffer::zombify()
|
||||
|
|
|
|||
|
|
@ -130,7 +130,7 @@ void GFXGLVertexDecl::_initVerticesFormat(U32 stream)
|
|||
glElement.normalized = false;
|
||||
glElement.type = GL_FLOAT;
|
||||
glElement.stride = vertexSize;
|
||||
glElement.pointerFirst = (void*)buffer;
|
||||
glElement.pointerFirst = (void*)(uintptr_t)buffer;
|
||||
|
||||
buffer += element.getSizeInBytes();
|
||||
}
|
||||
|
|
@ -141,7 +141,7 @@ void GFXGLVertexDecl::_initVerticesFormat(U32 stream)
|
|||
glElement.normalized = false;
|
||||
glElement.type = GL_FLOAT;
|
||||
glElement.stride = vertexSize;
|
||||
glElement.pointerFirst = (void*)buffer;
|
||||
glElement.pointerFirst = (void*)(uintptr_t)buffer;
|
||||
|
||||
buffer += element.getSizeInBytes();
|
||||
}
|
||||
|
|
@ -152,7 +152,7 @@ void GFXGLVertexDecl::_initVerticesFormat(U32 stream)
|
|||
glElement.normalized = false;
|
||||
glElement.type = GL_FLOAT;
|
||||
glElement.stride = vertexSize;
|
||||
glElement.pointerFirst = (void*)buffer;
|
||||
glElement.pointerFirst = (void*)(uintptr_t)buffer;
|
||||
|
||||
buffer += element.getSizeInBytes();
|
||||
}
|
||||
|
|
@ -163,7 +163,7 @@ void GFXGLVertexDecl::_initVerticesFormat(U32 stream)
|
|||
glElement.normalized = false;
|
||||
glElement.type = GL_FLOAT;
|
||||
glElement.stride = vertexSize;
|
||||
glElement.pointerFirst = (void*)buffer;
|
||||
glElement.pointerFirst = (void*)(uintptr_t)buffer;
|
||||
|
||||
buffer += element.getSizeInBytes();
|
||||
}
|
||||
|
|
@ -174,7 +174,7 @@ void GFXGLVertexDecl::_initVerticesFormat(U32 stream)
|
|||
glElement.normalized = false;
|
||||
glElement.type = GL_FLOAT;
|
||||
glElement.stride = vertexSize;
|
||||
glElement.pointerFirst = (void*)buffer;
|
||||
glElement.pointerFirst = (void*)(uintptr_t)buffer;
|
||||
|
||||
buffer += element.getSizeInBytes();
|
||||
}
|
||||
|
|
@ -185,7 +185,7 @@ void GFXGLVertexDecl::_initVerticesFormat(U32 stream)
|
|||
glElement.normalized = true;
|
||||
glElement.type = GL_UNSIGNED_BYTE;
|
||||
glElement.stride = vertexSize;
|
||||
glElement.pointerFirst = (void*)buffer;
|
||||
glElement.pointerFirst = (void*)(uintptr_t)buffer;
|
||||
|
||||
buffer += element.getSizeInBytes();
|
||||
}
|
||||
|
|
@ -196,7 +196,7 @@ void GFXGLVertexDecl::_initVerticesFormat(U32 stream)
|
|||
glElement.normalized = false;
|
||||
glElement.type = GL_FLOAT;
|
||||
glElement.stride = vertexSize;
|
||||
glElement.pointerFirst = (void*)buffer;
|
||||
glElement.pointerFirst = (void*)(uintptr_t)buffer;
|
||||
|
||||
buffer += element.getSizeInBytes();
|
||||
}
|
||||
|
|
@ -207,7 +207,7 @@ void GFXGLVertexDecl::_initVerticesFormat(U32 stream)
|
|||
glElement.normalized = false;
|
||||
glElement.type = GL_UNSIGNED_BYTE;
|
||||
glElement.stride = vertexSize;
|
||||
glElement.pointerFirst = (void*)buffer;
|
||||
glElement.pointerFirst = (void*)(uintptr_t)buffer;
|
||||
|
||||
buffer += element.getSizeInBytes();
|
||||
}
|
||||
|
|
@ -221,7 +221,7 @@ void GFXGLVertexDecl::_initVerticesFormat(U32 stream)
|
|||
glElement.normalized = false;
|
||||
glElement.type = GL_FLOAT;
|
||||
glElement.stride = vertexSize;
|
||||
glElement.pointerFirst = (void*)buffer;
|
||||
glElement.pointerFirst = (void*)(uintptr_t)buffer;
|
||||
|
||||
buffer += element.getSizeInBytes();
|
||||
++texCoordIndex;
|
||||
|
|
|
|||
|
|
@ -631,7 +631,7 @@ DefineEngineMethod( GuiListBoxCtrl, addItem, S32, (const char* newItem, const ch
|
|||
else if(elementCount == 1)
|
||||
{
|
||||
U32 objId = dAtoi( color );
|
||||
return object->addItem( newItem, (void*)objId );
|
||||
return object->addItem( newItem, (void*)(uintptr_t)objId );
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -1523,7 +1523,7 @@ void GuiListBoxCtrl::_mirror()
|
|||
|
||||
if ( !found )
|
||||
{
|
||||
addItem( _makeMirrorItemName( curObj ), (void*)curId );
|
||||
addItem( _makeMirrorItemName( curObj ), (void*)(uintptr_t)curId );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -412,7 +412,7 @@ void TSShapeLoader::generateObjects()
|
|||
AppMesh* mesh = subshape->objMeshes[iMesh];
|
||||
mesh->detailSize = 2;
|
||||
String name = String::GetTrailingNumber( mesh->getName(), mesh->detailSize );
|
||||
name = getUniqueName( name, cmpMeshNameAndSize, meshNames, &(subshape->objMeshes), (void*)mesh->detailSize );
|
||||
name = getUniqueName( name, cmpMeshNameAndSize, meshNames, &(subshape->objMeshes), (void*)(uintptr_t)mesh->detailSize );
|
||||
meshNames.push_back( name );
|
||||
|
||||
// Fix up any collision details that don't have a negative detail level.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue