Skip to content

Commit c131084

Browse files
authored
Merge pull request #2309 from suncaller/warning-purge
Remove redundant variables and clean up C4312 and C4305 warnings
2 parents 1740bc0 + 5e8e7e7 commit c131084

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+45
-94
lines changed

Engine/source/T3D/components/animation/animationComponent.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -621,8 +621,6 @@ void AnimationComponent::advanceThreads(F32 dt)
621621
Thread& st = mAnimationThreads[i];
622622
if (st.thread && st.sequence != -1)
623623
{
624-
bool cyclic = getShape()->sequences[st.sequence].isCyclic();
625-
626624
if (!getShape()->sequences[st.sequence].isCyclic() &&
627625
!st.atEnd &&
628626
((st.timescale > 0.f) ? mOwnerShapeInstance->getPos(st.thread) >= 1.0 : mOwnerShapeInstance->getPos(st.thread) <= 0))

Engine/source/T3D/components/camera/cameraComponent.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -237,8 +237,6 @@ bool CameraComponent::getCameraTransform(F32* pos,MatrixF* mat)
237237
{
238238
// Returns camera to world space transform
239239
// Handles first person / third person camera position
240-
bool isServer = isServerObject();
241-
242240
if (mTargetNodeIdx == -1)
243241
{
244242
if (mUseParentTransform)
@@ -479,7 +477,6 @@ void CameraComponent::setRotation(RotationF newRot)
479477
Frustum CameraComponent::getFrustum()
480478
{
481479
Frustum visFrustum;
482-
F32 left, right, top, bottom;
483480
F32 aspectRatio = mClientScreen.x / mClientScreen.y;
484481

485482
visFrustum.set(false, mDegToRad(mCameraFov), aspectRatio, 0.1f, 1000, mOwner->getTransform());

Engine/source/T3D/components/collision/collisionComponent.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -538,7 +538,6 @@ PhysicsCollision* CollisionComponent::buildColShapes()
538538
for (S32 o = start; o < end; o++)
539539
{
540540
const TSShape::Object &object = shape->objects[o];
541-
const String &meshName = shape->names[object.nameIndex];
542541

543542
if (object.numMeshes <= detail.objectDetailNum)
544543
continue;

Engine/source/T3D/components/game/stateMachine.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,6 @@ void StateMachine::readConditions(StateTransition &currentTransition)
152152
//get our first state
153153
StateTransition::Condition firstCondition;
154154
StateField firstField;
155-
bool fieldRead = false;
156155

157156
readFieldName(&firstField, reader);
158157
firstCondition.field = firstField;

Engine/source/T3D/components/game/triggerComponent.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -239,8 +239,6 @@ bool TriggerComponent::testObject(SceneObject* enter)
239239
myList.setObject(mOwner);
240240

241241
myCI->buildPolyList(PLC_Collision, &myList, enterBox, sphere);
242-
243-
bool test = true;
244242
}
245243
}
246244
}

Engine/source/T3D/components/physics/playerControllerComponent.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -330,9 +330,6 @@ void PlayerControllerComponent::updateMove()
330330
}
331331

332332
// Update current orientation
333-
bool doStandardMove = true;
334-
GameConnection* con = mOwner->getControllingClient();
335-
336333
MatrixF zRot;
337334
zRot.set(EulerF(0.0f, 0.0f, mOwner->getRotation().asEulerF().z));
338335

@@ -355,7 +352,6 @@ void PlayerControllerComponent::updateMove()
355352
mContactInfo.jump = false;
356353
mContactInfo.run = false;
357354

358-
bool jumpSurface = false, runSurface = false;
359355
if (!mOwner->isMounted())
360356
findContact(&mContactInfo.run, &mContactInfo.jump, &mContactInfo.contactNormal);
361357
if (mContactInfo.jump)
@@ -577,7 +573,6 @@ void PlayerControllerComponent::updatePos(const F32 travelTime)
577573
newPos = mPhysicsRep->move(mVelocity * travelTime, collisionList);
578574

579575
bool haveCollisions = false;
580-
bool wasFalling = mFalling;
581576
if (collisionList.getCount() > 0)
582577
{
583578
mFalling = false;

Engine/source/T3D/convexShape.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -719,8 +719,6 @@ bool ConvexShape::buildExportPolyList(ColladaUtils::ExportData* exportData, cons
719719
//Convex shapes only have the one 'level', so we'll just rely on the export post-process to back-fill
720720
if (isServerObject() && getClientObject())
721721
{
722-
ConvexShape* clientShape = dynamic_cast<ConvexShape*>(getClientObject());
723-
724722
exportData->meshData.increment();
725723

726724
//Prep a meshData for this shape in particular

Engine/source/T3D/entity.cpp

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -306,8 +306,6 @@ void Entity::onPostAdd()
306306

307307
bool Entity::_setGameObject(void *object, const char *index, const char *data)
308308
{
309-
Entity *e = static_cast<Entity*>(object);
310-
311309
// Sanity!
312310
AssertFatal(data != NULL, "Cannot use a NULL asset Id.");
313311

@@ -513,8 +511,6 @@ U32 Entity::packUpdate(NetConnection *con, U32 mask, BitStream *stream)
513511

514512
for (U32 i = 0; i < mNetworkedComponents.size(); i++)
515513
{
516-
NetworkedComponent::UpdateState state = mNetworkedComponents[i].updateState;
517-
518514
if (mNetworkedComponents[i].updateState == NetworkedComponent::Adding)
519515
{
520516
const char* className = mComponents[mNetworkedComponents[i].componentIndex]->getClassName();
@@ -1381,7 +1377,6 @@ bool Entity::removeComponent(Component *comp, bool deleteComponent)
13811377
//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.
13821378
void Entity::clearComponents(bool deleteComponents)
13831379
{
1384-
bool srv = isServerObject();
13851380
if (!deleteComponents)
13861381
{
13871382
while (mComponents.size() > 0)
@@ -1399,8 +1394,6 @@ void Entity::clearComponents(bool deleteComponents)
13991394
{
14001395
comp->onComponentRemove(); //in case the behavior needs to do cleanup on the owner
14011396

1402-
bool removed = mComponents.remove(comp);
1403-
14041397
//we only need to delete them on the server side. they'll be cleaned up on the client side
14051398
//via the ghosting system for us
14061399
if (isServerObject())
@@ -1663,7 +1656,6 @@ void Entity::notifyComponents(String signalFunction, String argA, String argB, S
16631656

16641657
void Entity::setComponentsDirty()
16651658
{
1666-
bool tmp = true;
16671659
/*if (mToLoadComponents.empty())
16681660
mStartComponentUpdate = true;
16691661
@@ -1694,7 +1686,6 @@ void Entity::setComponentsDirty()
16941686

16951687
void Entity::setComponentDirty(Component *comp, bool forceUpdate)
16961688
{
1697-
bool found = false;
16981689
for (U32 i = 0; i < mComponents.size(); i++)
16991690
{
17001691
if (mComponents[i]->getId() == comp->getId())

Engine/source/T3D/entity.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,6 @@ Vector<T*> Entity::getComponents()
309309
Vector<T*> foundObjects;
310310

311311
T *curObj;
312-
Component* comp;
313312

314313
// Loop through our child objects.
315314
for (U32 i = 0; i < mComponents.size(); i++)

Engine/source/T3D/fx/particleEmitter.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -490,7 +490,7 @@ void ParticleEmitterData::unpackData(BitStream* stream)
490490
#if defined(AFX_CAP_PARTICLE_POOLS)
491491
if (stream->readFlag())
492492
{
493-
pool_datablock = (afxParticlePoolData*)stream->readRangedU32(DataBlockObjectIdFirst, DataBlockObjectIdLast);
493+
pool_datablock = (afxParticlePoolData*)(uintptr_t)stream->readRangedU32(DataBlockObjectIdFirst, DataBlockObjectIdLast);
494494
stream->read(&pool_index);
495495
pool_depth_fade = stream->readFlag();
496496
pool_radial_fade = stream->readFlag();

0 commit comments

Comments
 (0)