Merge pull request #612 from GarageGames/platform-type-consistency

Platform type consistency
This commit is contained in:
Daniel Buckmaster 2014-05-10 11:40:40 +10:00
commit 1702573b78
210 changed files with 896 additions and 896 deletions

View file

@ -63,7 +63,7 @@ AIClient::AIClient() {
mMoveTolerance = 0.25f;
// Clear the triggers
for( int i = 0; i < MaxTriggerKeys; i++ )
for( S32 i = 0; i < MaxTriggerKeys; i++ )
mTriggers[i] = false;
mAimToDestination = true;
@ -369,7 +369,7 @@ U32 AIClient::getMoveList( Move **movePtr,U32 *numMoves ) {
}
// Copy over the trigger status
for( int i = 0; i < MaxTriggerKeys; i++ ) {
for( S32 i = 0; i < MaxTriggerKeys; i++ ) {
mMove.trigger[i] = mTriggers[i];
mTriggers[i] = false;
}

View file

@ -443,7 +443,7 @@ bool AIPlayer::getAIMove(Move *movePtr)
// Replicate the trigger state into the move so that
// triggers can be controlled from scripts.
for( int i = 0; i < MaxTriggerKeys; i++ )
for( S32 i = 0; i < MaxTriggerKeys; i++ )
movePtr->trigger[i] = getImageTriggerState(i);
mLastLocation = location;

View file

@ -1546,7 +1546,7 @@ void Camera::_validateEyePoint(F32 pos, MatrixF *mat)
float dot = mDot(dir, collision.normal);
if (dot > 0.01f)
{
float colDist = mDot(startPos - collision.point, dir) - (1 / dot) * CameraRadius;
F32 colDist = mDot(startPos - collision.point, dir) - (1 / dot) * CameraRadius;
if (colDist > pos)
colDist = pos;
if (colDist < 0.0f)

View file

@ -194,7 +194,7 @@ void CameraSpline::renderTimeMap()
if(!ptr) return;
MRandomLCG random(1376312589 * (U32)this);
int index = 0;
S32 index = 0;
for(Vector<TimeMap>::iterator itr=mTimeMap.begin(); itr != mTimeMap.end(); itr++)
{
Knot a;

View file

@ -122,7 +122,7 @@ bool DebrisData::onAdd()
if(!Parent::onAdd())
return false;
for( int i=0; i<DDC_NUM_EMITTERS; i++ )
for( S32 i=0; i<DDC_NUM_EMITTERS; i++ )
{
if( !emitterList[i] && emitterIDList[i] != 0 )
{
@ -303,7 +303,7 @@ void DebrisData::packData(BitStream* stream)
stream->writeString( textureName );
stream->writeString( shapeName );
for( int i=0; i<DDC_NUM_EMITTERS; i++ )
for( S32 i=0; i<DDC_NUM_EMITTERS; i++ )
{
if( stream->writeFlag( emitterList[i] != NULL ) )
{
@ -346,7 +346,7 @@ void DebrisData::unpackData(BitStream* stream)
textureName = stream->readSTString();
shapeName = stream->readSTString();
for( int i=0; i<DDC_NUM_EMITTERS; i++ )
for( S32 i=0; i<DDC_NUM_EMITTERS; i++ )
{
if( stream->readFlag() )
{
@ -512,7 +512,7 @@ bool Debris::onAdd()
}
// create emitters
for( int i=0; i<DebrisData::DDC_NUM_EMITTERS; i++ )
for( S32 i=0; i<DebrisData::DDC_NUM_EMITTERS; i++ )
{
if( mDataBlock->emitterList[i] != NULL )
{
@ -631,7 +631,7 @@ bool Debris::onAdd()
void Debris::onRemove()
{
for( int i=0; i<DebrisData::DDC_NUM_EMITTERS; i++ )
for( S32 i=0; i<DebrisData::DDC_NUM_EMITTERS; i++ )
{
if( mEmitterList[i] )
{
@ -848,7 +848,7 @@ void Debris::updateEmitters( Point3F &pos, Point3F &vel, U32 ms )
Point3F lastPos = mLastPos;
for( int i=0; i<DebrisData::DDC_NUM_EMITTERS; i++ )
for( S32 i=0; i<DebrisData::DDC_NUM_EMITTERS; i++ )
{
if( mEmitterList[i] )
{

View file

@ -117,7 +117,7 @@ ConsoleDocClass( DecalManager,
namespace {
int QSORT_CALLBACK cmpDecalInstance(const void* p1, const void* p2)
S32 QSORT_CALLBACK cmpDecalInstance(const void* p1, const void* p2)
{
const DecalInstance** pd1 = (const DecalInstance**)p1;
const DecalInstance** pd2 = (const DecalInstance**)p2;
@ -125,7 +125,7 @@ int QSORT_CALLBACK cmpDecalInstance(const void* p1, const void* p2)
return int(((char *)(*pd1)->mDataBlock) - ((char *)(*pd2)->mDataBlock));
}
int QSORT_CALLBACK cmpPointsXY( const void *p1, const void *p2 )
S32 QSORT_CALLBACK cmpPointsXY( const void *p1, const void *p2 )
{
const Point3F *pnt1 = (const Point3F*)p1;
const Point3F *pnt2 = (const Point3F*)p2;
@ -142,7 +142,7 @@ int QSORT_CALLBACK cmpPointsXY( const void *p1, const void *p2 )
return 0;
}
int QSORT_CALLBACK cmpQuadPointTheta( const void *p1, const void *p2 )
S32 QSORT_CALLBACK cmpQuadPointTheta( const void *p1, const void *p2 )
{
const Point4F *pnt1 = (const Point4F*)p1;
const Point4F *pnt2 = (const Point4F*)p2;
@ -157,7 +157,7 @@ int QSORT_CALLBACK cmpQuadPointTheta( const void *p1, const void *p2 )
static Point3F gSortPoint;
int QSORT_CALLBACK cmpDecalDistance( const void *p1, const void *p2 )
S32 QSORT_CALLBACK cmpDecalDistance( const void *p1, const void *p2 )
{
const DecalInstance** pd1 = (const DecalInstance**)p1;
const DecalInstance** pd2 = (const DecalInstance**)p2;
@ -168,7 +168,7 @@ int QSORT_CALLBACK cmpDecalDistance( const void *p1, const void *p2 )
return mSign( dist1 - dist2 );
}
int QSORT_CALLBACK cmpDecalRenderOrder( const void *p1, const void *p2 )
S32 QSORT_CALLBACK cmpDecalRenderOrder( const void *p1, const void *p2 )
{
const DecalInstance** pd1 = (const DecalInstance**)p1;
const DecalInstance** pd2 = (const DecalInstance**)p2;
@ -179,14 +179,14 @@ int QSORT_CALLBACK cmpDecalRenderOrder( const void *p1, const void *p2 )
return 1;
else
{
int priority = (*pd1)->getRenderPriority() - (*pd2)->getRenderPriority();
S32 priority = (*pd1)->getRenderPriority() - (*pd2)->getRenderPriority();
if ( priority != 0 )
return priority;
if ( (*pd2)->mFlags & SaveDecal )
{
int id = ( (*pd1)->mDataBlock->getMaterial()->getId() - (*pd2)->mDataBlock->getMaterial()->getId() );
S32 id = ( (*pd1)->mDataBlock->getMaterial()->getId() - (*pd2)->mDataBlock->getMaterial()->getId() );
if ( id != 0 )
return id;

View file

@ -929,7 +929,7 @@ bool Explosion::onAdd()
void Explosion::onRemove()
{
for( int i=0; i<ExplosionData::EC_NUM_EMITTERS; i++ )
for( S32 i=0; i<ExplosionData::EC_NUM_EMITTERS; i++ )
{
if( mEmitterList[i] )
{
@ -1114,7 +1114,7 @@ void Explosion::updateEmitters( F32 dt )
{
Point3F pos = getPosition();
for( int i=0; i<ExplosionData::EC_NUM_EMITTERS; i++ )
for( S32 i=0; i<ExplosionData::EC_NUM_EMITTERS; i++ )
{
if( mEmitterList[i] )
{
@ -1134,7 +1134,7 @@ void Explosion::launchDebris( Point3F &axis )
return;
bool hasDebris = false;
for( int j=0; j<ExplosionData::EC_NUM_DEBRIS_TYPES; j++ )
for( S32 j=0; j<ExplosionData::EC_NUM_DEBRIS_TYPES; j++ )
{
if( mDataBlock->debrisList[j] )
{
@ -1160,7 +1160,7 @@ void Explosion::launchDebris( Point3F &axis )
U32 numDebris = mDataBlock->debrisNum + sgRandom.randI( -mDataBlock->debrisNumVariance, mDataBlock->debrisNumVariance );
for( int i=0; i<numDebris; i++ )
for( S32 i=0; i<numDebris; i++ )
{
Point3F launchDir = MathUtils::randomDir( axis, mDataBlock->debrisThetaMin, mDataBlock->debrisThetaMax,
@ -1249,7 +1249,7 @@ bool Explosion::explode()
Point3F::Zero, U32(mDataBlock->particleDensity * mFade));
}
for( int i=0; i<ExplosionData::EC_NUM_EMITTERS; i++ )
for( S32 i=0; i<ExplosionData::EC_NUM_EMITTERS; i++ )
{
if( mDataBlock->emitterList[i] != NULL )
{

View file

@ -1139,7 +1139,7 @@ void LightningBolt::generateMinorNodes()
{
mMinorNodes.clear();
for( int i=0; i<mMajorNodes.numNodes - 1; i++ )
for( S32 i=0; i<mMajorNodes.numNodes - 1; i++ )
{
NodeManager segment;
segment.startPoint = mMajorNodes.nodeList[i].point;

View file

@ -66,11 +66,11 @@ ConsoleDocClass( ParticleData,
"@see ParticleEmitterNode\n"
);
static const float sgDefaultWindCoefficient = 0.0f;
static const float sgDefaultConstantAcceleration = 0.f;
static const float sgDefaultSpinSpeed = 1.f;
static const float sgDefaultSpinRandomMin = 0.f;
static const float sgDefaultSpinRandomMax = 0.f;
static const F32 sgDefaultWindCoefficient = 0.0f;
static const F32 sgDefaultConstantAcceleration = 0.f;
static const F32 sgDefaultSpinSpeed = 1.f;
static const F32 sgDefaultSpinRandomMin = 0.f;
static const F32 sgDefaultSpinRandomMax = 0.f;
//-----------------------------------------------------------------------------
@ -622,7 +622,7 @@ bool ParticleData::reload(char errorBuffer[256])
}
/*
numFrames = 0;
for( int i=0; i<PDC_MAX_TEX; i++ )
for( S32 i=0; i<PDC_MAX_TEX; i++ )
{
if( textureNameList[i] && textureNameList[i][0] )
{

View file

@ -100,9 +100,9 @@ ConsoleDocClass( ParticleEmitterData,
"@see ParticleEmitterNode\n"
);
static const float sgDefaultEjectionOffset = 0.f;
static const float sgDefaultPhiReferenceVel = 0.f;
static const float sgDefaultPhiVariance = 360.f;
static const F32 sgDefaultEjectionOffset = 0.f;
static const F32 sgDefaultPhiReferenceVel = 0.f;
static const F32 sgDefaultPhiVariance = 360.f;
//-----------------------------------------------------------------------------
// ParticleEmitterData
@ -929,7 +929,7 @@ void ParticleEmitter::prepRenderImage(SceneRenderState* state)
//-----------------------------------------------------------------------------
void ParticleEmitter::setSizes( F32 *sizeList )
{
for( int i=0; i<ParticleData::PDC_NUM_KEYS; i++ )
for( S32 i=0; i<ParticleData::PDC_NUM_KEYS; i++ )
{
sizes[i] = sizeList[i];
}
@ -940,7 +940,7 @@ void ParticleEmitter::setSizes( F32 *sizeList )
//-----------------------------------------------------------------------------
void ParticleEmitter::setColors( ColorF *colorList )
{
for( int i=0; i<ParticleData::PDC_NUM_KEYS; i++ )
for( S32 i=0; i<ParticleData::PDC_NUM_KEYS; i++ )
{
colors[i] = colorList[i];
}
@ -1455,7 +1455,7 @@ struct SortParticle
};
// qsort callback function for particle sorting
int QSORT_CALLBACK cmpSortParticles(const void* p1, const void* p2)
S32 QSORT_CALLBACK cmpSortParticles(const void* p1, const void* p2)
{
const SortParticle* sp1 = (const SortParticle*)p1;
const SortParticle* sp2 = (const SortParticle*)p2;

View file

@ -92,7 +92,7 @@ void StdMoveList::clientWriteMovePacket(BitStream *bstream)
bstream->writeInt(start,32);
bstream->writeInt(count,MoveCountBits);
Move * prevMove = NULL;
for (int i = 0; i < count; i++)
for (S32 i = 0; i < count; i++)
{
move[offset + i].sendCount++;
move[offset + i].pack(bstream,prevMove);
@ -112,7 +112,7 @@ void StdMoveList::serverReadMovePacket(BitStream *bstream)
// Skip forward (must be starting up), or over the moves
// we already have.
int skip = mLastMoveAck - start;
S32 skip = mLastMoveAck - start;
if (skip < 0)
{
mLastMoveAck = start;
@ -121,7 +121,7 @@ void StdMoveList::serverReadMovePacket(BitStream *bstream)
{
if (skip > count)
skip = count;
for (int i = 0; i < skip; i++)
for (S32 i = 0; i < skip; i++)
{
prevMoveHolder.unpack(bstream,prevMove);
prevMoveHolder.checksum = bstream->readInt(Move::ChecksumBits);
@ -141,7 +141,7 @@ void StdMoveList::serverReadMovePacket(BitStream *bstream)
}
// Put the rest on the move list.
int index = mMoveVec.size();
S32 index = mMoveVec.size();
mMoveVec.increment(count);
while (index < mMoveVec.size())
{

View file

@ -893,7 +893,7 @@ void Item::updatePos(const U32 /*mask*/, const F32 dt)
// Pick the most resistant surface
F32 bd = 0;
const Collision* collision = 0;
for (int c = 0; c < collisionList.getCount(); c++) {
for (S32 c = 0; c < collisionList.getCount(); c++) {
const Collision &cp = collisionList[c];
F32 dot = -mDot(mVelocity,cp.normal);
if (dot > bd) {
@ -1204,7 +1204,7 @@ DefineEngineMethod( Item, isRotating, bool, (),,
return object->isRotating();
}
DefineEngineMethod( Item, setCollisionTimeout, bool, (int ignoreColObj),(NULL),
DefineEngineMethod( Item, setCollisionTimeout, bool, (S32 ignoreColObj),(NULL),
"@brief Temporarily disable collisions against a specific ShapeBase object.\n\n"
"This is useful to prevent a player from immediately picking up an Item they have "

View file

@ -429,7 +429,7 @@ U32 PathCamera::packUpdate(NetConnection *con, U32 mask, BitStream *stream)
if (stream->writeFlag(mask & WindowMask)) {
stream->write(mNodeBase);
stream->write(mNodeCount);
for (int i = 0; i < mNodeCount; i++) {
for (S32 i = 0; i < mNodeCount; i++) {
CameraSpline::Knot *knot = mSpline.getKnot(i);
mathWrite(*stream, knot->mPosition);
mathWrite(*stream, knot->mRotation);
@ -477,7 +477,7 @@ void PathCamera::unpackUpdate(NetConnection *con, BitStream *stream)
mSpline.removeAll();
stream->read(&mNodeBase);
stream->read(&mNodeCount);
for (int i = 0; i < mNodeCount; i++)
for (S32 i = 0; i < mNodeCount; i++)
{
CameraSpline::Knot *knot = new CameraSpline::Knot();
mathRead(*stream, &knot->mPosition);

View file

@ -83,7 +83,7 @@ private:
S32 mNodeBase;
S32 mNodeCount;
F32 mPosition;
int mState;
S32 mState;
F32 mTarget;
bool mTargetSet;

View file

@ -467,7 +467,7 @@ bool PlayerData::preload(bool server, String &errorStr)
// Extract ground transform velocity from animations
// Get the named ones first so they can be indexed directly.
ActionAnimation *dp = &actionList[0];
for (int i = 0; i < NumTableActionAnims; i++,dp++)
for (S32 i = 0; i < NumTableActionAnims; i++,dp++)
{
ActionAnimationDef *sp = &ActionAnimationList[i];
dp->name = sp->name;
@ -492,7 +492,7 @@ bool PlayerData::preload(bool server, String &errorStr)
if (dStricmp(sp->name, "jet") != 0)
AssertWarn(dp->sequence != -1, avar("PlayerData::preload - Unable to find named animation sequence '%s'!", sp->name));
}
for (int b = 0; b < mShape->sequences.size(); b++)
for (S32 b = 0; b < mShape->sequences.size(); b++)
{
if (!isTableSequence(b))
{
@ -509,7 +509,7 @@ bool PlayerData::preload(bool server, String &errorStr)
// Resolve lookAction index
dp = &actionList[0];
String lookName("look");
for (int c = 0; c < actionCount; c++,dp++)
for (S32 c = 0; c < actionCount; c++,dp++)
if( dStricmp( dp->name, lookName ) == 0 )
lookAction = c;
@ -557,7 +557,7 @@ bool PlayerData::preload(bool server, String &errorStr)
if (!Sim::findObject(dustID, dustEmitter))
Con::errorf(ConsoleLogEntry::General, "PlayerData::preload - Invalid packet, bad datablockId(dustEmitter): 0x%x", dustID);
for (int i=0; i<NUM_SPLASH_EMITTERS; i++)
for (S32 i=0; i<NUM_SPLASH_EMITTERS; i++)
if( !splashEmitterList[i] && splashEmitterIDList[i] != 0 )
if( Sim::findObject( splashEmitterIDList[i], splashEmitterList[i] ) == false)
Con::errorf(ConsoleLogEntry::General, "PlayerData::onAdd - Invalid packet, bad datablockId(particle emitter): 0x%x", splashEmitterIDList[i]);
@ -647,7 +647,7 @@ bool PlayerData::isTableSequence(S32 seq)
{
// The sequences from the table must already have
// been loaded for this to work.
for (int i = 0; i < NumTableActionAnims; i++)
for (S32 i = 0; i < NumTableActionAnims; i++)
if (actionList[i].sequence == seq)
return true;
return false;
@ -1944,7 +1944,7 @@ void Player::reSkin()
Vector<String> skins;
String(mSkinNameHandle.getString()).split( ";", skins );
for ( int i = 0; i < skins.size(); i++ )
for ( S32 i = 0; i < skins.size(); i++ )
{
String oldSkin( mAppliedSkinName.c_str() );
String newSkin( skins[i] );
@ -1961,7 +1961,7 @@ void Player::reSkin()
// Apply skin to both 3rd person and 1st person shape instances
mShapeInstance->reSkin( newSkin, oldSkin );
for ( int j = 0; j < ShapeBase::MaxMountedImages; j++ )
for ( S32 j = 0; j < ShapeBase::MaxMountedImages; j++ )
{
if (mShapeFPInstance[j])
mShapeFPInstance[j]->reSkin( newSkin, oldSkin );
@ -5822,7 +5822,7 @@ bool Player::castRay(const Point3F &start, const Point3F &end, RayInfo* info)
F32 const *si = &start.x;
F32 const *ei = &end.x;
for (int i = 0; i < 3; i++) {
for (S32 i = 0; i < 3; i++) {
if (*si < *ei) {
if (*si > *bmax || *ei < *bmin)
return false;

View file

@ -215,9 +215,9 @@ public:
void updateSound();
virtual bool calculateImpact( float simTime,
virtual bool calculateImpact( F32 simTime,
Point3F &pointOfImpact,
float &impactTime );
F32 &impactTime );
void setInitialPosition( const Point3F& pos );
void setInitialVelocity( const Point3F& vel );

View file

@ -451,7 +451,7 @@ void ProximityMine::processTick( const Move* move )
SimpleQueryList sql;
getContainer()->findObjects( triggerBox, sTriggerCollisionMask,
SimpleQueryList::insertionCallback, &sql );
for ( int i = 0; i < sql.mList.size(); i++ )
for ( S32 i = 0; i < sql.mList.size(); i++ )
{
// Detect movement in the trigger area
if ( ( sql.mList[i] == mOwner && !mDataBlock->triggerOnOwner ) ||

View file

@ -265,8 +265,8 @@ void Rigid::translateCenterOfMass(const Point3F &oldPos,const Point3F &newPos)
MatrixF oldx,newx;
oldx.setCrossProduct(oldPos);
newx.setCrossProduct(newPos);
for (int row = 0; row < 3; row++)
for (int col = 0; col < 3; col++) {
for (S32 row = 0; row < 3; row++)
for (S32 col = 0; col < 3; col++) {
F32 n = newx(row,col), o = oldx(row,col);
objectInertia(row,col) += mass * ((o * o) - (n * n));
}

View file

@ -196,7 +196,7 @@ namespace {
// Physics and collision constants
static F32 sRestTol = 0.5; // % of gravity energy to be at rest
static int sRestCount = 10; // Consecutive ticks before comming to rest
static S32 sRestCount = 10; // Consecutive ticks before comming to rest
const U32 sCollisionMoveMask = ( TerrainObjectType | PlayerObjectType |
StaticShapeObjectType | VehicleObjectType |
@ -1652,7 +1652,7 @@ void RigidShape::_renderMassAndContacts( ObjectRenderInst *ri, SceneRenderState
GFX->getDrawUtil()->drawCube( desc, Point3F(0.1f,0.1f,0.1f), mDataBlock->massCenter, ColorI(255, 255, 255), &mRenderObjToWorld );
// Collision points...
for (int i = 0; i < mCollisionList.getCount(); i++)
for (S32 i = 0; i < mCollisionList.getCount(); i++)
{
const Collision& collision = mCollisionList[i];
GFX->getDrawUtil()->drawCube( desc, Point3F(0.05f,0.05f,0.05f), collision.point, ColorI(0, 0, 255) );
@ -1660,7 +1660,7 @@ void RigidShape::_renderMassAndContacts( ObjectRenderInst *ri, SceneRenderState
// Render the normals as one big batch...
PrimBuild::begin(GFXLineList, mCollisionList.getCount() * 2);
for (int i = 0; i < mCollisionList.getCount(); i++)
for (S32 i = 0; i < mCollisionList.getCount(); i++)
{
const Collision& collision = mCollisionList[i];

View file

@ -195,7 +195,7 @@ class RigidShape: public ShapeBase
CollisionList mContacts;
Rigid mRigid;
ShapeBaseConvex mConvex;
int restCount;
S32 restCount;
SimObjectPtr<ParticleEmitter> mDustEmitterList[RigidShapeData::VC_NUM_DUST_EMITTERS];
SimObjectPtr<ParticleEmitter> mSplashEmitterList[RigidShapeData::VC_NUM_SPLASH_EMITTERS];

View file

@ -1274,7 +1274,7 @@ void ShapeBase::processTick(const Move* move)
{
mMoveMotion = true;
}
for (int i = 0; i < MaxMountedImages; i++)
for (S32 i = 0; i < MaxMountedImages; i++)
{
setImageMotionState(i, mMoveMotion);
}
@ -1297,7 +1297,7 @@ void ShapeBase::processTick(const Move* move)
// Advance images
if (isServerObject())
{
for (int i = 0; i < MaxMountedImages; i++)
for (S32 i = 0; i < MaxMountedImages; i++)
{
if (mMountedImageList[i].dataBlock)
updateImageState(i, TickSec);
@ -1339,7 +1339,7 @@ void ShapeBase::advanceTime(F32 dt)
// advanced at framerate.
advanceThreads(dt);
updateAudioPos();
for (int i = 0; i < MaxMountedImages; i++)
for (S32 i = 0; i < MaxMountedImages; i++)
if (mMountedImageList[i].dataBlock)
{
updateImageState(i, dt);
@ -2070,7 +2070,7 @@ void ShapeBase::stopAudio(U32 slot)
void ShapeBase::updateServerAudio()
{
// Timeout non-looping sounds
for (int i = 0; i < MaxSoundThreads; i++) {
for (S32 i = 0; i < MaxSoundThreads; i++) {
Sound& st = mSoundThread[i];
if (st.play && st.timeout && st.timeout < Sim::getCurrentTime()) {
clearMaskBits(SoundMaskN << i);
@ -2110,7 +2110,7 @@ void ShapeBase::updateAudioState(Sound& st)
void ShapeBase::updateAudioPos()
{
for (int i = 0; i < MaxSoundThreads; i++)
for (S32 i = 0; i < MaxSoundThreads; i++)
{
SFXSource* source = mSoundThread[i].sound;
if ( source )
@ -2942,7 +2942,7 @@ U32 ShapeBase::packUpdate(NetConnection *con, U32 mask, BitStream *stream)
}
if (stream->writeFlag(mask & ThreadMask)) {
for (int i = 0; i < MaxScriptThreads; i++) {
for (S32 i = 0; i < MaxScriptThreads; i++) {
Thread& st = mScriptThread[i];
if (stream->writeFlag( (st.sequence != -1 || st.state == Thread::Destroy) && (mask & (ThreadMaskN << i)) ) ) {
stream->writeInt(st.sequence,ThreadSequenceBits);
@ -2955,7 +2955,7 @@ U32 ShapeBase::packUpdate(NetConnection *con, U32 mask, BitStream *stream)
}
if (stream->writeFlag(mask & SoundMask)) {
for (int i = 0; i < MaxSoundThreads; i++) {
for (S32 i = 0; i < MaxSoundThreads; i++) {
Sound& st = mSoundThread[i];
if (stream->writeFlag(mask & (SoundMaskN << i)))
if (stream->writeFlag(st.play))
@ -2965,7 +2965,7 @@ U32 ShapeBase::packUpdate(NetConnection *con, U32 mask, BitStream *stream)
}
if (stream->writeFlag(mask & ImageMask)) {
for (int i = 0; i < MaxMountedImages; i++)
for (S32 i = 0; i < MaxMountedImages; i++)
if (stream->writeFlag(mask & (ImageMaskN << i))) {
MountedImage& image = mMountedImageList[i];
if (stream->writeFlag(image.dataBlock))
@ -3092,7 +3092,7 @@ void ShapeBase::unpackUpdate(NetConnection *con, BitStream *stream)
// Mounted Images
if (stream->readFlag()) {
for (int i = 0; i < MaxMountedImages; i++) {
for (S32 i = 0; i < MaxMountedImages; i++) {
if (stream->readFlag()) {
MountedImage& image = mMountedImageList[i];
ShapeBaseImageData* imageData = 0;
@ -3129,9 +3129,9 @@ void ShapeBase::unpackUpdate(NetConnection *con, BitStream *stream)
image.genericTrigger[j] = stream->readFlag();
}
int count = stream->readInt(3);
int altCount = stream->readInt(3);
int reloadCount = stream->readInt(3);
S32 count = stream->readInt(3);
S32 altCount = stream->readInt(3);
S32 reloadCount = stream->readInt(3);
bool datablockChange = image.dataBlock != imageData;
if (datablockChange || (image.skinNameHandle != skinDesiredNameHandle))
@ -3544,7 +3544,7 @@ void ShapeBase::reSkin()
Vector<String> skins;
String(mSkinNameHandle.getString()).split( ";", skins );
for (int i = 0; i < skins.size(); i++)
for (S32 i = 0; i < skins.size(); i++)
{
String oldSkin( mAppliedSkinName.c_str() );
String newSkin( skins[i] );

View file

@ -203,7 +203,7 @@ ShapeBaseImageData::ShapeBaseImageData()
scriptAnimTransitionTime = 0.25f;
//
for (int i = 0; i < MaxStates; i++) {
for (S32 i = 0; i < MaxStates; i++) {
stateName[i] = 0;
stateTransitionLoaded[i] = 0;
@ -3057,7 +3057,7 @@ TICKAGAIN:
if (image.spinThread[i])
{
float timeScale;
F32 timeScale;
switch (stateData.spin)
{

View file

@ -188,7 +188,7 @@ bool Trigger::castRay(const Point3F &start, const Point3F &end, RayInfo* info)
F32 const *si = &start.x;
F32 const *ei = &end.x;
for (int i = 0; i < 3; i++)
for (S32 i = 0; i < 3; i++)
{
if (*si < *ei)
{

View file

@ -442,7 +442,7 @@ void TSStatic::reSkin()
Vector<String> skins;
String(mSkinNameHandle.getString()).split( ";", skins );
for (int i = 0; i < skins.size(); i++)
for (S32 i = 0; i < skins.size(); i++)
{
String oldSkin( mAppliedSkinName.c_str() );
String newSkin( skins[i] );

View file

@ -99,7 +99,7 @@ AITurretShapeData::AITurretShapeData()
weaponLeadVelocity = 0;
for (int i = 0; i < MaxStates; i++) {
for (S32 i = 0; i < MaxStates; i++) {
stateName[i] = 0;
stateTransitionAtRest[i] = 0;
stateTransitionNotAtRest[i] = 0;

View file

@ -69,7 +69,7 @@ const F32 sVehicleGravity = -20;
// Physics and collision constants
static F32 sRestTol = 0.5; // % of gravity energy to be at rest
static int sRestCount = 10; // Consecutive ticks before comming to rest
static S32 sRestCount = 10; // Consecutive ticks before comming to rest
} // namespace {}
@ -341,14 +341,14 @@ void VehicleData::packData(BitStream* stream)
}
}
for (int j = 0; j < VC_NUM_DAMAGE_EMITTER_AREAS; j++)
for (S32 j = 0; j < VC_NUM_DAMAGE_EMITTER_AREAS; j++)
{
stream->write( damageEmitterOffset[j].x );
stream->write( damageEmitterOffset[j].y );
stream->write( damageEmitterOffset[j].z );
}
for (int k = 0; k < VC_NUM_DAMAGE_LEVELS; k++)
for (S32 k = 0; k < VC_NUM_DAMAGE_LEVELS; k++)
{
stream->write( damageLevelTolerance[k] );
}
@ -440,14 +440,14 @@ void VehicleData::unpackData(BitStream* stream)
}
}
for( int j=0; j<VC_NUM_DAMAGE_EMITTER_AREAS; j++ )
for( S32 j=0; j<VC_NUM_DAMAGE_EMITTER_AREAS; j++ )
{
stream->read( &damageEmitterOffset[j].x );
stream->read( &damageEmitterOffset[j].y );
stream->read( &damageEmitterOffset[j].z );
}
for( int k=0; k<VC_NUM_DAMAGE_LEVELS; k++ )
for( S32 k=0; k<VC_NUM_DAMAGE_LEVELS; k++ )
{
stream->read( &damageLevelTolerance[k] );
}
@ -718,7 +718,7 @@ bool Vehicle::onAdd()
{
if( mDataBlock->dustEmitter )
{
for( int i=0; i<VehicleData::VC_NUM_DUST_EMITTERS; i++ )
for( S32 i=0; i<VehicleData::VC_NUM_DUST_EMITTERS; i++ )
{
mDustEmitterList[i] = new ParticleEmitter;
mDustEmitterList[i]->onNewDataBlock( mDataBlock->dustEmitter, false );
@ -1804,7 +1804,7 @@ void Vehicle::updateDamageSmoke( F32 dt )
F32 damagePercent = mDamage / mDataBlock->maxDamage;
if( damagePercent >= mDataBlock->damageLevelTolerance[j] )
{
for( int i=0; i<mDataBlock->numDmgEmitterAreas; i++ )
for( S32 i=0; i<mDataBlock->numDmgEmitterAreas; i++ )
{
MatrixF trans = getTransform();
Point3F offset = mDataBlock->damageEmitterOffset[i];
@ -1935,7 +1935,7 @@ void Vehicle::_renderMassAndContacts( ObjectRenderInst *ri, SceneRenderState *st
GFX->getDrawUtil()->drawCube(desc, Point3F(0.1f,0.1f,0.1f),mDataBlock->massCenter, ColorI(255, 255, 255), &mRenderObjToWorld);
// Now render all the contact points.
for (int i = 0; i < mCollisionList.getCount(); i++)
for (S32 i = 0; i < mCollisionList.getCount(); i++)
{
const Collision& collision = mCollisionList[i];
GFX->getDrawUtil()->drawCube(desc, Point3F(0.05f,0.05f,0.05f),collision.point, ColorI(0, 0, 255));
@ -1943,7 +1943,7 @@ void Vehicle::_renderMassAndContacts( ObjectRenderInst *ri, SceneRenderState *st
// Finally render the normals as one big batch.
PrimBuild::begin(GFXLineList, mCollisionList.getCount() * 2);
for (int i = 0; i < mCollisionList.getCount(); i++)
for (S32 i = 0; i < mCollisionList.getCount(); i++)
{
const Collision& collision = mCollisionList[i];
PrimBuild::color3f(1, 1, 1);

View file

@ -202,7 +202,7 @@ class Vehicle: public ShapeBase
CollisionList mContacts;
Rigid mRigid;
ShapeBaseConvex mConvex;
int restCount;
S32 restCount;
SimObjectPtr<ParticleEmitter> mDustEmitterList[VehicleData::VC_NUM_DUST_EMITTERS];
SimObjectPtr<ParticleEmitter> mDamageEmitterList[VehicleData::VC_NUM_DAMAGE_EMITTERS];

View file

@ -421,7 +421,7 @@ DefineEngineMethod(TCPObject, send, void, (const char *data),,
object->send( (const U8*)data, dStrlen(data) );
}
DefineEngineMethod(TCPObject, listen, void, (int port),,
DefineEngineMethod(TCPObject, listen, void, (U32 port),,
"@brief Start listening on the specified port for connections.\n\n"
"This method starts a listener which looks for incoming TCP connections to a port. "

View file

@ -43,7 +43,7 @@ extern "C" {
return so->getClassName();
}
void *SimObject_GetFieldList(SimObject *so, int &outNumFields)
void *SimObject_GetFieldList(SimObject *so, S32 &outNumFields)
{
const AbstractClassRep::FieldList &fl = so->getFieldList();
outNumFields = fl.size();

View file

@ -164,7 +164,7 @@ extern "C" {
return false;
}
void script_simobject_setfield_int(U32 objectId, const char* fieldName, int v)
void script_simobject_setfield_int(U32 objectId, const char* fieldName, S32 v)
{
SimObject *object = Sim::findObject( objectId );
if( object )
@ -291,12 +291,12 @@ extern "C" {
entry->cb.mVoidCallbackFunc(o, argc, argv);
}
int script_simobject_get_id(SimObject* so)
S32 script_simobject_get_id(SimObject* so)
{
return so->getId();
}
int script_simobject_find(const char* classname, const char* name)
S32 script_simobject_find(const char* classname, const char* name)
{
SimObject *object;
if( Sim::findObject( name, object ) )
@ -385,7 +385,7 @@ extern "C" {
#ifdef TORQUE_OS_WIN
void script_input_event(int type, int value1, int value2)
void script_input_event(S32 type, S32 value1, S32 value2)
{
if (PlatformWindowManager::get() && PlatformWindowManager::get()->getFirstWindow())
{

View file

@ -37,7 +37,7 @@ extern void createFontShutdown(void);
#endif
#if defined( TORQUE_MINIDUMP ) && defined( TORQUE_RELEASE )
extern INT CreateMiniDump(LPEXCEPTION_POINTERS ExceptionInfo);
extern S32 CreateMiniDump(LPEXCEPTION_POINTERS ExceptionInfo);
#endif
static HashTable<StringTableEntry,StringTableEntry> gSecureScript;
@ -47,7 +47,7 @@ static HashTable<StringTableEntry,StringTableEntry> gSecureScript;
// ObjC hooks for shared library support
// See: macMain.mm
void torque_mac_engineinit(int argc, const char **argv);
void torque_mac_engineinit(S32 argc, const char **argv);
void torque_mac_enginetick();
void torque_mac_engineshutdown();
@ -64,7 +64,7 @@ extern "C" {
}
// initialize Torque 3D including argument handling
int torque_engineinit(S32 argc, const char **argv)
S32 torque_engineinit(S32 argc, const char **argv)
{
#if defined( TORQUE_MINIDUMP ) && defined( TORQUE_RELEASE )
@ -105,7 +105,7 @@ extern "C" {
}
// tick Torque 3D's main loop
int torque_enginetick()
S32 torque_enginetick()
{
#if defined( TORQUE_MINIDUMP ) && defined( TORQUE_RELEASE )
@ -139,7 +139,7 @@ extern "C" {
}
// shutdown the engine
int torque_engineshutdown()
S32 torque_engineshutdown()
{
#if defined( TORQUE_MINIDUMP ) && defined( TORQUE_RELEASE )
@ -181,7 +181,7 @@ extern "C" {
}
int torque_getconsolebool(const char* name)
S32 torque_getconsolebool(const char* name)
{
return Con::getBoolVariable(name);
}

View file

@ -96,7 +96,7 @@ public:
}
// Accessors
int getCount() const { return mCount; }
S32 getCount() const { return mCount; }
F32 getTime() const { return mT; }
F32 getMaxHeight() const { return mMaxHeight; }

View file

@ -69,21 +69,21 @@ void GjkCollisionState::swap()
void GjkCollisionState::compute_det()
{
// Dot new point with current set
for (int i = 0, bit = 1; i < 4; ++i, bit <<=1)
for (S32 i = 0, bit = 1; i < 4; ++i, bit <<=1)
if (bits & bit)
dp[i][last] = dp[last][i] = mDot(y[i], y[last]);
dp[last][last] = mDot(y[last], y[last]);
// Calulate the determinent
det[last_bit][last] = 1;
for (int j = 0, sj = 1; j < 4; ++j, sj <<= 1) {
for (S32 j = 0, sj = 1; j < 4; ++j, sj <<= 1) {
if (bits & sj) {
int s2 = sj | last_bit;
S32 s2 = sj | last_bit;
det[s2][j] = dp[last][last] - dp[last][j];
det[s2][last] = dp[j][j] - dp[j][last];
for (int k = 0, sk = 1; k < j; ++k, sk <<= 1) {
for (S32 k = 0, sk = 1; k < j; ++k, sk <<= 1) {
if (bits & sk) {
int s3 = sk | s2;
S32 s3 = sk | s2;
det[s3][k] = det[s2][j] * (dp[j][j] - dp[j][k]) +
det[s2][last] * (dp[last][j] - dp[last][k]);
det[s3][j] = det[sk | last_bit][k] * (dp[k][k] - dp[k][j]) +
@ -114,11 +114,11 @@ void GjkCollisionState::compute_det()
//----------------------------------------------------------------------------
inline void GjkCollisionState::compute_vector(int bits, VectorF& v)
inline void GjkCollisionState::compute_vector(S32 bits, VectorF& v)
{
F32 sum = 0;
v.set(0, 0, 0);
for (int i = 0, bit = 1; i < 4; ++i, bit <<= 1) {
for (S32 i = 0, bit = 1; i < 4; ++i, bit <<= 1) {
if (bits & bit) {
sum += det[bits][i];
v += y[i] * det[bits][i];
@ -130,9 +130,9 @@ inline void GjkCollisionState::compute_vector(int bits, VectorF& v)
//----------------------------------------------------------------------------
inline bool GjkCollisionState::valid(int s)
inline bool GjkCollisionState::valid(S32 s)
{
for (int i = 0, bit = 1; i < 4; ++i, bit <<= 1) {
for (S32 i = 0, bit = 1; i < 4; ++i, bit <<= 1) {
if (all_bits & bit) {
if (s & bit) {
if (det[s][i] <= 0)
@ -152,7 +152,7 @@ inline bool GjkCollisionState::valid(int s)
inline bool GjkCollisionState::closest(VectorF& v)
{
compute_det();
for (int s = bits; s; --s) {
for (S32 s = bits; s; --s) {
if ((s & bits) == s) {
if (valid(s | last_bit)) {
bits = s | last_bit;
@ -175,7 +175,7 @@ inline bool GjkCollisionState::closest(VectorF& v)
inline bool GjkCollisionState::degenerate(const VectorF& w)
{
for (int i = 0, bit = 1; i < 4; ++i, bit <<= 1)
for (S32 i = 0, bit = 1; i < 4; ++i, bit <<= 1)
if ((all_bits & bit) && y[i] == w)
return true;
return false;
@ -256,7 +256,7 @@ void GjkCollisionState::getClosestPoints(Point3F& p1, Point3F& p2)
F32 sum = 0;
p1.set(0, 0, 0);
p2.set(0, 0, 0);
for (int i = 0, bit = 1; i < 4; ++i, bit <<= 1) {
for (S32 i = 0, bit = 1; i < 4; ++i, bit <<= 1) {
if (bits & bit) {
sum += det[bits][i];
p1 += p[i] * det[bits][i];

View file

@ -58,8 +58,8 @@ struct GjkCollisionState: public CollisionState
///
void compute_det();
bool valid(int s);
void compute_vector(int bits, VectorF& v);
bool valid(S32 s);
void compute_vector(S32 bits, VectorF& v);
bool closest(VectorF& v);
bool degenerate(const VectorF& w);
void nextBit();

View file

@ -280,7 +280,7 @@ bool Polytope::intersect(const PlaneF& plane,const Point3F& sp,const Point3F& ep
//----------------------------------------------------------------------------
void Polytope::extrudeFace(int faceIdx,const VectorF& vec,Polytope* out)
void Polytope::extrudeFace(S32 faceIdx,const VectorF& vec,Polytope* out)
{
// Assumes the face belongs to the first volume.
out->mVertexList.clear();
@ -373,7 +373,7 @@ bool Polytope::findCollision(const VectorF& vec,Polytope::Collision *best)
return false;
if (!best->object)
best->distance = 1.0E30f;
int bestVertex = -1;
S32 bestVertex = -1;
Polytope::Volume* bestVolume = NULL;
sideCount++;

View file

@ -102,7 +102,7 @@ public:
void buildBox(const MatrixF& transform,const Box3F& box);
void intersect(SimObject*, const BSPNode* node);
inline bool didIntersect() { return mVolumeList.size() > 1; }
void extrudeFace(int fi,const VectorF& vec,Polytope* out);
void extrudeFace(S32 fi,const VectorF& vec,Polytope* out);
bool findCollision(const VectorF& vec,Polytope::Collision *best);
};

View file

@ -139,7 +139,7 @@ const char *DynamicConsoleMethodComponent::_callMethod( U32 argc, const char *ar
if( getComponentCount() > 0 )
{
lockComponentList();
for( int i = getComponentCount() - 1; i >= 0; i-- )
for( S32 i = getComponentCount() - 1; i >= 0; i-- )
//for( SimComponentIterator nItr = componentList.end(); nItr != componentList.begin(); nItr-- )
{
argv[0] = cbName;

View file

@ -348,7 +348,7 @@ bool SimXMLDocument::pushFirstChildElement(const char* rName)
TiXmlElement* pElement;
if(!m_paNode.empty())
{
const int iLastElement = m_paNode.size() - 1;
const S32 iLastElement = m_paNode.size() - 1;
TiXmlElement* pNode = m_paNode[iLastElement];
if(!pNode)
{
@ -412,7 +412,7 @@ bool SimXMLDocument::pushChildElement(S32 index)
TiXmlElement* pElement;
if(!m_paNode.empty())
{
const int iLastElement = m_paNode.size() - 1;
const S32 iLastElement = m_paNode.size() - 1;
TiXmlElement* pNode = m_paNode[iLastElement];
if(!pNode)
{
@ -472,7 +472,7 @@ bool SimXMLDocument::nextSiblingElement(const char* rName)
{
return false;
}
const int iLastElement = m_paNode.size() - 1;
const S32 iLastElement = m_paNode.size() - 1;
TiXmlElement*& pElement = m_paNode[iLastElement];
if(!pElement)
{
@ -506,7 +506,7 @@ const char* SimXMLDocument::elementValue()
{
return StringTable->insert("");
}
const int iLastElement = m_paNode.size() - 1;
const S32 iLastElement = m_paNode.size() - 1;
TiXmlElement* pNode = m_paNode[iLastElement];
if(!pNode)
{
@ -547,7 +547,7 @@ const char* SimXMLDocument::attribute(const char* rAttribute)
{
return StringTable->insert("");
}
const int iLastElement = m_paNode.size() - 1;
const S32 iLastElement = m_paNode.size() - 1;
TiXmlElement* pNode = m_paNode[iLastElement];
if(!pNode)
{
@ -597,7 +597,7 @@ bool SimXMLDocument::attributeExists(const char* rAttribute)
{
return false;
}
const int iLastElement = m_paNode.size() - 1;
const S32 iLastElement = m_paNode.size() - 1;
TiXmlElement* pNode = m_paNode[iLastElement];
if(!pNode)
{
@ -630,7 +630,7 @@ const char* SimXMLDocument::firstAttribute()
{
return StringTable->insert("");
}
const int iLastElement = m_paNode.size() - 1;
const S32 iLastElement = m_paNode.size() - 1;
TiXmlElement* pNode = m_paNode[iLastElement];
if(!pNode)
{
@ -667,7 +667,7 @@ const char* SimXMLDocument::lastAttribute()
{
return StringTable->insert("");
}
const int iLastElement = m_paNode.size() - 1;
const S32 iLastElement = m_paNode.size() - 1;
TiXmlElement* pNode = m_paNode[iLastElement];
if(!pNode)
{
@ -766,7 +766,7 @@ void SimXMLDocument::setAttribute(const char* rAttribute, const char* rVal)
return;
}
const int iLastElement = m_paNode.size() - 1;
const S32 iLastElement = m_paNode.size() - 1;
TiXmlElement* pElement = m_paNode[iLastElement];
if(!pElement)
{
@ -798,7 +798,7 @@ void SimXMLDocument::setObjectAttributes(const char* objectID)
if( pObject == NULL )
return;
const int iLastElement = m_paNode.size() - 1;
const S32 iLastElement = m_paNode.size() - 1;
TiXmlElement* pElement = m_paNode[iLastElement];
if(!pElement)
return;
@ -925,7 +925,7 @@ void SimXMLDocument::pushNewElement(const char* rName)
}
else
{
const int iFinalElement = m_paNode.size() - 1;
const S32 iFinalElement = m_paNode.size() - 1;
TiXmlElement* pNode = m_paNode[iFinalElement];
if(!pNode)
{
@ -975,7 +975,7 @@ void SimXMLDocument::addNewElement(const char* rName)
return;
}
const int iParentElement = m_paNode.size() - 2;
const S32 iParentElement = m_paNode.size() - 2;
if(iParentElement < 0)
{
pStackTop = dynamic_cast<TiXmlElement*>
@ -1002,7 +1002,7 @@ void SimXMLDocument::addNewElement(const char* rName)
}
// Overwrite top stack position.
const int iFinalElement = m_paNode.size() - 1;
const S32 iFinalElement = m_paNode.size() - 1;
m_paNode[iFinalElement] = pStackTop;
//pNode = pStackTop;
}
@ -1091,7 +1091,7 @@ const char* SimXMLDocument::readComment( S32 index )
// Push the first element found under the current element of the given name
if(!m_paNode.empty())
{
const int iLastElement = m_paNode.size() - 1;
const S32 iLastElement = m_paNode.size() - 1;
TiXmlElement* pNode = m_paNode[iLastElement];
if(!pNode)
{
@ -1159,7 +1159,7 @@ void SimXMLDocument::addText(const char* text)
if(m_paNode.empty())
return;
const int iFinalElement = m_paNode.size() - 1;
const S32 iFinalElement = m_paNode.size() - 1;
TiXmlElement* pNode = m_paNode[iFinalElement];
if(!pNode)
return;
@ -1204,7 +1204,7 @@ const char* SimXMLDocument::getText()
if(m_paNode.empty())
return "";
const int iFinalElement = m_paNode.size() - 1;
const S32 iFinalElement = m_paNode.size() - 1;
TiXmlNode* pNode = m_paNode[iFinalElement];
if(!pNode)
return "";
@ -1264,7 +1264,7 @@ void SimXMLDocument::removeText()
if(m_paNode.empty())
return;
const int iFinalElement = m_paNode.size() - 1;
const S32 iFinalElement = m_paNode.size() - 1;
TiXmlElement* pNode = m_paNode[iFinalElement];
if(!pNode)
return;
@ -1300,7 +1300,7 @@ void SimXMLDocument::addData(const char* text)
if(m_paNode.empty())
return;
const int iFinalElement = m_paNode.size() - 1;
const S32 iFinalElement = m_paNode.size() - 1;
TiXmlElement* pNode = m_paNode[iFinalElement];
if(!pNode)
return;
@ -1346,7 +1346,7 @@ const char* SimXMLDocument::getData()
if(m_paNode.empty())
return "";
const int iFinalElement = m_paNode.size() - 1;
const S32 iFinalElement = m_paNode.size() - 1;
TiXmlNode* pNode = m_paNode[iFinalElement];
if(!pNode)
return "";

View file

@ -250,8 +250,8 @@ struct StreqExprNode : BinaryExprNode
struct StrcatExprNode : BinaryExprNode
{
int appendChar;
static StrcatExprNode *alloc( S32 lineNumber, ExprNode *left, ExprNode *right, int appendChar );
S32 appendChar;
static StrcatExprNode *alloc( S32 lineNumber, ExprNode *left, ExprNode *right, S32 appendChar );
U32 precompile(TypeReq type);
U32 compile(U32 *codeStream, U32 ip, TypeReq type);
TypeReq getPreferredType();

View file

@ -149,7 +149,7 @@ StreqExprNode *StreqExprNode::alloc( S32 lineNumber, ExprNode *left, ExprNode *r
return ret;
}
StrcatExprNode *StrcatExprNode::alloc( S32 lineNumber, ExprNode *left, ExprNode *right, int appendChar )
StrcatExprNode *StrcatExprNode::alloc( S32 lineNumber, ExprNode *left, ExprNode *right, S32 appendChar )
{
StrcatExprNode *ret = (StrcatExprNode *) consoleAlloc(sizeof(StrcatExprNode));
constructInPlace(ret);

View file

@ -559,7 +559,7 @@ bool CodeBlock::compile(const char *codeFileName, StringTableEntry fileName, con
}
const char *CodeBlock::compileExec(StringTableEntry fileName, const char *inString, bool noCalls, int setFrame)
const char *CodeBlock::compileExec(StringTableEntry fileName, const char *inString, bool noCalls, S32 setFrame)
{
// Check for a UTF8 script file
char *string;

View file

@ -129,7 +129,7 @@ public:
/// -1 a new frame is created. If the index is out of range the
/// top stack frame is used.
const char *compileExec(StringTableEntry fileName, const char *script,
bool noCalls, int setFrame = -1 );
bool noCalls, S32 setFrame = -1 );
/// Executes the existing code in the CodeBlock. The return string is any
/// result of the code executed, if any, or an empty string.

View file

@ -248,7 +248,7 @@ static bool active = false;
static bool newLogFile;
static const char *logFileName;
static const int MaxCompletionBufferSize = 4096;
static const S32 MaxCompletionBufferSize = 4096;
static char completionBuffer[MaxCompletionBufferSize];
static char tabBuffer[MaxCompletionBufferSize] = {0};
static SimObjectPtr<SimObject> tabObject;

View file

@ -223,7 +223,7 @@ void Namespace::printNamespaceEntries(Namespace * g, bool dumpScript, bool dumpE
// Iterate through the methods of the namespace...
for(Entry *ewalk = g->mEntryList; ewalk; ewalk = ewalk->mNext)
{
int eType = ewalk->mType;
S32 eType = ewalk->mType;
const char * funcName = ewalk->mFunctionName;
if( ( eType == Entry::ConsoleFunctionType ) && !dumpScript )

View file

@ -259,7 +259,7 @@ DefineConsoleFunction( strstr, S32, ( const char* string, const char* substring
//-----------------------------------------------------------------------------
DefineConsoleFunction( strpos, S32, ( const char* haystack, const char* needle, int offset ), ( 0 ),
DefineConsoleFunction( strpos, S32, ( const char* haystack, const char* needle, S32 offset ), ( 0 ),
"Find the start of @a needle in @a haystack searching from left to right beginning at the given offset.\n"
"@param haystack The string to search.\n"
"@param needle The string to search for.\n"

View file

@ -175,7 +175,7 @@ bool ConsoleLogger::detach()
mStream.close();
// Remove this object from the list of active loggers
for( int i = 0; i < mActiveLoggers.size(); i++ )
for( S32 i = 0; i < mActiveLoggers.size(); i++ )
{
if( mActiveLoggers[i] == this )
{

View file

@ -255,7 +255,7 @@ namespace Con {
mXML->pushNewElement("EnumTables");
// write out the used EnumTables
for (int i = 0; i < enumTables.size(); i++)
for (S32 i = 0; i < enumTables.size(); i++)
{
mXML->pushNewElement("EnumTable");
@ -267,7 +267,7 @@ namespace Con {
mXML->pushNewElement("Enums");
for (int j = 0; j < table->size; j++)
for (S32 j = 0; j < table->size; j++)
{
mXML->pushNewElement("Enum");

View file

@ -1383,14 +1383,14 @@ struct _EngineConsoleThunkCountArgs
// Encapsulation of a legacy console function invocation.
template< int startArgc, typename T >
template< S32 startArgc, typename T >
struct _EngineConsoleThunk {};
template< int startArgc, typename R >
template< S32 startArgc, typename R >
struct _EngineConsoleThunk< startArgc, R() >
{
typedef typename _EngineConsoleThunkType< R >::ReturnType ReturnType;
static const int NUM_ARGS = 0;
static const S32 NUM_ARGS = 0;
static ReturnType thunk( S32 argc, const char** argv, R ( *fn )(), const _EngineFunctionDefaultArguments< void() >& )
{
return _EngineConsoleThunkReturnValue( fn() );
@ -1401,11 +1401,11 @@ struct _EngineConsoleThunk< startArgc, R() >
return _EngineConsoleThunkReturnValue( ( frame->*fn )() );
}
};
template< int startArgc >
template< S32 startArgc >
struct _EngineConsoleThunk< startArgc, void() >
{
typedef void ReturnType;
static const int NUM_ARGS = 0;
static const S32 NUM_ARGS = 0;
static void thunk( S32 argc, const char** argv, void ( *fn )(), const _EngineFunctionDefaultArguments< void() >& )
{
fn();
@ -1417,11 +1417,11 @@ struct _EngineConsoleThunk< startArgc, void() >
}
};
template< int startArgc, typename R, typename A >
template< S32 startArgc, typename R, typename A >
struct _EngineConsoleThunk< startArgc, R( A ) >
{
typedef typename _EngineConsoleThunkType< R >::ReturnType ReturnType;
static const int NUM_ARGS = 1 + startArgc;
static const S32 NUM_ARGS = 1 + startArgc;
static ReturnType thunk( S32 argc, const char** argv, R ( *fn )( A ), const _EngineFunctionDefaultArguments< void( A ) >& defaultArgs )
{
A a = ( startArgc < argc ? EngineUnmarshallData< A >()( argv[ startArgc ] ) : A( defaultArgs.a ) );
@ -1434,11 +1434,11 @@ struct _EngineConsoleThunk< startArgc, R( A ) >
return _EngineConsoleThunkReturnValue( ( frame->*fn )( a ) );
}
};
template< int startArgc, typename A >
template< S32 startArgc, typename A >
struct _EngineConsoleThunk< startArgc, void( A ) >
{
typedef void ReturnType;
static const int NUM_ARGS = 1 + startArgc;
static const S32 NUM_ARGS = 1 + startArgc;
static void thunk( S32 argc, const char** argv, void ( *fn )( A ), const _EngineFunctionDefaultArguments< void( A ) >& defaultArgs )
{
A a = ( startArgc < argc ? EngineUnmarshallData< A >()( argv[ startArgc ] ) : A( defaultArgs.a ) );
@ -1452,11 +1452,11 @@ struct _EngineConsoleThunk< startArgc, void( A ) >
}
};
template< int startArgc, typename R, typename A, typename B >
template< S32 startArgc, typename R, typename A, typename B >
struct _EngineConsoleThunk< startArgc, R( A, B ) >
{
typedef typename _EngineConsoleThunkType< R >::ReturnType ReturnType;
static const int NUM_ARGS = 2 + startArgc;
static const S32 NUM_ARGS = 2 + startArgc;
static ReturnType thunk( S32 argc, const char** argv, R ( *fn )( A, B ), const _EngineFunctionDefaultArguments< void( A, B ) >& defaultArgs )
{
A a = ( startArgc < argc ? EngineUnmarshallData< A >()( argv[ startArgc ] ) : A( defaultArgs.a ) );
@ -1471,11 +1471,11 @@ struct _EngineConsoleThunk< startArgc, R( A, B ) >
return _EngineConsoleThunkReturnValue( ( frame->*fn )( a, b ) );
}
};
template< int startArgc, typename A, typename B >
template< S32 startArgc, typename A, typename B >
struct _EngineConsoleThunk< startArgc, void( A, B ) >
{
typedef void ReturnType;
static const int NUM_ARGS = 2 + startArgc;
static const S32 NUM_ARGS = 2 + startArgc;
static void thunk( S32 argc, const char** argv, void ( *fn )( A, B ), const _EngineFunctionDefaultArguments< void( A, B ) >& defaultArgs )
{
A a = ( startArgc < argc ? EngineUnmarshallData< A >()( argv[ startArgc ] ) : A( defaultArgs.a ) );
@ -1491,11 +1491,11 @@ struct _EngineConsoleThunk< startArgc, void( A, B ) >
}
};
template< int startArgc, typename R, typename A, typename B, typename C >
template< S32 startArgc, typename R, typename A, typename B, typename C >
struct _EngineConsoleThunk< startArgc, R( A, B, C ) >
{
typedef typename _EngineConsoleThunkType< R >::ReturnType ReturnType;
static const int NUM_ARGS = 3 + startArgc;
static const S32 NUM_ARGS = 3 + startArgc;
static ReturnType thunk( S32 argc, const char** argv, R ( *fn )( A, B, C ), const _EngineFunctionDefaultArguments< void( A, B, C ) >& defaultArgs )
{
A a = ( startArgc < argc ? EngineUnmarshallData< A >()( argv[ startArgc ] ) : A( defaultArgs.a ) );
@ -1512,11 +1512,11 @@ struct _EngineConsoleThunk< startArgc, R( A, B, C ) >
return _EngineConsoleThunkReturnValue( ( frame->*fn )( a, b, c ) );
}
};
template< int startArgc, typename A, typename B, typename C >
template< S32 startArgc, typename A, typename B, typename C >
struct _EngineConsoleThunk< startArgc, void( A, B, C ) >
{
typedef void ReturnType;
static const int NUM_ARGS = 3 + startArgc;
static const S32 NUM_ARGS = 3 + startArgc;
static void thunk( S32 argc, const char** argv, void ( *fn )( A, B, C ), const _EngineFunctionDefaultArguments< void( A, B, C ) >& defaultArgs )
{
A a = ( startArgc < argc ? EngineUnmarshallData< A >()( argv[ startArgc ] ) : A( defaultArgs.a ) );
@ -1534,11 +1534,11 @@ struct _EngineConsoleThunk< startArgc, void( A, B, C ) >
}
};
template< int startArgc, typename R, typename A, typename B, typename C, typename D >
template< S32 startArgc, typename R, typename A, typename B, typename C, typename D >
struct _EngineConsoleThunk< startArgc, R( A, B, C, D ) >
{
typedef typename _EngineConsoleThunkType< R >::ReturnType ReturnType;
static const int NUM_ARGS = 4 + startArgc;
static const S32 NUM_ARGS = 4 + startArgc;
static ReturnType thunk( S32 argc, const char** argv, R ( *fn )( A, B, C, D ), const _EngineFunctionDefaultArguments< void( A, B, C, D ) >& defaultArgs )
{
A a = ( startArgc < argc ? EngineUnmarshallData< A >()( argv[ startArgc ] ) : A( defaultArgs.a ) );
@ -1557,11 +1557,11 @@ struct _EngineConsoleThunk< startArgc, R( A, B, C, D ) >
return _EngineConsoleThunkReturnValue( ( frame->*fn )( a, b, c, d ) );
}
};
template< int startArgc, typename A, typename B, typename C, typename D >
template< S32 startArgc, typename A, typename B, typename C, typename D >
struct _EngineConsoleThunk< startArgc, void( A, B, C, D ) >
{
typedef void ReturnType;
static const int NUM_ARGS = 4 + startArgc;
static const S32 NUM_ARGS = 4 + startArgc;
static void thunk( S32 argc, const char** argv, void ( *fn )( A, B, C, D ), const _EngineFunctionDefaultArguments< void( A, B, C, D ) >& defaultArgs )
{
A a = ( startArgc < argc ? EngineUnmarshallData< A >()( argv[ startArgc ] ) : A( defaultArgs.a ) );
@ -1581,11 +1581,11 @@ struct _EngineConsoleThunk< startArgc, void( A, B, C, D ) >
}
};
template< int startArgc, typename R, typename A, typename B, typename C, typename D, typename E >
template< S32 startArgc, typename R, typename A, typename B, typename C, typename D, typename E >
struct _EngineConsoleThunk< startArgc, R( A, B, C, D, E ) >
{
typedef typename _EngineConsoleThunkType< R >::ReturnType ReturnType;
static const int NUM_ARGS = 5 + startArgc;
static const S32 NUM_ARGS = 5 + startArgc;
static ReturnType thunk( S32 argc, const char** argv, R ( *fn )( A, B, C, D, E ), const _EngineFunctionDefaultArguments< void( A, B, C, D, E ) >& defaultArgs )
{
A a = ( startArgc < argc ? EngineUnmarshallData< A >()( argv[ startArgc ] ) : A( defaultArgs.a ) );
@ -1606,11 +1606,11 @@ struct _EngineConsoleThunk< startArgc, R( A, B, C, D, E ) >
return _EngineConsoleThunkReturnValue( ( frame->*fn )( a, b, c, d, e ) );
}
};
template< int startArgc, typename A, typename B, typename C, typename D, typename E >
template< S32 startArgc, typename A, typename B, typename C, typename D, typename E >
struct _EngineConsoleThunk< startArgc, void( A, B, C, D, E ) >
{
typedef void ReturnType;
static const int NUM_ARGS = 5 + startArgc;
static const S32 NUM_ARGS = 5 + startArgc;
static void thunk( S32 argc, const char** argv, void ( *fn )( A, B, C, D, E ), const _EngineFunctionDefaultArguments< void( A, B, C, D, E ) >& defaultArgs )
{
A a = ( startArgc < argc ? EngineUnmarshallData< A >()( argv[ startArgc ] ) : A( defaultArgs.a ) );
@ -1632,11 +1632,11 @@ struct _EngineConsoleThunk< startArgc, void( A, B, C, D, E ) >
}
};
template< int startArgc, typename R, typename A, typename B, typename C, typename D, typename E, typename F >
template< S32 startArgc, typename R, typename A, typename B, typename C, typename D, typename E, typename F >
struct _EngineConsoleThunk< startArgc, R( A, B, C, D, E, F ) >
{
typedef typename _EngineConsoleThunkType< R >::ReturnType ReturnType;
static const int NUM_ARGS = 6 + startArgc;
static const S32 NUM_ARGS = 6 + startArgc;
static ReturnType thunk( S32 argc, const char** argv, R ( *fn )( A, B, C, D, E, F ), const _EngineFunctionDefaultArguments< void( A, B, C, D, E, F ) >& defaultArgs )
{
A a = ( startArgc < argc ? EngineUnmarshallData< A >()( argv[ startArgc ] ) : A( defaultArgs.a ) );
@ -1659,11 +1659,11 @@ struct _EngineConsoleThunk< startArgc, R( A, B, C, D, E, F ) >
return _EngineConsoleThunkReturnValue( ( frame->*fn )( a, b, c, d, e, f ) );
}
};
template< int startArgc, typename A, typename B, typename C, typename D, typename E, typename F >
template< S32 startArgc, typename A, typename B, typename C, typename D, typename E, typename F >
struct _EngineConsoleThunk< startArgc, void( A, B, C, D, E, F ) >
{
typedef void ReturnType;
static const int NUM_ARGS = 6 + startArgc;
static const S32 NUM_ARGS = 6 + startArgc;
static void thunk( S32 argc, const char** argv, void ( *fn )( A, B, C, D, E, F ), const _EngineFunctionDefaultArguments< void( A, B, C, D, E, F ) >& defaultArgs )
{
A a = ( startArgc < argc ? EngineUnmarshallData< A >()( argv[ startArgc ] ) : A( defaultArgs.a ) );
@ -1687,11 +1687,11 @@ struct _EngineConsoleThunk< startArgc, void( A, B, C, D, E, F ) >
}
};
template< int startArgc, typename R, typename A, typename B, typename C, typename D, typename E, typename F, typename G >
template< S32 startArgc, typename R, typename A, typename B, typename C, typename D, typename E, typename F, typename G >
struct _EngineConsoleThunk< startArgc, R( A, B, C, D, E, F, G ) >
{
typedef typename _EngineConsoleThunkType< R >::ReturnType ReturnType;
static const int NUM_ARGS = 7 + startArgc;
static const S32 NUM_ARGS = 7 + startArgc;
static ReturnType thunk( S32 argc, const char** argv, R ( *fn )( A, B, C, D, E, F, G ), const _EngineFunctionDefaultArguments< void( A, B, C, D, E, F, G ) >& defaultArgs )
{
A a = ( startArgc < argc ? EngineUnmarshallData< A >()( argv[ startArgc ] ) : A( defaultArgs.a ) );
@ -1716,11 +1716,11 @@ struct _EngineConsoleThunk< startArgc, R( A, B, C, D, E, F, G ) >
return _EngineConsoleThunkReturnValue( ( frame->*fn )( a, b, c, d, e, f, g ) );
}
};
template< int startArgc, typename A, typename B, typename C, typename D, typename E, typename F, typename G >
template< S32 startArgc, typename A, typename B, typename C, typename D, typename E, typename F, typename G >
struct _EngineConsoleThunk< startArgc, void( A, B, C, D, E, F, G ) >
{
typedef void ReturnType;
static const int NUM_ARGS = 7 + startArgc;
static const S32 NUM_ARGS = 7 + startArgc;
static void thunk( S32 argc, const char** argv, void ( *fn )( A, B, C, D, E, F, G ), const _EngineFunctionDefaultArguments< void( A, B, C, D, E, F, G ) >& defaultArgs )
{
A a = ( startArgc < argc ? EngineUnmarshallData< A >()( argv[ startArgc ] ) : A( defaultArgs.a ) );
@ -1746,11 +1746,11 @@ struct _EngineConsoleThunk< startArgc, void( A, B, C, D, E, F, G ) >
}
};
template< int startArgc, typename R, typename A, typename B, typename C, typename D, typename E, typename F, typename G, typename H >
template< S32 startArgc, typename R, typename A, typename B, typename C, typename D, typename E, typename F, typename G, typename H >
struct _EngineConsoleThunk< startArgc, R( A, B, C, D, E, F, G, H ) >
{
typedef typename _EngineConsoleThunkType< R >::ReturnType ReturnType;
static const int NUM_ARGS = 8 + startArgc;
static const S32 NUM_ARGS = 8 + startArgc;
static ReturnType thunk( S32 argc, const char** argv, R ( *fn )( A, B, C, D, E, F, G, H ), const _EngineFunctionDefaultArguments< void( A, B, C, D, E, F, G, H ) >& defaultArgs )
{
A a = ( startArgc < argc ? EngineUnmarshallData< A >()( argv[ startArgc ] ) : A( defaultArgs.a ) );
@ -1777,11 +1777,11 @@ struct _EngineConsoleThunk< startArgc, R( A, B, C, D, E, F, G, H ) >
return _EngineConsoleThunkReturnValue( ( frame->*fn )( a, b, c, d, e, f, g, h ) );
}
};
template< int startArgc, typename A, typename B, typename C, typename D, typename E, typename F, typename G, typename H >
template< S32 startArgc, typename A, typename B, typename C, typename D, typename E, typename F, typename G, typename H >
struct _EngineConsoleThunk< startArgc, void( A, B, C, D, E, F, G, H ) >
{
typedef void ReturnType;
static const int NUM_ARGS = 8 + startArgc;
static const S32 NUM_ARGS = 8 + startArgc;
static void thunk( S32 argc, const char** argv, void ( *fn )( A, B, C, D, E, F, G, H ), const _EngineFunctionDefaultArguments< void( A, B, C, D, E, F, G, H ) >& defaultArgs )
{
A a = ( startArgc < argc ? EngineUnmarshallData< A >()( argv[ startArgc ] ) : A( defaultArgs.a ) );
@ -1809,11 +1809,11 @@ struct _EngineConsoleThunk< startArgc, void( A, B, C, D, E, F, G, H ) >
}
};
template< int startArgc, typename R, typename A, typename B, typename C, typename D, typename E, typename F, typename G, typename H, typename I >
template< S32 startArgc, typename R, typename A, typename B, typename C, typename D, typename E, typename F, typename G, typename H, typename I >
struct _EngineConsoleThunk< startArgc, R( A, B, C, D, E, F, G, H, I ) >
{
typedef typename _EngineConsoleThunkType< R >::ReturnType ReturnType;
static const int NUM_ARGS = 9 + startArgc;
static const S32 NUM_ARGS = 9 + startArgc;
static ReturnType thunk( S32 argc, const char** argv, R ( *fn )( A, B, C, D, E, F, G, H, I ), const _EngineFunctionDefaultArguments< void( A, B, C, D, E, F, G, H, I ) >& defaultArgs )
{
A a = ( startArgc < argc ? EngineUnmarshallData< A >()( argv[ startArgc ] ) : A( defaultArgs.a ) );
@ -1842,11 +1842,11 @@ struct _EngineConsoleThunk< startArgc, R( A, B, C, D, E, F, G, H, I ) >
return _EngineConsoleThunkReturnValue( ( frame->*fn )( a, b, c, d, e, f, g, h, i ) );
}
};
template< int startArgc, typename A, typename B, typename C, typename D, typename E, typename F, typename G, typename H, typename I >
template< S32 startArgc, typename A, typename B, typename C, typename D, typename E, typename F, typename G, typename H, typename I >
struct _EngineConsoleThunk< startArgc, void( A, B, C, D, E, F, G, H, I ) >
{
typedef void ReturnType;
static const int NUM_ARGS = 9 + startArgc;
static const S32 NUM_ARGS = 9 + startArgc;
static void thunk( S32 argc, const char** argv, void ( *fn )( A, B, C, D, E, F, G, H, I ), const _EngineFunctionDefaultArguments< void( A, B, C, D, E, F, G, H, I ) >& defaultArgs )
{
A a = ( startArgc < argc ? EngineUnmarshallData< A >()( argv[ startArgc ] ) : A( defaultArgs.a ) );
@ -1876,11 +1876,11 @@ struct _EngineConsoleThunk< startArgc, void( A, B, C, D, E, F, G, H, I ) >
}
};
template< int startArgc, typename R, typename A, typename B, typename C, typename D, typename E, typename F, typename G, typename H, typename I, typename J >
template< S32 startArgc, typename R, typename A, typename B, typename C, typename D, typename E, typename F, typename G, typename H, typename I, typename J >
struct _EngineConsoleThunk< startArgc, R( A, B, C, D, E, F, G, H, I, J ) >
{
typedef typename _EngineConsoleThunkType< R >::ReturnType ReturnType;
static const int NUM_ARGS = 10 + startArgc;
static const S32 NUM_ARGS = 10 + startArgc;
static ReturnType thunk( S32 argc, const char** argv, R ( *fn )( A, B, C, D, E, F, G, H, I, J ), const _EngineFunctionDefaultArguments< void( A, B, C, D, E, F, G, H, I, J ) >& defaultArgs )
{
A a = ( startArgc < argc ? EngineUnmarshallData< A >()( argv[ startArgc ] ) : A( defaultArgs.a ) );
@ -1911,11 +1911,11 @@ struct _EngineConsoleThunk< startArgc, R( A, B, C, D, E, F, G, H, I, J ) >
return _EngineConsoleThunkReturnValue( ( frame->*fn )( a, b, c, d, e, f, g, h, i, j ) );
}
};
template< int startArgc, typename A, typename B, typename C, typename D, typename E, typename F, typename G, typename H, typename I, typename J >
template< S32 startArgc, typename A, typename B, typename C, typename D, typename E, typename F, typename G, typename H, typename I, typename J >
struct _EngineConsoleThunk< startArgc, void( A, B, C, D, E, F, G, H, I, J ) >
{
typedef void ReturnType;
static const int NUM_ARGS = 10 + startArgc;
static const S32 NUM_ARGS = 10 + startArgc;
static void thunk( S32 argc, const char** argv, void ( *fn )( A, B, C, D, E, F, G, H, I, J ), const _EngineFunctionDefaultArguments< void( A, B, C, D, E, F, G, H, I, J ) >& defaultArgs )
{
A a = ( startArgc < argc ? EngineUnmarshallData< A >()( argv[ startArgc ] ) : A( defaultArgs.a ) );
@ -1946,11 +1946,11 @@ struct _EngineConsoleThunk< startArgc, void( A, B, C, D, E, F, G, H, I, J ) >
( frame->*fn )( a, b, c, d, e, f, g, h, i, j );
}
};
template< int startArgc, typename R, typename A, typename B, typename C, typename D, typename E, typename F, typename G, typename H, typename I, typename J, typename K >
template< S32 startArgc, typename R, typename A, typename B, typename C, typename D, typename E, typename F, typename G, typename H, typename I, typename J, typename K >
struct _EngineConsoleThunk< startArgc, R( A, B, C, D, E, F, G, H, I, J, K ) >
{
typedef typename _EngineConsoleThunkType< R >::ReturnType ReturnType;
static const int NUM_ARGS = 11 + startArgc;
static const S32 NUM_ARGS = 11 + startArgc;
static ReturnType thunk( S32 argc, const char** argv, R ( *fn )( A, B, C, D, E, F, G, H, I, J, K ), const _EngineFunctionDefaultArguments< void( A, B, C, D, E, F, G, H, I, J, K ) >& defaultArgs )
{
A a = ( startArgc < argc ? EngineUnmarshallData< A >()( argv[ startArgc ] ) : A( defaultArgs.a ) );
@ -1983,11 +1983,11 @@ struct _EngineConsoleThunk< startArgc, R( A, B, C, D, E, F, G, H, I, J, K ) >
return _EngineConsoleThunkReturnValue( ( frame->*fn )( a, b, c, d, e, f, g, h, i, j, k ) );
}
};
template< int startArgc, typename A, typename B, typename C, typename D, typename E, typename F, typename G, typename H, typename I, typename J, typename K >
template< S32 startArgc, typename A, typename B, typename C, typename D, typename E, typename F, typename G, typename H, typename I, typename J, typename K >
struct _EngineConsoleThunk< startArgc, void( A, B, C, D, E, F, G, H, I, J, K ) >
{
typedef void ReturnType;
static const int NUM_ARGS = 11 + startArgc;
static const S32 NUM_ARGS = 11 + startArgc;
static void thunk( S32 argc, const char** argv, void ( *fn )( A, B, C, D, E, F, G, H, I, J, K ), const _EngineFunctionDefaultArguments< void( A, B, C, D, E, F, G, H, I, J, K ) >& defaultArgs )
{
A a = ( startArgc < argc ? EngineUnmarshallData< A >()( argv[ startArgc ] ) : A( defaultArgs.a ) );

View file

@ -307,7 +307,7 @@ static void dumpNamespaceEntries( Stream &stream, Namespace *g, bool callbacks =
// Go through all the entries in the namespace.
for ( Namespace::Entry *ewalk = g->mEntryList; ewalk; ewalk = ewalk->mNext )
{
int eType = ewalk->mType;
S32 eType = ewalk->mType;
// We do not dump script defined functions... only engine exports.
if( eType == Namespace::Entry::ConsoleFunctionType

View file

@ -2663,7 +2663,7 @@ DefineConsoleMethod( SimObject, getDynamicFieldCount, S32, (),,
//-----------------------------------------------------------------------------
DefineConsoleMethod( SimObject, getDynamicField, const char*, ( int index ),,
DefineConsoleMethod( SimObject, getDynamicField, const char*, ( S32 index ),,
"Get a value of a dynamic field by index.\n"
"@param index The index of the dynamic field.\n"
"@return The value of the dynamic field at the given index or \"\"." )
@ -2702,7 +2702,7 @@ DefineConsoleMethod( SimObject, getFieldCount, S32, (),,
const AbstractClassRep::Field* f;
U32 numDummyEntries = 0;
for(int i = 0; i < list.size(); i++)
for(S32 i = 0; i < list.size(); i++)
{
f = &list[i];
@ -2716,7 +2716,7 @@ DefineConsoleMethod( SimObject, getFieldCount, S32, (),,
//-----------------------------------------------------------------------------
DefineConsoleMethod( SimObject, getField, const char*, ( int index ),,
DefineConsoleMethod( SimObject, getField, const char*, ( S32 index ),,
"Retrieve the value of a static field by index.\n"
"@param index The index of the static field.\n"
"@return The value of the static field with the given index or \"\"." )

View file

@ -799,7 +799,7 @@ void BitRender::bitTo8Bit_3(U32 * bits, U32 * eightBits, S32 dim)
#if defined(TORQUE_BIG_ENDIAN)
#define MAX_SHADOW_TEXELS (256 + 4) //256 seems big enough, +4 so we can run off end of buffer.
// slow fake gaussian
int i, j, c;
S32 i, j, c;
U8 tmpLine[3][MAX_SHADOW_TEXELS];
U8 *src0, *src1, *src2;
U8 *s0, *s1, *s2;
@ -809,7 +809,7 @@ void BitRender::bitTo8Bit_3(U32 * bits, U32 * eightBits, S32 dim)
U32 currVal;
U32 sampleVal;
U8 c00, c01, c02, c10, c11, c12, c20, c21, c22;
int openBuf;
S32 openBuf;
src0 = tmpLine[0];
src1 = tmpLine[1];
@ -902,9 +902,9 @@ void BitRender::bitTo8Bit_3(U32 * bits, U32 * eightBits, S32 dim)
sampleVal = 0; //c12; // take end.
else // inner pixel
{
const int wXP = 3; // corners
const int wPP = 4; // plus/NSEW
const int wCP = 4; // center
const S32 wXP = 3; // corners
const S32 wPP = 4; // plus/NSEW
const S32 wCP = 4; // center
sampleVal = (c00+c02+c20+c22)*wXP + (c01+c10+c12+c21)*wPP + c11*wCP;
sampleVal >>= 5; // div by 32 subsamples
}

View file

@ -234,7 +234,7 @@ public:
mWaterMark = FrameAllocator::getWaterMark();
mMemory = reinterpret_cast<T *>( FrameAllocator::alloc( sizeof( T ) * count ) );
for( int i = 0; i < mNumObjectsInMemory; i++ )
for( S32 i = 0; i < mNumObjectsInMemory; i++ )
constructInPlace<T>( &mMemory[i] );
}
@ -242,7 +242,7 @@ public:
~FrameTemp()
{
// Call destructor
for( int i = 0; i < mNumObjectsInMemory; i++ )
for( S32 i = 0; i < mNumObjectsInMemory; i++ )
destructInPlace<T>( &mMemory[i] );
FrameAllocator::setWaterMark( mWaterMark );

View file

@ -55,7 +55,7 @@ bool OggDecoder::_readNextPacket( ogg_packet* packet )
while( 1 )
{
int result = ogg_stream_packetout( &mOggStreamState, packet );
S32 result = ogg_stream_packetout( &mOggStreamState, packet );
if( result == 0 )
{
if( !mOggStream->_requestData() )

View file

@ -169,7 +169,7 @@ bool OggTheoraDecoder::_init()
break;
}
int result = th_decode_headerin( &mTheoraInfo, &mTheoraComment, &mTheoraSetup, &nextPacket );
S32 result = th_decode_headerin( &mTheoraInfo, &mTheoraComment, &mTheoraSetup, &nextPacket );
if( result < 0 )
{
haveTheoraHeader = false;

View file

@ -89,7 +89,7 @@ bool OggVorbisDecoder::_init()
break;
}
int result = vorbis_synthesis_headerin( &mVorbisInfo, &mVorbisComment, &nextPacket );
S32 result = vorbis_synthesis_headerin( &mVorbisInfo, &mVorbisComment, &nextPacket );
if( result != 0 )
{
haveVorbisHeader = false;

View file

@ -438,7 +438,7 @@ void StringBufferManager::updateStats()
request8 = 0;
request16 = 0;
U32 nstrings = strings.size();
for(int i=0; i < nstrings; i++)
for(S32 i=0; i < nstrings; i++)
{
request8 += strings[i]->rc->requestCount8;
request16 += strings[i]->rc->requestCount16;
@ -459,7 +459,7 @@ void StringBufferManager::dumpAllStrings()
U32 nstrings = strings.size();
Con::printf("===== String Manager: All Strings =====");
Con::printf(" utf8 | utf16 | string");
for(int i=0; i < nstrings; i++)
for(S32 i=0; i < nstrings; i++)
{
UTF8* tmp = strings[i]->createCopy8();
strings[i]->rc->requestCount8--;

View file

@ -140,7 +140,7 @@ bool FindMatch::isMatch( const char *exp, const char *str, bool caseSensitive )
bool FindMatch::isMatchMultipleExprs( const char *exps, const char *str, bool caseSensitive )
{
char *tok = 0;
int len = dStrlen(exps);
S32 len = dStrlen(exps);
char *e = new char[len+1];
dStrcpy(e,exps);

View file

@ -97,10 +97,10 @@ nat_toupper( nat_char a )
static int
static S32
compare_right(const nat_char* a, const nat_char* b)
{
int bias = 0;
S32 bias = 0;
/* The longest run of digits wins. That aside, the greatest
value wins, but we can't know that it will until we've scanned
@ -149,11 +149,11 @@ compare_left(const nat_char* a, const nat_char* b)
}
static int strnatcmp0(const nat_char* a, const nat_char* b, int fold_case)
static S32 strnatcmp0(const nat_char* a, const nat_char* b, S32 fold_case)
{
int ai, bi;
S32 ai, bi;
nat_char ca, cb;
int fractional, result;
S32 fractional, result;
ai = bi = 0;
while (1) {
@ -200,13 +200,13 @@ static int strnatcmp0(const nat_char* a, const nat_char* b, int fold_case)
}
int dStrnatcmp(const nat_char* a, const nat_char* b) {
S32 dStrnatcmp(const nat_char* a, const nat_char* b) {
return strnatcmp0(a, b, 0);
}
/* Compare, recognizing numeric string and ignoring case. */
int dStrnatcasecmp(const nat_char* a, const nat_char* b) {
S32 dStrnatcasecmp(const nat_char* a, const nat_char* b) {
return strnatcmp0(a, b, 1);
}
@ -328,12 +328,12 @@ char* dStrcpyl(char *dst, dsize_t dstSize, ...)
}
int dStrcmp( const UTF16 *str1, const UTF16 *str2)
S32 dStrcmp( const UTF16 *str1, const UTF16 *str2)
{
#if defined(TORQUE_OS_WIN) || defined(TORQUE_OS_XBOX) || defined(TORQUE_OS_XENON)
return wcscmp( reinterpret_cast<const wchar_t *>( str1 ), reinterpret_cast<const wchar_t *>( str2 ) );
#else
int ret;
S32 ret;
const UTF16 *a, *b;
a = str1;
b = str2;

View file

@ -54,22 +54,22 @@ inline char *dStrncat(char *dst, const char *src, dsize_t len)
return strncat(dst,src,len);
}
inline int dStrcmp(const char *str1, const char *str2)
inline S32 dStrcmp(const char *str1, const char *str2)
{
return strcmp(str1, str2);
}
inline int dStrncmp(const char *str1, const char *str2, dsize_t len)
inline S32 dStrncmp(const char *str1, const char *str2, dsize_t len)
{
return strncmp(str1, str2, len);
}
inline int dStricmp(const char *str1, const char *str2)
inline S32 dStricmp(const char *str1, const char *str2)
{
return strcasecmp( str1, str2 );
}
inline int dStrnicmp(const char *str1, const char *str2, dsize_t len)
inline S32 dStrnicmp(const char *str1, const char *str2, dsize_t len)
{
return strncasecmp( str1, str2, len );
}
@ -89,22 +89,22 @@ inline dsize_t dStrlen(const char *str)
return strlen(str);
}
inline char *dStrchr(char *str, int c)
inline char *dStrchr(char *str, S32 c)
{
return strchr(str,c);
}
inline const char *dStrchr(const char *str, int c)
inline const char *dStrchr(const char *str, S32 c)
{
return strchr(str,c);
}
inline char *dStrrchr(char *str, int c)
inline char *dStrrchr(char *str, S32 c)
{
return strrchr(str,c);
}
inline const char *dStrrchr(const char *str, int c)
inline const char *dStrrchr(const char *str, S32 c)
{
return strrchr(str,c);
}
@ -200,9 +200,9 @@ extern char *dStrlwr(char *str);
extern char* dStrichr( char* str, char ch );
extern const char* dStrichr( const char* str, char ch );
extern int dStrcmp(const UTF16 *str1, const UTF16 *str2);
extern int dStrnatcmp( const char* str1, const char* str2 );
extern int dStrnatcasecmp( const char* str1, const char* str2 );
extern S32 dStrcmp(const UTF16 *str1, const UTF16 *str2);
extern S32 dStrnatcmp( const char* str1, const char* str2 );
extern S32 dStrnatcasecmp( const char* str1, const char* str2 );
inline bool dAtob(const char *str)
{
@ -221,9 +221,9 @@ char* dStripPath(const char* filename);
// standard I/O functions [defined in platformString.cpp]
extern void dPrintf(const char *format, ...);
extern int dVprintf(const char *format, void *arglist);
extern int dSprintf(char *buffer, U32 bufferSize, const char *format, ...);
extern int dVsprintf(char *buffer, U32 bufferSize, const char *format, void *arglist);
extern int dSscanf(const char *buffer, const char *format, ...);
extern S32 dVprintf(const char *format, void *arglist);
extern S32 dSprintf(char *buffer, U32 bufferSize, const char *format, ...);
extern S32 dVsprintf(char *buffer, U32 bufferSize, const char *format, void *arglist);
extern S32 dSscanf(const char *buffer, const char *format, ...);
#endif

View file

@ -311,7 +311,7 @@ UTF32 oneUTF8toUTF32( const UTF8* codepoint, U32 *unitsWalked)
U8 codeunit;
// check the first byte ( a.k.a. codeunit ) .
unsigned char c = codepoint[0];
U8 c = codepoint[0];
c = c >> 1;
expectedByteCount = sgFirstByteLUT[c];
if(expectedByteCount > 0) // 0 or negative is illegal to start with
@ -469,7 +469,7 @@ U32 oneUTF32toUTF8(const UTF32 codepoint, UTF8 *threeByteCodeunitBuf)
U8 marker = ( ~mask << 1); // 1000 0000
// Process the low order bytes, shifting the codepoint down 6 each pass.
for( int i = bytecount-1; i > 0; i--)
for( S32 i = bytecount-1; i > 0; i--)
{
threeByteCodeunitBuf[i] = marker | (working & mask);
working >>= 6;

View file

@ -308,7 +308,7 @@ bool TagDictionary::match(const char* pattern, const char* str)
//------------------------------------------------------------------------------
static int QSORT_CALLBACK idCompare(const void *in_p1, const void *in_p2)
static S32 QSORT_CALLBACK idCompare(const void *in_p1, const void *in_p2)
{
return *((S32 *) in_p1) - *((S32 *) in_p2);
}

View file

@ -103,7 +103,7 @@ TorqueThreadStaticListHandle _TorqueThreadStaticReg::spawnThreadStaticsInstance(
// Copy mThreadStaticInstances[0] (master copy) into new memory, and
// pass it back.
for( int i = 0; i < getThreadStaticListVector()[0].size(); i++ )
for( S32 i = 0; i < getThreadStaticListVector()[0].size(); i++ )
{
getThreadStaticListVector().last().push_back( getThreadStaticListVector()[0][i]->_createInstance() );
}

View file

@ -174,7 +174,7 @@ inline OutputClass horrible_cast(const InputClass input){
// Cause a compile-time error if in, out and u are not the same size.
// If the compile fails here, it means the compiler has peculiar
// unions which would prevent the cast from working.
typedef int ERROR_CantUseHorrible_cast[sizeof(InputClass)==sizeof(u)
typedef S32 ERROR_CantUseHorrible_cast[sizeof(InputClass)==sizeof(u)
&& sizeof(InputClass)==sizeof(OutputClass) ? 1 : -1];
u.in = input;
return u.out;
@ -270,7 +270,7 @@ struct VoidToDefaultVoid<void> { typedef DefaultVoid type; };
#endif
// The size of a single inheritance member function pointer.
const int SINGLE_MEMFUNCPTR_SIZE = sizeof(void (GenericClass::*)());
const S32 SINGLE_MEMFUNCPTR_SIZE = sizeof(void (GenericClass::*)());
// SimplifyMemFunc< >::Convert()
//
@ -284,7 +284,7 @@ const int SINGLE_MEMFUNCPTR_SIZE = sizeof(void (GenericClass::*)());
// template specialisation, I use full specialisation of a wrapper struct.
// general case -- don't know how to convert it. Force a compile failure
template <int N>
template <S32 N>
struct SimplifyMemFunc {
template <class X, class XFuncType, class GenericMemFuncType>
inline static GenericClass *Convert(X *pthis, XFuncType function_to_bind,
@ -344,11 +344,11 @@ struct SimplifyMemFunc< SINGLE_MEMFUNCPTR_SIZE + sizeof(int) > {
XFuncType func;
struct {
GenericMemFuncType funcaddress; // points to the actual member function
int delta; // #BYTES to be added to the 'this' pointer
S32 delta; // #BYTES to be added to the 'this' pointer
}s;
} u;
// Check that the horrible_cast will work
typedef int ERROR_CantUsehorrible_cast[sizeof(function_to_bind)==sizeof(u.s)? 1 : -1];
typedef S32 ERROR_CantUsehorrible_cast[sizeof(function_to_bind)==sizeof(u.s)? 1 : -1];
u.func = function_to_bind;
bound_func = u.s.funcaddress;
return reinterpret_cast<GenericClass *>(reinterpret_cast<char *>(pthis) + u.s.delta);
@ -367,8 +367,8 @@ struct SimplifyMemFunc< SINGLE_MEMFUNCPTR_SIZE + sizeof(int) > {
// is internally defined as:
struct MicrosoftVirtualMFP {
void (GenericClass::*codeptr)(); // points to the actual member function
int delta; // #bytes to be added to the 'this' pointer
int vtable_index; // or 0 if no virtual inheritance
S32 delta; // #bytes to be added to the 'this' pointer
S32 vtable_index; // or 0 if no virtual inheritance
};
// The CRUCIAL feature of Microsoft/Intel MFPs which we exploit is that the
// m_codeptr member is *always* called, regardless of the values of the other
@ -405,7 +405,7 @@ struct SimplifyMemFunc<SINGLE_MEMFUNCPTR_SIZE + 2*sizeof(int) >
MicrosoftVirtualMFP s;
} u2;
// Check that the horrible_cast<>s will work
typedef int ERROR_CantUsehorrible_cast[sizeof(function_to_bind)==sizeof(u.s)
typedef S32 ERROR_CantUsehorrible_cast[sizeof(function_to_bind)==sizeof(u.s)
&& sizeof(function_to_bind)==sizeof(u.ProbeFunc)
&& sizeof(u2.virtfunc)==sizeof(u2.s) ? 1 : -1];
// Unfortunately, taking the address of a MF prevents it from being inlined, so
@ -477,24 +477,24 @@ struct SimplifyMemFunc<SINGLE_MEMFUNCPTR_SIZE + 3*sizeof(int) >
// is internally defined as:
struct {
GenericMemFuncType m_funcaddress; // points to the actual member function
int delta; // #bytes to be added to the 'this' pointer
int vtordisp; // #bytes to add to 'this' to find the vtable
int vtable_index; // or 0 if no virtual inheritance
S32 delta; // #bytes to be added to the 'this' pointer
S32 vtordisp; // #bytes to add to 'this' to find the vtable
S32 vtable_index; // or 0 if no virtual inheritance
} s;
} u;
// Check that the horrible_cast will work
typedef int ERROR_CantUsehorrible_cast[sizeof(XFuncType)==sizeof(u.s)? 1 : -1];
typedef S32 ERROR_CantUsehorrible_cast[sizeof(XFuncType)==sizeof(u.s)? 1 : -1];
u.func = function_to_bind;
bound_func = u.s.funcaddress;
int virtual_delta = 0;
S32 virtual_delta = 0;
if (u.s.vtable_index) { // Virtual inheritance is used
// First, get to the vtable.
// It is 'vtordisp' bytes from the start of the class.
const int * vtable = *reinterpret_cast<const int *const*>(
const S32 * vtable = *reinterpret_cast<const S32 *const*>(
reinterpret_cast<const char *>(pthis) + u.s.vtordisp );
// 'vtable_index' tells us where in the table we should be looking.
virtual_delta = u.s.vtordisp + *reinterpret_cast<const int *>(
virtual_delta = u.s.vtordisp + *reinterpret_cast<const S32 *>(
reinterpret_cast<const char *>(vtable) + u.s.vtable_index);
}
// The int at 'virtual_delta' gives us the amount to add to 'this'.
@ -777,7 +777,7 @@ public:
// Ensure that there's a compilation failure if function pointers
// and data pointers have different sizes.
// If you get this error, you need to #undef FASTDELEGATE_USESTATICFUNCTIONHACK.
typedef int ERROR_CantUseEvilMethod[sizeof(GenericClass *)==sizeof(function_to_bind) ? 1 : -1];
typedef S32 ERROR_CantUseEvilMethod[sizeof(GenericClass *)==sizeof(function_to_bind) ? 1 : -1];
m_pthis = horrible_cast<GenericClass *>(function_to_bind);
// MSVC, SunC++ and DMC accept the following (non-standard) code:
// m_pthis = static_cast<GenericClass *>(static_cast<void *>(function_to_bind));
@ -792,7 +792,7 @@ public:
// Ensure that there's a compilation failure if function pointers
// and data pointers have different sizes.
// If you get this error, you need to #undef FASTDELEGATE_USESTATICFUNCTIONHACK.
typedef int ERROR_CantUseEvilMethod[sizeof(UnvoidStaticFuncPtr)==sizeof(this) ? 1 : -1];
typedef S32 ERROR_CantUseEvilMethod[sizeof(UnvoidStaticFuncPtr)==sizeof(this) ? 1 : -1];
return horrible_cast<UnvoidStaticFuncPtr>(this);
}
#endif // !defined(FASTDELEGATE_USESTATICFUNCTIONHACK)
@ -906,7 +906,7 @@ public:
// Implicit conversion to "bool" using the safe_bool idiom
private:
typedef struct SafeBoolStruct {
int a_data_pointer_to_this_is_0_on_buggy_compilers;
S32 a_data_pointer_to_this_is_0_on_buggy_compilers;
StaticFunctionPtr m_nonzero;
} UselessTypedef;
typedef StaticFunctionPtr SafeBoolStruct::*unspecified_bool_type;
@ -991,7 +991,7 @@ public:
// Implicit conversion to "bool" using the safe_bool idiom
private:
typedef struct SafeBoolStruct {
int a_data_pointer_to_this_is_0_on_buggy_compilers;
S32 a_data_pointer_to_this_is_0_on_buggy_compilers;
StaticFunctionPtr m_nonzero;
} UselessTypedef;
typedef StaticFunctionPtr SafeBoolStruct::*unspecified_bool_type;
@ -1076,7 +1076,7 @@ public:
// Implicit conversion to "bool" using the safe_bool idiom
private:
typedef struct SafeBoolStruct {
int a_data_pointer_to_this_is_0_on_buggy_compilers;
S32 a_data_pointer_to_this_is_0_on_buggy_compilers;
StaticFunctionPtr m_nonzero;
} UselessTypedef;
typedef StaticFunctionPtr SafeBoolStruct::*unspecified_bool_type;
@ -1161,7 +1161,7 @@ public:
// Implicit conversion to "bool" using the safe_bool idiom
private:
typedef struct SafeBoolStruct {
int a_data_pointer_to_this_is_0_on_buggy_compilers;
S32 a_data_pointer_to_this_is_0_on_buggy_compilers;
StaticFunctionPtr m_nonzero;
} UselessTypedef;
typedef StaticFunctionPtr SafeBoolStruct::*unspecified_bool_type;
@ -1246,7 +1246,7 @@ public:
// Implicit conversion to "bool" using the safe_bool idiom
private:
typedef struct SafeBoolStruct {
int a_data_pointer_to_this_is_0_on_buggy_compilers;
S32 a_data_pointer_to_this_is_0_on_buggy_compilers;
StaticFunctionPtr m_nonzero;
} UselessTypedef;
typedef StaticFunctionPtr SafeBoolStruct::*unspecified_bool_type;
@ -1331,7 +1331,7 @@ public:
// Implicit conversion to "bool" using the safe_bool idiom
private:
typedef struct SafeBoolStruct {
int a_data_pointer_to_this_is_0_on_buggy_compilers;
S32 a_data_pointer_to_this_is_0_on_buggy_compilers;
StaticFunctionPtr m_nonzero;
} UselessTypedef;
typedef StaticFunctionPtr SafeBoolStruct::*unspecified_bool_type;
@ -1416,7 +1416,7 @@ public:
// Implicit conversion to "bool" using the safe_bool idiom
private:
typedef struct SafeBoolStruct {
int a_data_pointer_to_this_is_0_on_buggy_compilers;
S32 a_data_pointer_to_this_is_0_on_buggy_compilers;
StaticFunctionPtr m_nonzero;
} UselessTypedef;
typedef StaticFunctionPtr SafeBoolStruct::*unspecified_bool_type;
@ -1501,7 +1501,7 @@ public:
// Implicit conversion to "bool" using the safe_bool idiom
private:
typedef struct SafeBoolStruct {
int a_data_pointer_to_this_is_0_on_buggy_compilers;
S32 a_data_pointer_to_this_is_0_on_buggy_compilers;
StaticFunctionPtr m_nonzero;
} UselessTypedef;
typedef StaticFunctionPtr SafeBoolStruct::*unspecified_bool_type;
@ -1586,7 +1586,7 @@ public:
// Implicit conversion to "bool" using the safe_bool idiom
private:
typedef struct SafeBoolStruct {
int a_data_pointer_to_this_is_0_on_buggy_compilers;
S32 a_data_pointer_to_this_is_0_on_buggy_compilers;
StaticFunctionPtr m_nonzero;
} UselessTypedef;
typedef StaticFunctionPtr SafeBoolStruct::*unspecified_bool_type;
@ -1671,7 +1671,7 @@ public:
// Implicit conversion to "bool" using the safe_bool idiom
private:
typedef struct SafeBoolStruct {
int a_data_pointer_to_this_is_0_on_buggy_compilers;
S32 a_data_pointer_to_this_is_0_on_buggy_compilers;
StaticFunctionPtr m_nonzero;
} UselessTypedef;
typedef StaticFunctionPtr SafeBoolStruct::*unspecified_bool_type;
@ -1756,7 +1756,7 @@ public:
// Implicit conversion to "bool" using the safe_bool idiom
private:
typedef struct SafeBoolStruct {
int a_data_pointer_to_this_is_0_on_buggy_compilers;
S32 a_data_pointer_to_this_is_0_on_buggy_compilers;
StaticFunctionPtr m_nonzero;
} UselessTypedef;
typedef StaticFunctionPtr SafeBoolStruct::*unspecified_bool_type;
@ -1841,7 +1841,7 @@ public:
// Implicit conversion to "bool" using the safe_bool idiom
private:
typedef struct SafeBoolStruct {
int a_data_pointer_to_this_is_0_on_buggy_compilers;
S32 a_data_pointer_to_this_is_0_on_buggy_compilers;
StaticFunctionPtr m_nonzero;
} UselessTypedef;
typedef StaticFunctionPtr SafeBoolStruct::*unspecified_bool_type;

View file

@ -55,7 +55,7 @@ public:
}
protected:
int mOffset;
S32 mOffset;
};
#endif // _UTIL_DELEGATE_H_

View file

@ -37,7 +37,7 @@ public:
volatile U8 *u8Mem = reinterpret_cast<U8 *>( memory );
for( int i = 0; i < size >> 2; i++ )
for( S32 i = 0; i < size >> 2; i++ )
{
// g = garbage byte
// Input: [X|Y|Z|g] (rgba)
@ -57,7 +57,7 @@ public:
volatile const U8 *srcU8 = reinterpret_cast<const U8 *>( source );
volatile U8 *dstU8 = reinterpret_cast<U8 *>( destination );
for( int i = 0; i < size >> 2; i++ )
for( S32 i = 0; i < size >> 2; i++ )
{
// g = garbage byte
// Input: [X|Y|Z|g] (rgba)
@ -85,13 +85,13 @@ public:
virtual void ToBuffer( void *destination, const void *source, const dsize_t size ) const
{
AssertFatal( size % 3 == 0, "Bad buffer size for DXT5nm Swizzle" );
const int pixels = size / 3;
const S32 pixels = size / 3;
volatile const U8 *srcU8 = reinterpret_cast<const U8 *>( source );
volatile U8 *dstU8 = reinterpret_cast<U8 *>( destination );
// destination better damn well be the right size
for( int i = 0; i < pixels; i++ )
for( S32 i = 0; i < pixels; i++ )
{
// g = garbage byte
// Input: [X|Y|Z|g] (rgba)

View file

@ -56,7 +56,7 @@ void Path::_split(String name)
idx = name.find('/', 0, String::Right);
if (idx >= pos)
{
int len = idx - pos;
S32 len = idx - pos;
mPath = name.substr(pos,len? len: 1);
mPath = Path::CleanSeparators(mPath);
pos = idx + 1;

View file

@ -126,11 +126,11 @@ inline void Swizzle<T, mapLength>::ToBuffer( void *destination, const void *sour
T *dest = reinterpret_cast<T *>( destination );
const T *src = reinterpret_cast<const T *>( source );
for( int i = 0; i < size / ( mapLength * sizeof( T ) ); i++ )
for( S32 i = 0; i < size / ( mapLength * sizeof( T ) ); i++ )
{
dMemcpy( dest, src, mapLength * sizeof( T ) );
for( int j = 0; j < mapLength; j++ )
for( S32 j = 0; j < mapLength; j++ )
*dest++ = src[mMap[j]];
src += mapLength;

View file

@ -37,7 +37,7 @@ inline void Swizzle<U8, 4>::InPlace( void *memory, const dsize_t size ) const
U8 *src = reinterpret_cast<U8 *>( memory );
// Fast divide by 4 since we are assured a proper size
for( int i = 0; i < size >> 2; i++ )
for( S32 i = 0; i < size >> 2; i++ )
{
BYTESWAP( *dest++, src[mMap[0]] );
BYTESWAP( *dest++, src[mMap[1]] );
@ -57,7 +57,7 @@ inline void Swizzle<U8, 4>::ToBuffer( void *destination, const void *source, con
const U8 *src = reinterpret_cast<const U8 *>( source );
// Fast divide by 4 since we are assured a proper size
for( int i = 0; i < size >> 2; i++ )
for( S32 i = 0; i < size >> 2; i++ )
{
*dest++ = src[mMap[0]];
*dest++ = src[mMap[1]];
@ -80,7 +80,7 @@ inline void Swizzle<U8, 3>::InPlace( void *memory, const dsize_t size ) const
U8 *dest = reinterpret_cast<U8 *>( memory );
U8 *src = reinterpret_cast<U8 *>( memory );
for( int i = 0; i < size /3; i++ )
for( S32 i = 0; i < size /3; i++ )
{
BYTESWAP( *dest++, src[mMap[0]] );
BYTESWAP( *dest++, src[mMap[1]] );
@ -98,7 +98,7 @@ inline void Swizzle<U8, 3>::ToBuffer( void *destination, const void *source, con
U8 *dest = reinterpret_cast<U8 *>( destination );
const U8 *src = reinterpret_cast<const U8 *>( source );
for( int i = 0; i < size / 3; i++ )
for( S32 i = 0; i < size / 3; i++ )
{
*dest++ = src[mMap[0]];
*dest++ = src[mMap[1]];

View file

@ -25,7 +25,7 @@
/// A vector with a compile-time constant size.
template< typename T, int SIZE >
template< typename T, S32 SIZE >
class FixedSizeVector
{
protected:

View file

@ -24,7 +24,7 @@
#include "core/util/tSignal.h"
void SignalBase::DelegateLink::insert(DelegateLink* node, float order)
void SignalBase::DelegateLink::insert(DelegateLink* node, F32 order)
{
// Note: can only legitimately be called on list head
DelegateLink * walk = next;

View file

@ -135,7 +135,7 @@ public:
{
if( del->mDelegate == dlg )
{
for ( int i = 0; i < mTriggerNext.size(); i++ )
for ( S32 i = 0; i < mTriggerNext.size(); i++ )
{
if( mTriggerNext[i] == ptr )
mTriggerNext[i] = ptr->next;

View file

@ -508,7 +508,7 @@ template<class T> inline void Vector<T>::compact()
resize(mElementCount);
}
typedef int (QSORT_CALLBACK *qsort_compare_func)(const void *, const void *);
typedef S32 (QSORT_CALLBACK *qsort_compare_func)(const void *, const void *);
template<class T> inline void Vector<T>::sort(compare_func f)
{
@ -800,7 +800,7 @@ class VectorPtr : public Vector<void *>
const_iterator end() const;
void insert(iterator,const T&);
void insert(int idx) { Parent::insert(idx); }
void insert(S32 idx) { Parent::insert(idx); }
void erase(iterator);
T& front();

View file

@ -72,10 +72,10 @@ CreateUnitTest( TestVector, "Util/Vector" )
TEST( dtorVals[ 9 ] );
}
static S32 QSORT_CALLBACK sortInts( const int* a, const int* b )
static S32 QSORT_CALLBACK sortInts( const S32* a, const S32* b )
{
int av = *a;
int bv = *b;
S32 av = *a;
S32 bv = *b;
if( av < bv )
return -1;
@ -87,7 +87,7 @@ CreateUnitTest( TestVector, "Util/Vector" )
void testSort()
{
Vector< int > v;
Vector< S32 > v;
v.push_back( 0 );
v.push_back( 10 );

View file

@ -216,7 +216,7 @@ String ZipObject::getFileEntry(S32 idx)
const Zip::CentralDir &dir = (*mZipArchive)[idx];
char buffer[1024];
int chars = dSprintf(buffer, sizeof(buffer), "%s\t%d\t%d\t%d\t%08x",
S32 chars = dSprintf(buffer, sizeof(buffer), "%s\t%d\t%d\t%d\t%08x",
dir.mFilename.c_str(), dir.mUncompressedSize, dir.mCompressedSize,
dir.mCompressMethod, dir.mCRC32);
if (chars < sizeof(buffer))

View file

@ -651,7 +651,7 @@ bool MountSystem::unmount(FileSystemRef fs)
// also check that fs is not null each time since its a strong ref
// so it could be nulled during removal.
bool unmounted = false;
for (int i = mMountList.size() - 1; !fs.isNull() && i >= 0; --i)
for (S32 i = mMountList.size() - 1; !fs.isNull() && i >= 0; --i)
{
if (mMountList[i].fileSystem.getPointer() == fs.getPointer())
{

View file

@ -1057,7 +1057,7 @@ void ScatterSky::_renderMoon( ObjectRenderInst *ri, SceneRenderState *state, Bas
const MatrixF &camView = state->getCameraTransform();
// Finalize points
for(int i = 0; i < 4; i++)
for(S32 i = 0; i < 4; i++)
{
// align with camera
camView.mulV(points[i]);
@ -1114,13 +1114,13 @@ void ScatterSky::_generateSkyPoints()
F32 deltaSegAngle = ( 2.0f * M_PI_F / (F32)segments );
// Generate the group of rings for the sphere.
for( int ring = 0; ring < 2; ring++ )
for( S32 ring = 0; ring < 2; ring++ )
{
F32 r0 = mSin( ring * deltaRingAngle );
F32 y0 = mCos( ring * deltaRingAngle );
// Generate the group of segments for the current ring.
for( int seg = 0; seg < segments + 1 ; seg++ )
for( S32 seg = 0; seg < segments + 1 ; seg++ )
{
F32 x0 = r0 * sinf( seg * deltaSegAngle );
F32 z0 = r0 * cosf( seg * deltaSegAngle );

View file

@ -470,7 +470,7 @@ void Sun::_renderCorona( ObjectRenderInst *ri, SceneRenderState *state, BaseMatI
const MatrixF &camView = state->getCameraTransform();
// Finalize points
for(int i = 0; i < 4; i++)
for(S32 i = 0; i < 4; i++)
{
// align with camera
camView.mulV(points[i]);

View file

@ -163,7 +163,7 @@ void WaterPlane::unpackUpdate(NetConnection* con, BitStream* stream)
if( stream->readFlag() ) // UpdateMask
{
float posZ;
F32 posZ;
stream->read( &posZ );
Point3F newPos = getPosition();
newPos.z = posZ;

View file

@ -650,7 +650,7 @@ void ForestBrushTool::_collectElements()
}
}
bool ForestBrushTool::getGroundAt( const Point3F &worldPt, float *zValueOut, VectorF *normalOut )
bool ForestBrushTool::getGroundAt( const Point3F &worldPt, F32 *zValueOut, VectorF *normalOut )
{
const U32 mask = TerrainObjectType | StaticShapeObjectType;

View file

@ -82,7 +82,7 @@ public:
void setPressure( F32 val );
void setHardness( F32 val );
void collectElements() { _collectElements(); }
bool getGroundAt( const Point3F &worldPt, float *zValueOut, VectorF *normalOut );
bool getGroundAt( const Point3F &worldPt, F32 *zValueOut, VectorF *normalOut );
protected:

View file

@ -54,8 +54,8 @@ extern _D3DTEXTUREOP GFXD3D9TextureOp[GFXTOP_COUNT];
extern _D3DDECLTYPE GFXD3D9DeclType[GFXDeclType_COUNT];
#define GFXREVERSE_LOOKUP( tablearray, enumprefix, val ) \
for( int i = enumprefix##_FIRST; i < enumprefix##_COUNT; i++ ) \
if( (int)tablearray##[i] == val ) \
for( S32 i = enumprefix##_FIRST; i < enumprefix##_COUNT; i++ ) \
if( (S32)tablearray##[i] == val ) \
{ \
val = i; \
break; \

View file

@ -259,7 +259,7 @@ void GFXD3D9TextureManager::_innerCreateTexture( GFXD3D9TextureObject *retTex,
retTex->mTextureSize.set(probeDesc.Width, probeDesc.Height, 0);
int fmt = probeDesc.Format;
S32 fmt = probeDesc.Format;
#if !defined(TORQUE_OS_XENON)
GFXREVERSE_LOOKUP( GFXD3D9TextureFormat, GFXFormat, fmt );
@ -568,7 +568,7 @@ bool GFXD3D9TextureManager::_loadTexture(GFXTextureObject *aTexture, DDSFile *dd
GFXD3D9TextureObject *texture = static_cast<GFXD3D9TextureObject*>(aTexture);
// Fill the texture...
for( int i = 0; i < aTexture->mMipLevels; i++ )
for( S32 i = 0; i < aTexture->mMipLevels; i++ )
{
PROFILE_SCOPE(GFXD3DTexMan_loadSurface);

View file

@ -242,9 +242,9 @@ bool GFXD3D9TextureObject::copyToBmp(GBitmap* bmp)
PROFILE_START(GFXD3D9TextureObject_copyToBmp_pixCopy);
// copy data into bitmap
for (int row = 0; row < height; ++row)
for (S32 row = 0; row < height; ++row)
{
for (int col = 0; col < width; ++col)
for (S32 col = 0; col < width; ++col)
{
destPtr[0] = srcPtr[2]; // red
destPtr[1] = srcPtr[1]; // green

View file

@ -46,14 +46,14 @@ _D3DDECLTYPE GFXD3D9DeclType[GFXDeclType_COUNT];
//------------------------------------------------------------------------------
#define INIT_LOOKUPTABLE( tablearray, enumprefix, type ) \
for( int i = enumprefix##_FIRST; i < enumprefix##_COUNT; i++ ) \
for( S32 i = enumprefix##_FIRST; i < enumprefix##_COUNT; i++ ) \
tablearray##[i] = (##type##)GFX_UNINIT_VAL;
#define VALIDATE_LOOKUPTABLE( tablearray, enumprefix ) \
for( int i = enumprefix##_FIRST; i < enumprefix##_COUNT; i++ ) \
if( (int)tablearray##[i] == GFX_UNINIT_VAL ) \
for( S32 i = enumprefix##_FIRST; i < enumprefix##_COUNT; i++ ) \
if( (S32)tablearray##[i] == GFX_UNINIT_VAL ) \
Con::warnf( "GFXD3D9EnumTranslate: Unassigned value in " #tablearray ": %i", i ); \
else if( (int)tablearray##[i] == GFX_UNSUPPORTED_VAL ) \
else if( (S32)tablearray##[i] == GFX_UNSUPPORTED_VAL ) \
Con::warnf( "GFXD3D9EnumTranslate: Unsupported value in " #tablearray ": %i", i );
//------------------------------------------------------------------------------

View file

@ -330,7 +330,7 @@ void GFXPCD3D9TextureTarget::resolveTo( GFXTextureObject *tex )
void GFXPCD3D9TextureTarget::zombify()
{
for(int i = 0; i < MaxRenderSlotId; i++)
for(S32 i = 0; i < MaxRenderSlotId; i++)
attachTexture(RenderSlot(i), NULL);
}

View file

@ -883,7 +883,7 @@ DDSFile *DDSFile::createDDSFileFromGBitmap( const GBitmap *gbmp )
ret->mSurfaces.push_back( new SurfaceData() );
// Load the mips
for( int i = 0; i < ret->mMipMapCount; i++ )
for( S32 i = 0; i < ret->mMipMapCount; i++ )
{
const U32 mipSz = ret->getSurfaceSize(i);
ret->mSurfaces.last()->mMips.push_back( new U8[mipSz] );
@ -898,7 +898,7 @@ DDSFile *DDSFile::createDDSFileFromGBitmap( const GBitmap *gbmp )
// Assumption:
AssertFatal( gbmp->getBytesPerPixel() + 1 == ret->mBytesPerPixel, "Assumption failed, not 24->32 bit straight convert." );
for( int pxl = 0; pxl < gbmp->getWidth(i) * gbmp->getHeight(i); pxl++ )
for( S32 pxl = 0; pxl < gbmp->getWidth(i) * gbmp->getHeight(i); pxl++ )
{
U8 *dst = &mipMem[pxl * ret->mBytesPerPixel];
const U8 *src = &gbmp->getBits(i)[pxl * gbmp->getBytesPerPixel()];

View file

@ -77,7 +77,7 @@ bool DDSUtil::squishDDS( DDSFile *srcDDS, const GFXFormat dxtFormat )
// are done, we can discard the old surface, and replace it with this one.
DDSFile::SurfaceData *newSurface = new DDSFile::SurfaceData();
for( int i = 0; i < srcDDS->mMipMapCount; i++ )
for( S32 i = 0; i < srcDDS->mMipMapCount; i++ )
{
const U8 *srcBits = srcSurface->mMips[i];
@ -106,7 +106,7 @@ bool DDSUtil::squishDDS( DDSFile *srcDDS, const GFXFormat dxtFormat )
void DDSUtil::swizzleDDS( DDSFile *srcDDS, const Swizzle<U8, 4> &swizzle )
{
for( int i = 0; i < srcDDS->mMipMapCount; i++ )
for( S32 i = 0; i < srcDDS->mMipMapCount; i++ )
{
swizzle.InPlace( srcDDS->mSurfaces.last()->mMips[i], srcDDS->getSurfaceSize( i ) );
}

View file

@ -796,11 +796,11 @@ bool GBitmap::combine( const GBitmap *bitmapA, const GBitmap *bitmapB, const GFX
const U8 *aBits = bitmapA->getBits();
const U8 *bBits = bitmapB->getBits();
for( int y = 0; y < getHeight(); y++ )
for( S32 y = 0; y < getHeight(); y++ )
{
for( int x = 0; x < getWidth(); x++ )
for( S32 x = 0; x < getWidth(); x++ )
{
for( int _byte = 0; _byte < mBytesPerPixel; _byte++ )
for( S32 _byte = 0; _byte < mBytesPerPixel; _byte++ )
{
U8 pxA = 0;
U8 pxB = 0;

View file

@ -152,7 +152,7 @@ static bool sReadBMP(Stream &stream, GBitmap *bitmap)
if(bytesPerPixel == 3 && bi.biBitCount != 8) // do BGR swap
{
U8 *ptr = bitmap->getAddress(0,0);
for(int i = 0; i < width * height; i++)
for(S32 i = 0; i < width * height; i++)
{
U8 tmp = ptr[0];
ptr[0] = ptr[2];

View file

@ -54,7 +54,7 @@ static struct _privateRegisterGIF
//-------------------------------------- Replacement I/O for standard LIBjpeg
// functions. we don't wanna use
// FILE*'s...
static int gifReadDataFn(GifFileType *gifinfo, GifByteType *data, int length)
static S32 gifReadDataFn(GifFileType *gifinfo, GifByteType *data, S32 length)
{
Stream *stream = (Stream*)gifinfo->UserData;
AssertFatal(stream != NULL, "gifReadDataFn::No stream.");
@ -72,7 +72,7 @@ static int gifReadDataFn(GifFileType *gifinfo, GifByteType *data, int length)
//--------------------------------------
#if 0
// CodeReview - until we can write these, get rid of warning by disabling method.
static int gifWriteDataFn(GifFileType *gifinfo, GifByteType *data, int length)
static S32 gifWriteDataFn(GifFileType *gifinfo, GifByteType *data, S32 length)
{
Stream *stream = (Stream*)gifinfo->UserData;
AssertFatal(stream != NULL, "gifWriteDataFn::No stream.");

View file

@ -50,11 +50,11 @@ static struct _privateRegisterJPG
//-------------------------------------- Replacement I/O for standard LIBjpeg
// functions. we don't wanna use
// FILE*'s...
static int jpegReadDataFn(void *client_data, unsigned char *data, int length)
static S32 jpegReadDataFn(void *client_data, U8 *data, S32 length)
{
Stream *stream = (Stream*)client_data;
AssertFatal(stream != NULL, "jpegReadDataFn::No stream.");
int pos = stream->getPosition();
S32 pos = stream->getPosition();
if (stream->read(length, data))
return length;
@ -66,7 +66,7 @@ static int jpegReadDataFn(void *client_data, unsigned char *data, int length)
//--------------------------------------
static int jpegWriteDataFn(void *client_data, unsigned char *data, int length)
static S32 jpegWriteDataFn(void *client_data, U8 *data, S32 length)
{
Stream *stream = (Stream*)client_data;
AssertFatal(stream != NULL, "jpegWriteDataFn::No stream.");
@ -78,7 +78,7 @@ static int jpegWriteDataFn(void *client_data, unsigned char *data, int length)
//--------------------------------------
static int jpegFlushDataFn(void *)
static S32 jpegFlushDataFn(void *)
{
// do nothing since we can't flush the stream object
return 0;
@ -86,7 +86,7 @@ static int jpegFlushDataFn(void *)
//--------------------------------------
static int jpegErrorFn(void *client_data)
static S32 jpegErrorFn(void *client_data)
{
Stream *stream = (Stream*)client_data;
AssertFatal(stream != NULL, "jpegErrorFn::No stream.");

View file

@ -103,7 +103,7 @@ GFXDevice::GFXDevice()
mViewMatrix.identity();
mProjectionMatrix.identity();
for( int i = 0; i < WORLD_STACK_MAX; i++ )
for( S32 i = 0; i < WORLD_STACK_MAX; i++ )
mWorldMatrix[i].identity();
AssertFatal(smGFXDevice == NULL, "Already a GFXDevice created! Bad!");
@ -451,7 +451,7 @@ void GFXDevice::updateStates(bool forceSetAll /*=false*/)
if( mTextureMatrixCheckDirty )
{
for( int i = 0; i < getNumSamplers(); i++ )
for( S32 i = 0; i < getNumSamplers(); i++ )
{
if( mTextureMatrixDirty[i] )
{
@ -1279,7 +1279,7 @@ DefineEngineFunction( getPixelShaderVersion, F32, (),,
return GFX->getPixelShaderVersion();
}
DefineEngineFunction( setPixelShaderVersion, void, ( float version ),,
DefineEngineFunction( setPixelShaderVersion, void, ( F32 version ),,
"@brief Sets the pixel shader version for the active device.\n"
"This can be used to force a lower pixel shader version than is supported by "
"the device for testing or performance optimization.\n"

View file

@ -474,7 +474,7 @@ void GFXDrawUtil::drawRect( const Point2F &upperLeft, const Point2F &lowerRight,
verts[8].point.set( upperLeft.x + ulOffset + nw.x, upperLeft.y + ulOffset + nw.y, 0.0f ); // same as 0
verts[9].point.set( upperLeft.x + ulOffset - nw.x, upperLeft.y + ulOffset - nw.y, 0.0f ); // same as 1
for (int i=0; i<10; i++)
for (S32 i=0; i<10; i++)
verts[i].color = color;
verts.unlock();
@ -531,7 +531,7 @@ void GFXDrawUtil::drawRectFill( const Point2F &upperLeft, const Point2F &lowerRi
verts[2].point.set( upperLeft.x-ne.x+ulOffset, lowerRight.y-ne.y, 0.0f );
verts[3].point.set( lowerRight.x-nw.x, lowerRight.y-nw.y, 0.0f );
for (int i=0; i<4; i++)
for (S32 i=0; i<4; i++)
verts[i].color = color;
verts.unlock();
@ -828,11 +828,11 @@ void GFXDrawUtil::_drawWireCube( const GFXStateBlockDesc &desc, const Point3F &s
// setup 6 line loops
U32 vertexIndex = 0;
for(int i = 0; i < 6; i++)
for(S32 i = 0; i < 6; i++)
{
for(int j = 0; j < 5; j++)
for(S32 j = 0; j < 5; j++)
{
int idx = cubeFaces[i][j%4];
S32 idx = cubeFaces[i][j%4];
verts[vertexIndex].point = cubePoints[idx] * halfSize;
verts[vertexIndex].color = color;
@ -872,7 +872,7 @@ void GFXDrawUtil::_drawSolidCube( const GFXStateBlockDesc &desc, const Point3F &
// setup 6 line loops
U32 vertexIndex = 0;
U32 idx;
for(int i = 0; i < 6; i++)
for(S32 i = 0; i < 6; i++)
{
idx = cubeFaces[i][0];
verts[vertexIndex].point = cubePoints[idx] * halfSize;

View file

@ -76,20 +76,20 @@ _STRING_VALUE_LOOKUP_FXN(GFXStringBlendOp);
//------------------------------------------------------------------------------
#define INIT_LOOKUPTABLE( tablearray, enumprefix, type ) \
for( int i = enumprefix##_FIRST; i < enumprefix##_COUNT; i++ ) \
for( S32 i = enumprefix##_FIRST; i < enumprefix##_COUNT; i++ ) \
tablearray[i] = (type)GFX_UNINIT_VAL;
#define INIT_LOOKUPTABLE_EX( tablearray, enumprefix, type, typeTable ) \
for( int i = enumprefix##_FIRST; i < enumprefix##_COUNT; i++ ) \
for( S32 i = enumprefix##_FIRST; i < enumprefix##_COUNT; i++ ) \
{\
tablearray[i] = (type)GFX_UNINIT_VAL;\
typeTable[i] = &defaultStringValueLookup;\
}
#define VALIDATE_LOOKUPTABLE( tablearray, enumprefix ) \
for( int i = enumprefix##_FIRST; i < enumprefix##_COUNT; i++ ) \
if( (int)tablearray[i] == GFX_UNINIT_VAL ) \
for( S32 i = enumprefix##_FIRST; i < enumprefix##_COUNT; i++ ) \
if( (S32)tablearray[i] == GFX_UNINIT_VAL ) \
Con::warnf( "GFXStringEnumTranslate: Unassigned value in " #tablearray ": %i", i ); \
else if( (int)tablearray[i] == GFX_UNSUPPORTED_VAL ) \
else if( (S32)tablearray[i] == GFX_UNSUPPORTED_VAL ) \
Con::warnf( "GFXStringEnumTranslate: Unsupported value in " #tablearray ": %i", i );
//------------------------------------------------------------------------------

View file

@ -71,8 +71,8 @@ extern StringValueLookupFn GFXStringSamplerStateValueLookup[GFXSAMP_COUNT];
extern StringValueLookupFn GFXStringTextureStageStateValueLookup[GFXTSS_COUNT];
#define GFXREVERSE_LOOKUP( tablearray, enumprefix, val ) \
for( int i = enumprefix##_FIRST; i < enumprefix##_COUNT; i++ ) \
if( (int)tablearray##[i] == val ) \
for( S32 i = enumprefix##_FIRST; i < enumprefix##_COUNT; i++ ) \
if( (S32)tablearray##[i] == val ) \
{ \
val = i; \
break; \

View file

@ -1033,7 +1033,7 @@ void GFXTextureManager::_validateTexParams( const U32 width, const U32 height,
GFXFormat testingFormat = inOutFormat;
if( profile->getCompression() != GFXTextureProfile::NONE )
{
const int offset = profile->getCompression() - GFXTextureProfile::DXT1;
const S32 offset = profile->getCompression() - GFXTextureProfile::DXT1;
testingFormat = GFXFormat( GFXFormatDXT1 + offset );
// No auto-gen mips on compressed textures

View file

@ -63,7 +63,7 @@ struct GFXLockedRect
{
/// Pitch of the lock. This is the spacing in bytes of the start
/// of each row of the locked region.
int pitch;
S32 pitch;
/// Pointer to the start of locked rectangle.
U8* bits;

View file

@ -13606,8 +13606,8 @@ void setupBunny(GFXVertexPCN* v)
{
for(j=0;j<3;j++)
{
int vi=face_indicies[i][j];
int ni=face_indicies[i][j+3];//Normal index
S32 vi=face_indicies[i][j];
S32 ni=face_indicies[i][j+3];//Normal index
Point3F point = Point3F(vertices[vi][0], vertices[vi][1], vertices[vi][2]);
v[vert].normal = Point3F(normals[ni][0], normals[ni][1], normals[ni][2]);
v[vert].point = point;

View file

@ -32,7 +32,7 @@ struct DistanceFieldSearchSpaceStruct
F32 distance;
};
int QSORT_CALLBACK cmpSortDistanceFieldSearchSpaceStruct(const void* p1, const void* p2)
S32 QSORT_CALLBACK cmpSortDistanceFieldSearchSpaceStruct(const void* p1, const void* p2)
{
const DistanceFieldSearchSpaceStruct* sp1 = (const DistanceFieldSearchSpaceStruct*)p1;
const DistanceFieldSearchSpaceStruct* sp2 = (const DistanceFieldSearchSpaceStruct*)p2;

View file

@ -48,11 +48,11 @@ void OptimizeTriangleOrdering(const dsize_t numVerts, const dsize_t numIndices,
FrameTemp<TriData> triangleData(NumPrimitives);
U32 curIdx = 0;
for(int tri = 0; tri < NumPrimitives; tri++)
for(S32 tri = 0; tri < NumPrimitives; tri++)
{
TriData &curTri = triangleData[tri];
for(int c = 0; c < 3; c++)
for(S32 c = 0; c < 3; c++)
{
const U32 &curVIdx = indices[curIdx];
AssertFatal(curVIdx < numVerts, "Out of range index.");
@ -71,7 +71,7 @@ void OptimizeTriangleOrdering(const dsize_t numVerts, const dsize_t numIndices,
// Allocate per-vertex triangle lists, and calculate the starting score of
// each of the verts
for(int v = 0; v < numVerts; v++)
for(S32 v = 0; v < numVerts; v++)
{
VertData &curVert = vertexData[v];
curVert.triIndex = new S32[curVert.numUnaddedReferences];
@ -89,11 +89,11 @@ void OptimizeTriangleOrdering(const dsize_t numVerts, const dsize_t numIndices,
// Fill-in per-vertex triangle lists, and sum the scores of each vertex used
// per-triangle, to get the starting triangle score
curIdx = 0;
for(int tri = 0; tri < NumPrimitives; tri++)
for(S32 tri = 0; tri < NumPrimitives; tri++)
{
TriData &curTri = triangleData[tri];
for(int c = 0; c < 3; c++)
for(S32 c = 0; c < 3; c++)
{
const U32 &curVIdx = indices[curIdx];
AssertFatal(curVIdx < numVerts, "Out of range index.");
@ -117,7 +117,7 @@ void OptimizeTriangleOrdering(const dsize_t numVerts, const dsize_t numIndices,
// Step 2: Start emitting triangles...this is the emit loop
//
LRUCacheModel lruCache;
for(int outIdx = 0; outIdx < numIndices; /* this space intentionally left blank */ )
for(S32 outIdx = 0; outIdx < numIndices; /* this space intentionally left blank */ )
{
// If there is no next best triangle, than search for the next highest
// scored triangle that isn't in the list already
@ -127,7 +127,7 @@ void OptimizeTriangleOrdering(const dsize_t numVerts, const dsize_t numIndices,
nextBestTriScore = nextNextBestTriScore = -1.0f;
nextBestTriIdx = nextNextBestTriIdx = -1;
for(int tri = 0; tri < NumPrimitives; tri++)
for(S32 tri = 0; tri < NumPrimitives; tri++)
{
TriData &curTri = triangleData[tri];
@ -143,7 +143,7 @@ void OptimizeTriangleOrdering(const dsize_t numVerts, const dsize_t numIndices,
// Emit the next best triangle
TriData &nextBestTri = triangleData[nextBestTriIdx];
AssertFatal(!nextBestTri.isInList, "Next best triangle already in list, this is no good.");
for(int i = 0; i < 3; i++)
for(S32 i = 0; i < 3; i++)
{
// Emit index
outIndices[outIdx++] = IndexType(nextBestTri.vertIdx[i]);
@ -151,7 +151,7 @@ void OptimizeTriangleOrdering(const dsize_t numVerts, const dsize_t numIndices,
// Update the list of triangles on the vert
VertData &curVert = vertexData[nextBestTri.vertIdx[i]];
curVert.numUnaddedReferences--;
for(int t = 0; t < curVert.numReferences; t++)
for(S32 t = 0; t < curVert.numReferences; t++)
{
if(curVert.triIndex[t] == nextBestTriIdx)
{
@ -184,7 +184,7 @@ void OptimizeTriangleOrdering(const dsize_t numVerts, const dsize_t numIndices,
{
tri.score = 0.0f;
for(int i = 0; i < 3; i++)
for(S32 i = 0; i < 3; i++)
tri.score += vertexData[tri.vertIdx[i]].score;
_CHECK_NEXT_BEST(tri.score, *itr);
@ -288,12 +288,12 @@ void LRUCacheModel::enforceSize(const dsize_t maxSize, Vector<U32> &outTrisToUpd
// Update cache position on verts still in cache
vData.cachePosition = length++;
for(int i = 0; i < vData.numReferences; i++)
for(S32 i = 0; i < vData.numReferences; i++)
{
const S32 &triIdx = vData.triIndex[i];
if(triIdx > -1)
{
int j = 0;
S32 j = 0;
for(; j < outTrisToUpdate.size(); j++)
if(outTrisToUpdate[j] == triIdx)
break;
@ -378,7 +378,7 @@ F32 score(const VertData &vertexData)
AssertFatal(vertexData.cachePosition < MaxSizeVertexCache, "Out of range cache position for vertex");
// Points for being high in the cache.
const float Scaler = 1.0f / (MaxSizeVertexCache - 3);
const F32 Scaler = 1.0f / (MaxSizeVertexCache - 3);
Score = 1.0f - (vertexData.cachePosition - 3) * Scaler;
Score = mPow(Score, FindVertexScore::CacheDecayPower);
}
@ -387,7 +387,7 @@ F32 score(const VertData &vertexData)
// Bonus points for having a low number of tris still to
// use the vert, so we get rid of lone verts quickly.
float ValenceBoost = mPow(vertexData.numUnaddedReferences, -FindVertexScore::ValenceBoostPower);
F32 ValenceBoost = mPow(vertexData.numUnaddedReferences, -FindVertexScore::ValenceBoostPower);
Score += FindVertexScore::ValenceBoostScale * ValenceBoost;
return Score;

Some files were not shown because too many files have changed in this diff Show more