Merge pull request #2309 from suncaller/warning-purge

Remove redundant variables and clean up C4312 and C4305 warnings
This commit is contained in:
Areloch 2019-02-20 23:01:31 -06:00 committed by GitHub
commit fb4fc904fb
41 changed files with 45 additions and 94 deletions

View file

@ -621,8 +621,6 @@ void AnimationComponent::advanceThreads(F32 dt)
Thread& st = mAnimationThreads[i]; Thread& st = mAnimationThreads[i];
if (st.thread && st.sequence != -1) if (st.thread && st.sequence != -1)
{ {
bool cyclic = getShape()->sequences[st.sequence].isCyclic();
if (!getShape()->sequences[st.sequence].isCyclic() && if (!getShape()->sequences[st.sequence].isCyclic() &&
!st.atEnd && !st.atEnd &&
((st.timescale > 0.f) ? mOwnerShapeInstance->getPos(st.thread) >= 1.0 : mOwnerShapeInstance->getPos(st.thread) <= 0)) ((st.timescale > 0.f) ? mOwnerShapeInstance->getPos(st.thread) >= 1.0 : mOwnerShapeInstance->getPos(st.thread) <= 0))

View file

@ -237,8 +237,6 @@ bool CameraComponent::getCameraTransform(F32* pos,MatrixF* mat)
{ {
// Returns camera to world space transform // Returns camera to world space transform
// Handles first person / third person camera position // Handles first person / third person camera position
bool isServer = isServerObject();
if (mTargetNodeIdx == -1) if (mTargetNodeIdx == -1)
{ {
if (mUseParentTransform) if (mUseParentTransform)
@ -479,7 +477,6 @@ void CameraComponent::setRotation(RotationF newRot)
Frustum CameraComponent::getFrustum() Frustum CameraComponent::getFrustum()
{ {
Frustum visFrustum; Frustum visFrustum;
F32 left, right, top, bottom;
F32 aspectRatio = mClientScreen.x / mClientScreen.y; F32 aspectRatio = mClientScreen.x / mClientScreen.y;
visFrustum.set(false, mDegToRad(mCameraFov), aspectRatio, 0.1f, 1000, mOwner->getTransform()); visFrustum.set(false, mDegToRad(mCameraFov), aspectRatio, 0.1f, 1000, mOwner->getTransform());

View file

@ -538,7 +538,6 @@ PhysicsCollision* CollisionComponent::buildColShapes()
for (S32 o = start; o < end; o++) for (S32 o = start; o < end; o++)
{ {
const TSShape::Object &object = shape->objects[o]; const TSShape::Object &object = shape->objects[o];
const String &meshName = shape->names[object.nameIndex];
if (object.numMeshes <= detail.objectDetailNum) if (object.numMeshes <= detail.objectDetailNum)
continue; continue;

View file

@ -152,7 +152,6 @@ void StateMachine::readConditions(StateTransition &currentTransition)
//get our first state //get our first state
StateTransition::Condition firstCondition; StateTransition::Condition firstCondition;
StateField firstField; StateField firstField;
bool fieldRead = false;
readFieldName(&firstField, reader); readFieldName(&firstField, reader);
firstCondition.field = firstField; firstCondition.field = firstField;

View file

@ -239,8 +239,6 @@ bool TriggerComponent::testObject(SceneObject* enter)
myList.setObject(mOwner); myList.setObject(mOwner);
myCI->buildPolyList(PLC_Collision, &myList, enterBox, sphere); myCI->buildPolyList(PLC_Collision, &myList, enterBox, sphere);
bool test = true;
} }
} }
} }

View file

@ -330,9 +330,6 @@ void PlayerControllerComponent::updateMove()
} }
// Update current orientation // Update current orientation
bool doStandardMove = true;
GameConnection* con = mOwner->getControllingClient();
MatrixF zRot; MatrixF zRot;
zRot.set(EulerF(0.0f, 0.0f, mOwner->getRotation().asEulerF().z)); zRot.set(EulerF(0.0f, 0.0f, mOwner->getRotation().asEulerF().z));
@ -355,7 +352,6 @@ void PlayerControllerComponent::updateMove()
mContactInfo.jump = false; mContactInfo.jump = false;
mContactInfo.run = false; mContactInfo.run = false;
bool jumpSurface = false, runSurface = false;
if (!mOwner->isMounted()) if (!mOwner->isMounted())
findContact(&mContactInfo.run, &mContactInfo.jump, &mContactInfo.contactNormal); findContact(&mContactInfo.run, &mContactInfo.jump, &mContactInfo.contactNormal);
if (mContactInfo.jump) if (mContactInfo.jump)
@ -577,7 +573,6 @@ void PlayerControllerComponent::updatePos(const F32 travelTime)
newPos = mPhysicsRep->move(mVelocity * travelTime, collisionList); newPos = mPhysicsRep->move(mVelocity * travelTime, collisionList);
bool haveCollisions = false; bool haveCollisions = false;
bool wasFalling = mFalling;
if (collisionList.getCount() > 0) if (collisionList.getCount() > 0)
{ {
mFalling = false; mFalling = false;

View file

@ -719,8 +719,6 @@ bool ConvexShape::buildExportPolyList(ColladaUtils::ExportData* exportData, cons
//Convex shapes only have the one 'level', so we'll just rely on the export post-process to back-fill //Convex shapes only have the one 'level', so we'll just rely on the export post-process to back-fill
if (isServerObject() && getClientObject()) if (isServerObject() && getClientObject())
{ {
ConvexShape* clientShape = dynamic_cast<ConvexShape*>(getClientObject());
exportData->meshData.increment(); exportData->meshData.increment();
//Prep a meshData for this shape in particular //Prep a meshData for this shape in particular

View file

@ -306,8 +306,6 @@ void Entity::onPostAdd()
bool Entity::_setGameObject(void *object, const char *index, const char *data) bool Entity::_setGameObject(void *object, const char *index, const char *data)
{ {
Entity *e = static_cast<Entity*>(object);
// Sanity! // Sanity!
AssertFatal(data != NULL, "Cannot use a NULL asset Id."); AssertFatal(data != NULL, "Cannot use a NULL asset Id.");
@ -513,8 +511,6 @@ U32 Entity::packUpdate(NetConnection *con, U32 mask, BitStream *stream)
for (U32 i = 0; i < mNetworkedComponents.size(); i++) for (U32 i = 0; i < mNetworkedComponents.size(); i++)
{ {
NetworkedComponent::UpdateState state = mNetworkedComponents[i].updateState;
if (mNetworkedComponents[i].updateState == NetworkedComponent::Adding) if (mNetworkedComponents[i].updateState == NetworkedComponent::Adding)
{ {
const char* className = mComponents[mNetworkedComponents[i].componentIndex]->getClassName(); const char* className = mComponents[mNetworkedComponents[i].componentIndex]->getClassName();
@ -1381,7 +1377,6 @@ bool Entity::removeComponent(Component *comp, bool deleteComponent)
//to re-add them. Need to implement a clean clear function that will clear the local list, and only delete unused behaviors during an update. //to re-add them. Need to implement a clean clear function that will clear the local list, and only delete unused behaviors during an update.
void Entity::clearComponents(bool deleteComponents) void Entity::clearComponents(bool deleteComponents)
{ {
bool srv = isServerObject();
if (!deleteComponents) if (!deleteComponents)
{ {
while (mComponents.size() > 0) while (mComponents.size() > 0)
@ -1399,8 +1394,6 @@ void Entity::clearComponents(bool deleteComponents)
{ {
comp->onComponentRemove(); //in case the behavior needs to do cleanup on the owner comp->onComponentRemove(); //in case the behavior needs to do cleanup on the owner
bool removed = mComponents.remove(comp);
//we only need to delete them on the server side. they'll be cleaned up on the client side //we only need to delete them on the server side. they'll be cleaned up on the client side
//via the ghosting system for us //via the ghosting system for us
if (isServerObject()) if (isServerObject())
@ -1663,7 +1656,6 @@ void Entity::notifyComponents(String signalFunction, String argA, String argB, S
void Entity::setComponentsDirty() void Entity::setComponentsDirty()
{ {
bool tmp = true;
/*if (mToLoadComponents.empty()) /*if (mToLoadComponents.empty())
mStartComponentUpdate = true; mStartComponentUpdate = true;
@ -1694,7 +1686,6 @@ void Entity::setComponentsDirty()
void Entity::setComponentDirty(Component *comp, bool forceUpdate) void Entity::setComponentDirty(Component *comp, bool forceUpdate)
{ {
bool found = false;
for (U32 i = 0; i < mComponents.size(); i++) for (U32 i = 0; i < mComponents.size(); i++)
{ {
if (mComponents[i]->getId() == comp->getId()) if (mComponents[i]->getId() == comp->getId())

View file

@ -309,7 +309,6 @@ Vector<T*> Entity::getComponents()
Vector<T*> foundObjects; Vector<T*> foundObjects;
T *curObj; T *curObj;
Component* comp;
// Loop through our child objects. // Loop through our child objects.
for (U32 i = 0; i < mComponents.size(); i++) for (U32 i = 0; i < mComponents.size(); i++)

View file

@ -490,7 +490,7 @@ void ParticleEmitterData::unpackData(BitStream* stream)
#if defined(AFX_CAP_PARTICLE_POOLS) #if defined(AFX_CAP_PARTICLE_POOLS)
if (stream->readFlag()) if (stream->readFlag())
{ {
pool_datablock = (afxParticlePoolData*)stream->readRangedU32(DataBlockObjectIdFirst, DataBlockObjectIdLast); pool_datablock = (afxParticlePoolData*)(uintptr_t)stream->readRangedU32(DataBlockObjectIdFirst, DataBlockObjectIdLast);
stream->read(&pool_index); stream->read(&pool_index);
pool_depth_fade = stream->readFlag(); pool_depth_fade = stream->readFlag();
pool_radial_fade = stream->readFlag(); pool_radial_fade = stream->readFlag();

View file

@ -553,7 +553,6 @@ void renderFrame(GFXTextureTargetRef* target, MatrixF transform, Frustum frustum
GFX->setStateBlock(mDefaultGuiSB); GFX->setStateBlock(mDefaultGuiSB);
GFXTargetRef origTarget = GFX->getActiveRenderTarget(); GFXTargetRef origTarget = GFX->getActiveRenderTarget();
U32 origStyle = GFX->getCurrentRenderStyle();
// Clear the zBuffer so GUI doesn't hose object rendering accidentally // Clear the zBuffer so GUI doesn't hose object rendering accidentally
GFX->clear(GFXClearZBuffer, ColorI(20, 20, 20), 1.0f, 0); GFX->clear(GFXClearZBuffer, ColorI(20, 20, 20), 1.0f, 0);

View file

@ -3259,7 +3259,7 @@ void ShapeBase::unpackUpdate(NetConnection *con, BitStream *stream)
st.play = stream->readFlag(); st.play = stream->readFlag();
if ( st.play ) if ( st.play )
{ {
st.profile = (SFXTrack*) stream->readRangedU32( DataBlockObjectIdFirst, st.profile = (SFXTrack*)(uintptr_t)stream->readRangedU32( DataBlockObjectIdFirst,
DataBlockObjectIdLast ); DataBlockObjectIdLast );
} }

View file

@ -1202,7 +1202,7 @@ void ShapeBaseImageData::unpackData(BitStream* stream)
} }
projectile = (stream->readFlag() ? projectile = (stream->readFlag() ?
(ProjectileData*)stream->readRangedU32(DataBlockObjectIdFirst, (ProjectileData*)(uintptr_t)stream->readRangedU32(DataBlockObjectIdFirst,
DataBlockObjectIdLast) : 0); DataBlockObjectIdLast) : 0);
cloakable = stream->readFlag(); cloakable = stream->readFlag();
@ -1340,7 +1340,7 @@ void ShapeBaseImageData::unpackData(BitStream* stream)
if (stream->readFlag()) if (stream->readFlag())
{ {
s.emitter = (ParticleEmitterData*) stream->readRangedU32(DataBlockObjectIdFirst, s.emitter = (ParticleEmitterData*)(uintptr_t)stream->readRangedU32(DataBlockObjectIdFirst,
DataBlockObjectIdLast); DataBlockObjectIdLast);
stream->read(&s.emitterTime); stream->read(&s.emitterTime);

View file

@ -21,11 +21,9 @@ void MeshRenderSystem::render(SceneManager *sceneManager, SceneRenderState* stat
for (U32 i = 0; i < count; i++) for (U32 i = 0; i < count; i++)
{ {
//Server side items exist for data, but we don't actually render them //Server side items exist for data, but we don't actually render them
bool isClient = MeshRenderSystemInterface::all[i]->mIsClient;
if (!MeshRenderSystemInterface::all[i]->mIsClient) if (!MeshRenderSystemInterface::all[i]->mIsClient)
continue; continue;
bool isStatic = MeshRenderSystemInterface::all[i]->mStatic;
if (MeshRenderSystemInterface::all[i]->mStatic) if (MeshRenderSystemInterface::all[i]->mStatic)
continue; continue;

View file

@ -1131,7 +1131,6 @@ bool TSStatic::buildExportPolyList(ColladaUtils::ExportData* exportData, const B
if (isServerObject() && getClientObject()) if (isServerObject() && getClientObject())
{ {
TSStatic* clientShape = dynamic_cast<TSStatic*>(getClientObject()); TSStatic* clientShape = dynamic_cast<TSStatic*>(getClientObject());
U32 numDetails = clientShape->mShapeInstance->getNumDetails() - 1;
exportData->meshData.increment(); exportData->meshData.increment();

View file

@ -282,14 +282,14 @@ void FlyingVehicleData::unpackData(BitStream* stream)
for (S32 i = 0; i < MaxSounds; i++) { for (S32 i = 0; i < MaxSounds; i++) {
sound[i] = NULL; sound[i] = NULL;
if (stream->readFlag()) if (stream->readFlag())
sound[i] = (SFXProfile*)stream->readRangedU32(DataBlockObjectIdFirst, sound[i] = (SFXProfile*)(uintptr_t)stream->readRangedU32(DataBlockObjectIdFirst,
DataBlockObjectIdLast); DataBlockObjectIdLast);
} }
for (S32 j = 0; j < MaxJetEmitters; j++) { for (S32 j = 0; j < MaxJetEmitters; j++) {
jetEmitter[j] = NULL; jetEmitter[j] = NULL;
if (stream->readFlag()) if (stream->readFlag())
jetEmitter[j] = (ParticleEmitterData*)stream->readRangedU32(DataBlockObjectIdFirst, jetEmitter[j] = (ParticleEmitterData*)(uintptr_t)stream->readRangedU32(DataBlockObjectIdFirst,
DataBlockObjectIdLast); DataBlockObjectIdLast);
} }

View file

@ -411,13 +411,13 @@ void HoverVehicleData::unpackData(BitStream* stream)
for (S32 i = 0; i < MaxSounds; i++) for (S32 i = 0; i < MaxSounds; i++)
sound[i] = stream->readFlag()? sound[i] = stream->readFlag()?
(SFXProfile*) stream->readRangedU32(DataBlockObjectIdFirst, (SFXProfile*)(uintptr_t)stream->readRangedU32(DataBlockObjectIdFirst,
DataBlockObjectIdLast): 0; DataBlockObjectIdLast): 0;
for (S32 j = 0; j < MaxJetEmitters; j++) { for (S32 j = 0; j < MaxJetEmitters; j++) {
jetEmitter[j] = NULL; jetEmitter[j] = NULL;
if (stream->readFlag()) if (stream->readFlag())
jetEmitter[j] = (ParticleEmitterData*)stream->readRangedU32(DataBlockObjectIdFirst, jetEmitter[j] = (ParticleEmitterData*)(uintptr_t)stream->readRangedU32(DataBlockObjectIdFirst,
DataBlockObjectIdLast); DataBlockObjectIdLast);
} }

View file

@ -374,7 +374,7 @@ void VehicleData::unpackData(BitStream* stream)
for (i = 0; i < Body::MaxSounds; i++) { for (i = 0; i < Body::MaxSounds; i++) {
body.sound[i] = NULL; body.sound[i] = NULL;
if (stream->readFlag()) if (stream->readFlag())
body.sound[i] = (SFXProfile*)stream->readRangedU32(DataBlockObjectIdFirst, body.sound[i] = (SFXProfile*)(uintptr_t)stream->readRangedU32(DataBlockObjectIdFirst,
DataBlockObjectIdLast); DataBlockObjectIdLast);
} }

View file

@ -494,7 +494,7 @@ void WheeledVehicleData::unpackData(BitStream* stream)
Parent::unpackData(stream); Parent::unpackData(stream);
tireEmitter = stream->readFlag()? tireEmitter = stream->readFlag()?
(ParticleEmitterData*) stream->readRangedU32(DataBlockObjectIdFirst, (ParticleEmitterData*)(uintptr_t)stream->readRangedU32(DataBlockObjectIdFirst,
DataBlockObjectIdLast): 0; DataBlockObjectIdLast): 0;
for (S32 i = 0; i < MaxSounds; i++) for (S32 i = 0; i < MaxSounds; i++)

View file

@ -133,7 +133,7 @@ void afxEffectGroupData::unpack_fx(BitStream* stream, afxEffectList& fx)
fx.clear(); fx.clear();
S32 n_fx = stream->readInt(EFFECTS_PER_PHRASE_BITS); S32 n_fx = stream->readInt(EFFECTS_PER_PHRASE_BITS);
for (int i = 0; i < n_fx; i++) 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) #define myOffset(field) Offset(field, afxEffectGroupData)

View file

@ -608,7 +608,7 @@ void afxEffectWrapperData::unpack_mods(BitStream* stream, afxXM_BaseData* mods[]
{ {
S32 n_mods = stream->readInt(6); S32 n_mods = stream->readInt(6);
for (int i = 0; i < n_mods; i++) 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) bool afxEffectWrapperData::preload(bool server, String &errorStr)

View file

@ -147,7 +147,7 @@ void afxEffectronData::unpack_fx(BitStream* stream, afxEffectList& fx)
fx.clear(); fx.clear();
S32 n_fx = stream->readInt(EFFECTS_PER_PHRASE_BITS); S32 n_fx = stream->readInt(EFFECTS_PER_PHRASE_BITS);
for (int i = 0; i < n_fx; i++) 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) void afxEffectronData::packData(BitStream* stream)

View file

@ -304,7 +304,7 @@ void afxMagicSpellData::unpack_fx(BitStream* stream, afxEffectList& fx)
fx.clear(); fx.clear();
S32 n_fx = stream->readInt(EFFECTS_PER_PHRASE_BITS); S32 n_fx = stream->readInt(EFFECTS_PER_PHRASE_BITS);
for (int i = 0; i < n_fx; i++) 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) void afxMagicSpellData::packData(BitStream* stream)
@ -356,7 +356,7 @@ void afxMagicSpellData::unpackData(BitStream* stream)
mDo_move_interrupts = stream->readFlag(); mDo_move_interrupts = stream->readFlag();
stream->read(&mMove_interrupt_speed); 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(&mLaunch_on_server_signal);
stream->read(&mPrimary_target_types); stream->read(&mPrimary_target_types);

View file

@ -214,7 +214,7 @@ void afxSelectronData::unpack_fx(BitStream* stream, afxEffectList& fx)
fx.clear(); fx.clear();
S32 n_fx = stream->readInt(EFFECTS_PER_PHRASE_BITS); S32 n_fx = stream->readInt(EFFECTS_PER_PHRASE_BITS);
for (int i = 0; i < n_fx; i++) 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) void afxSelectronData::packData(BitStream* stream)

View file

@ -128,7 +128,7 @@ void afxSpellBookData::unpackData(BitStream* stream)
do_id_convert = true; do_id_convert = true;
for (S32 i = 0; i < pages_per_book*spells_per_page; i++) 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),, DefineEngineMethod(afxSpellBookData, getPageSlotIndex, S32, (Point2I bookSlot),,

View file

@ -195,8 +195,8 @@ void afxT3DLightBaseData::unpackData(BitStream* stream)
stream->read( &mAnimState.animationPhase ); stream->read( &mAnimState.animationPhase );
stream->read( &mFlareScale ); stream->read( &mFlareScale );
mAnimationData = (LightAnimData*) readDatablockID(stream); mAnimationData = (LightAnimData*)(uintptr_t)readDatablockID(stream);
mFlareData = (LightFlareData*) readDatablockID(stream); mFlareData = (LightFlareData*)(uintptr_t)readDatablockID(stream);
do_id_convert = true; do_id_convert = true;
} }

View file

@ -215,7 +215,7 @@ void afxPhraseEffectData::unpack_fx(BitStream* stream, afxEffectList& fx)
fx.clear(); fx.clear();
S32 n_fx = stream->readInt(EFFECTS_PER_PHRASE_BITS); S32 n_fx = stream->readInt(EFFECTS_PER_PHRASE_BITS);
for (int i = 0; i < n_fx; i++) 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) void afxPhraseEffectData::packData(BitStream* stream)

View file

@ -1611,9 +1611,7 @@ static void handleExtendedMasterServerListResponse(BitStream* stream, U32 key, U
{ {
U16 packetIndex, packetTotal; U16 packetIndex, packetTotal;
U32 i; U32 i;
U16 serverCount, port; U16 serverCount;
U8 netNum[16];
char addressBuffer[256];
NetAddress addr; NetAddress addr;
stream->read(&packetIndex); stream->read(&packetIndex);

View file

@ -55,7 +55,7 @@ void ForestCreateUndoAction::addItem( ForestItemData *data,
// We store the datablock ID rather than the actual pointer // We store the datablock ID rather than the actual pointer
// since the pointer could go bad. // since the pointer could go bad.
SimObjectId dataId = item.getData()->getId(); SimObjectId dataId = item.getData()->getId();
mItems.last().setData( (ForestItemData*)dataId ); mItems.last().setData( (ForestItemData*)(uintptr_t)dataId );
} }
void ForestCreateUndoAction::redo() void ForestCreateUndoAction::redo()
@ -110,7 +110,7 @@ void ForestDeleteUndoAction::removeItem( const ForestItem &item )
SimObjectId dataId = item.getData()->getId(); SimObjectId dataId = item.getData()->getId();
mItems.push_back( item ); mItems.push_back( item );
mItems.last().setData( (ForestItemData*)dataId ); mItems.last().setData( (ForestItemData*)(uintptr_t)dataId );
mData->removeItem( item.getKey(), item.getPosition() ); 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 // We store the datablock ID rather than the actual pointer
// since the pointer could go bad. // since the pointer could go bad.
SimObjectId dataId = item.getData()->getId(); SimObjectId dataId = item.getData()->getId();
mItems.last().setData( (ForestItemData*)dataId ); mItems.last().setData( (ForestItemData*)(uintptr_t)dataId );
} }
void ForestUpdateAction::_swapState() void ForestUpdateAction::_swapState()
@ -215,7 +215,7 @@ void ForestUpdateAction::_swapState()
item.getScale() ); item.getScale() );
// Save the state before this swap for the next swap. // 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 ); mItems.push_back( newItem );
} }

View file

@ -77,11 +77,11 @@ _STRING_VALUE_LOOKUP_FXN(GFXStringBlendOp);
#define INIT_LOOKUPTABLE( tablearray, enumprefix, type ) \ #define INIT_LOOKUPTABLE( tablearray, enumprefix, type ) \
for( S32 i = enumprefix##_FIRST; i < enumprefix##_COUNT; i++ ) \ 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 ) \ #define INIT_LOOKUPTABLE_EX( tablearray, enumprefix, type, typeTable ) \
for( S32 i = enumprefix##_FIRST; i < enumprefix##_COUNT; i++ ) \ 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;\ typeTable[i] = &defaultStringValueLookup;\
} }

View file

@ -131,7 +131,7 @@ void GFXGLPrimitiveBuffer::finish()
GLvoid* GFXGLPrimitiveBuffer::getBuffer() GLvoid* GFXGLPrimitiveBuffer::getBuffer()
{ {
// NULL specifies no offset into the hardware buffer // NULL specifies no offset into the hardware buffer
return (GLvoid*)mBufferOffset; return (GLvoid*)(uintptr_t)mBufferOffset;
} }
void GFXGLPrimitiveBuffer::zombify() void GFXGLPrimitiveBuffer::zombify()

View file

@ -130,7 +130,7 @@ void GFXGLVertexDecl::_initVerticesFormat(U32 stream)
glElement.normalized = false; glElement.normalized = false;
glElement.type = GL_FLOAT; glElement.type = GL_FLOAT;
glElement.stride = vertexSize; glElement.stride = vertexSize;
glElement.pointerFirst = (void*)buffer; glElement.pointerFirst = (void*)(uintptr_t)buffer;
buffer += element.getSizeInBytes(); buffer += element.getSizeInBytes();
} }
@ -141,7 +141,7 @@ void GFXGLVertexDecl::_initVerticesFormat(U32 stream)
glElement.normalized = false; glElement.normalized = false;
glElement.type = GL_FLOAT; glElement.type = GL_FLOAT;
glElement.stride = vertexSize; glElement.stride = vertexSize;
glElement.pointerFirst = (void*)buffer; glElement.pointerFirst = (void*)(uintptr_t)buffer;
buffer += element.getSizeInBytes(); buffer += element.getSizeInBytes();
} }
@ -152,7 +152,7 @@ void GFXGLVertexDecl::_initVerticesFormat(U32 stream)
glElement.normalized = false; glElement.normalized = false;
glElement.type = GL_FLOAT; glElement.type = GL_FLOAT;
glElement.stride = vertexSize; glElement.stride = vertexSize;
glElement.pointerFirst = (void*)buffer; glElement.pointerFirst = (void*)(uintptr_t)buffer;
buffer += element.getSizeInBytes(); buffer += element.getSizeInBytes();
} }
@ -163,7 +163,7 @@ void GFXGLVertexDecl::_initVerticesFormat(U32 stream)
glElement.normalized = false; glElement.normalized = false;
glElement.type = GL_FLOAT; glElement.type = GL_FLOAT;
glElement.stride = vertexSize; glElement.stride = vertexSize;
glElement.pointerFirst = (void*)buffer; glElement.pointerFirst = (void*)(uintptr_t)buffer;
buffer += element.getSizeInBytes(); buffer += element.getSizeInBytes();
} }
@ -174,7 +174,7 @@ void GFXGLVertexDecl::_initVerticesFormat(U32 stream)
glElement.normalized = false; glElement.normalized = false;
glElement.type = GL_FLOAT; glElement.type = GL_FLOAT;
glElement.stride = vertexSize; glElement.stride = vertexSize;
glElement.pointerFirst = (void*)buffer; glElement.pointerFirst = (void*)(uintptr_t)buffer;
buffer += element.getSizeInBytes(); buffer += element.getSizeInBytes();
} }
@ -185,7 +185,7 @@ void GFXGLVertexDecl::_initVerticesFormat(U32 stream)
glElement.normalized = true; glElement.normalized = true;
glElement.type = GL_UNSIGNED_BYTE; glElement.type = GL_UNSIGNED_BYTE;
glElement.stride = vertexSize; glElement.stride = vertexSize;
glElement.pointerFirst = (void*)buffer; glElement.pointerFirst = (void*)(uintptr_t)buffer;
buffer += element.getSizeInBytes(); buffer += element.getSizeInBytes();
} }
@ -196,7 +196,7 @@ void GFXGLVertexDecl::_initVerticesFormat(U32 stream)
glElement.normalized = false; glElement.normalized = false;
glElement.type = GL_FLOAT; glElement.type = GL_FLOAT;
glElement.stride = vertexSize; glElement.stride = vertexSize;
glElement.pointerFirst = (void*)buffer; glElement.pointerFirst = (void*)(uintptr_t)buffer;
buffer += element.getSizeInBytes(); buffer += element.getSizeInBytes();
} }
@ -207,7 +207,7 @@ void GFXGLVertexDecl::_initVerticesFormat(U32 stream)
glElement.normalized = false; glElement.normalized = false;
glElement.type = GL_UNSIGNED_BYTE; glElement.type = GL_UNSIGNED_BYTE;
glElement.stride = vertexSize; glElement.stride = vertexSize;
glElement.pointerFirst = (void*)buffer; glElement.pointerFirst = (void*)(uintptr_t)buffer;
buffer += element.getSizeInBytes(); buffer += element.getSizeInBytes();
} }
@ -221,7 +221,7 @@ void GFXGLVertexDecl::_initVerticesFormat(U32 stream)
glElement.normalized = false; glElement.normalized = false;
glElement.type = GL_FLOAT; glElement.type = GL_FLOAT;
glElement.stride = vertexSize; glElement.stride = vertexSize;
glElement.pointerFirst = (void*)buffer; glElement.pointerFirst = (void*)(uintptr_t)buffer;
buffer += element.getSizeInBytes(); buffer += element.getSizeInBytes();
++texCoordIndex; ++texCoordIndex;

View file

@ -89,9 +89,6 @@ bool GuiConsole::onWake()
S32 GuiConsole::getMaxWidth(S32 startIndex, S32 endIndex) S32 GuiConsole::getMaxWidth(S32 startIndex, S32 endIndex)
{ {
//sanity check //sanity check
U32 size;
ConsoleLogEntry *log;
if (startIndex < 0 || (U32)endIndex >= mFilteredLog.size() || startIndex > endIndex) if (startIndex < 0 || (U32)endIndex >= mFilteredLog.size() || startIndex > endIndex)
return 0; return 0;
@ -190,9 +187,6 @@ void GuiConsole::onPreRender()
void GuiConsole::onRenderCell(Point2I offset, Point2I cell, bool /*selected*/, bool /*mouseOver*/) void GuiConsole::onRenderCell(Point2I offset, Point2I cell, bool /*selected*/, bool /*mouseOver*/)
{ {
U32 size;
ConsoleLogEntry *log;
ConsoleLogEntry &entry = mFilteredLog[cell.y]; ConsoleLogEntry &entry = mFilteredLog[cell.y];
switch (entry.mLevel) switch (entry.mLevel)
{ {
@ -210,9 +204,6 @@ void GuiConsole::onCellSelected( Point2I cell )
{ {
Parent::onCellSelected( cell ); Parent::onCellSelected( cell );
U32 size;
ConsoleLogEntry* log;
ConsoleLogEntry& entry = mFilteredLog[cell.y]; ConsoleLogEntry& entry = mFilteredLog[cell.y];
onMessageSelected_callback( entry.mLevel, entry.mString ); onMessageSelected_callback( entry.mLevel, entry.mString );
} }

View file

@ -631,7 +631,7 @@ DefineEngineMethod( GuiListBoxCtrl, addItem, S32, (const char* newItem, const ch
else if(elementCount == 1) else if(elementCount == 1)
{ {
U32 objId = dAtoi( color ); U32 objId = dAtoi( color );
return object->addItem( newItem, (void*)objId ); return object->addItem( newItem, (void*)(uintptr_t)objId );
} }
else else
{ {
@ -1523,7 +1523,7 @@ void GuiListBoxCtrl::_mirror()
if ( !found ) if ( !found )
{ {
addItem( _makeMirrorItemName( curObj ), (void*)curId ); addItem( _makeMirrorItemName( curObj ), (void*)(uintptr_t)curId );
} }
} }
} }

View file

@ -133,9 +133,6 @@ bool GuiInspectorMountingGroup::inspectGroup()
clearFields(); clearFields();
bool bNewItems = false; bool bNewItems = false;
bool bMakingArray = false;
GuiStackControl *pArrayStack = NULL;
GuiRolloutCtrl *pArrayRollout = NULL;
bool bGrabItems = false; bool bGrabItems = false;
AbstractClassRep* commonAncestorClass = findCommonAncestorClass(); AbstractClassRep* commonAncestorClass = findCommonAncestorClass();
@ -240,7 +237,6 @@ void GuiInspectorMountingGroup::updateAllFields()
void GuiInspectorMountingGroup::onMouseMove(const GuiEvent &event) void GuiInspectorMountingGroup::onMouseMove(const GuiEvent &event)
{ {
//mParent->mOverDivider = false; //mParent->mOverDivider = false;
bool test = false;
} }
DefineEngineMethod(GuiInspectorMountingGroup, inspectGroup, bool, (),, "Refreshes the dynamic fields in the inspector.") DefineEngineMethod(GuiInspectorMountingGroup, inspectGroup, bool, (),, "Refreshes the dynamic fields in the inspector.")

View file

@ -3877,8 +3877,6 @@ void WorldEditor::makeSelectionAMesh(const char *filename)
fabMat.inverse(); fabMat.inverse();
MatrixF objMat; MatrixF objMat;
SimObject *obj = NULL;
SceneObject *sObj = NULL;
Vector< SceneObject* > objectList; Vector< SceneObject* > objectList;

View file

@ -44,7 +44,7 @@
#define M_CONST_E_F 2.7182818284590452353602874f #define M_CONST_E_F 2.7182818284590452353602874f
#define POINT_EPSILON (1e-4) ///< Epsilon for point types. #define POINT_EPSILON (0.0001f) ///< Epsilon for point types.
/// Result of an overlap test. /// Result of an overlap test.

View file

@ -216,7 +216,7 @@ void Frustum::setNearFarDist( F32 nearDist, F32 farDist )
// Recalculate the frustum. // Recalculate the frustum.
MatrixF xfm( mTransform ); MatrixF xfm( mTransform );
const F32 CENTER_EPSILON = 0.001; const F32 CENTER_EPSILON = 0.001f;
F32 centerX = mNearLeft + (mNearRight - mNearLeft) * 0.5; F32 centerX = mNearLeft + (mNearRight - mNearLeft) * 0.5;
F32 centerY = mNearBottom + (mNearTop - mNearBottom) * 0.5; F32 centerY = mNearBottom + (mNearTop - mNearBottom) * 0.5;
if ((centerX > CENTER_EPSILON || centerX < -CENTER_EPSILON) || (centerY > CENTER_EPSILON || centerY < -CENTER_EPSILON) ) if ((centerX > CENTER_EPSILON || centerX < -CENTER_EPSILON) || (centerY > CENTER_EPSILON || centerY < -CENTER_EPSILON) )

View file

@ -230,7 +230,6 @@ namespace PlatformNetState
// which are required for LAN queries (PC->Xbox connectivity). The wire protocol still // which are required for LAN queries (PC->Xbox connectivity). The wire protocol still
// uses the VDP packet structure, though. // uses the VDP packet structure, though.
S32 protocol = IPPROTO_UDP; S32 protocol = IPPROTO_UDP;
bool useVDP = false;
#ifdef TORQUE_DISABLE_PC_CONNECTIVITY #ifdef TORQUE_DISABLE_PC_CONNECTIVITY
// Xbox uses a VDP (voice/data protocol) socket for networking // Xbox uses a VDP (voice/data protocol) socket for networking
protocol = IPPROTO_VDP; protocol = IPPROTO_VDP;
@ -1956,7 +1955,6 @@ void Net::enableMulticast()
if (error == NoError) if (error == NoError)
{ {
NetAddress listenAddress;
char listenAddressStr[256]; char listenAddressStr[256];
Net::addressToString(&multicastAddress, listenAddressStr); Net::addressToString(&multicastAddress, listenAddressStr);
Con::printf("Multicast initialized on %s", listenAddressStr); Con::printf("Multicast initialized on %s", listenAddressStr);

View file

@ -1392,7 +1392,7 @@ void SceneContainer::getBinRange( const F32 min, const F32 max, U32& minBin, U32
// This is truly lame, but it can happen. There must be a better way to // This is truly lame, but it can happen. There must be a better way to
// deal with this. // deal with this.
if (minCoord == SceneContainer::csmTotalBinSize) if (minCoord == SceneContainer::csmTotalBinSize)
minCoord = SceneContainer::csmTotalBinSize - 0.01; minCoord = SceneContainer::csmTotalBinSize - 0.01f;
} }
AssertFatal(minCoord >= 0.0 && minCoord < SceneContainer::csmTotalBinSize, "Bad minCoord"); AssertFatal(minCoord >= 0.0 && minCoord < SceneContainer::csmTotalBinSize, "Bad minCoord");
@ -1415,7 +1415,7 @@ void SceneContainer::getBinRange( const F32 min, const F32 max, U32& minBin, U32
// This is truly lame, but it can happen. There must be a better way to // This is truly lame, but it can happen. There must be a better way to
// deal with this. // deal with this.
if (minCoord == SceneContainer::csmTotalBinSize) if (minCoord == SceneContainer::csmTotalBinSize)
minCoord = SceneContainer::csmTotalBinSize - 0.01; minCoord = SceneContainer::csmTotalBinSize - 0.01f;
} }
AssertFatal(minCoord >= 0.0 && minCoord < SceneContainer::csmTotalBinSize, "Bad minCoord"); AssertFatal(minCoord >= 0.0 && minCoord < SceneContainer::csmTotalBinSize, "Bad minCoord");
@ -1426,7 +1426,7 @@ void SceneContainer::getBinRange( const F32 min, const F32 max, U32& minBin, U32
// This is truly lame, but it can happen. There must be a better way to // This is truly lame, but it can happen. There must be a better way to
// deal with this. // deal with this.
if (maxCoord == SceneContainer::csmTotalBinSize) if (maxCoord == SceneContainer::csmTotalBinSize)
maxCoord = SceneContainer::csmTotalBinSize - 0.01; maxCoord = SceneContainer::csmTotalBinSize - 0.01f;
} }
AssertFatal(maxCoord >= 0.0 && maxCoord < SceneContainer::csmTotalBinSize, "Bad maxCoord"); AssertFatal(maxCoord >= 0.0 && maxCoord < SceneContainer::csmTotalBinSize, "Bad maxCoord");

View file

@ -412,7 +412,7 @@ void TSShapeLoader::generateObjects()
AppMesh* mesh = subshape->objMeshes[iMesh]; AppMesh* mesh = subshape->objMeshes[iMesh];
mesh->detailSize = 2; mesh->detailSize = 2;
String name = String::GetTrailingNumber( mesh->getName(), mesh->detailSize ); 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 ); meshNames.push_back( name );
// Fix up any collision details that don't have a negative detail level. // Fix up any collision details that don't have a negative detail level.