Fixed over 500 compile warnings. Mostly:

* Unused variables.
* Missing newlines at ends of #included files.
* signed int loop variables where the termination condition is an unsigned 'get number of' function.
* 'NULL' used inappropriately for an integer or character constant (NULL is a pointer)
* abstract base classes with no virtual destructor.
* Floating point constants used to initialise integer variables.
This commit is contained in:
sjbaker
2006-09-23 14:51:54 +00:00
parent ccced9fd82
commit f1627677df
78 changed files with 1629 additions and 1691 deletions

View File

@@ -47,7 +47,6 @@ void BspConverter::convertBsp(BspLoader& bspLoader,float scaling)
{
printf("Reading bspLeaf %i from total %i (%f procent)\n",i, bspLoader.m_numleafs,(100.f*(float)i/float(bspLoader.m_numleafs)) );
bool isValid = false;
bool isValidBrush = false;
BSPLeaf& leaf = bspLoader.m_dleafs[i];
@@ -96,11 +95,6 @@ void BspConverter::convertBsp(BspLoader& bspLoader,float scaling)
}
}
}
else
{
int i=0;
}
}
}
@@ -205,8 +199,6 @@ void BspConverter::convertBsp(BspLoader& bspLoader,float scaling)
void BspConverter::getVerticesFromPlaneEquations(const std::vector<SimdVector3>& planeEquations , std::vector<SimdVector3>& verticesOut )
{
float minimumDotProduct = 1e30f;
const int numbrushes = planeEquations.size();
// brute force:
for (int i=0;i<numbrushes;i++)
@@ -279,4 +271,4 @@ bool BspConverter::isInside(const std::vector<SimdVector3>& planeEquations, cons
}
return true;
}
}

View File

@@ -37,4 +37,5 @@ class BspConverter
};
#endif //BSP_CONVERTER_H
#endif //BSP_CONVERTER_H

View File

@@ -261,7 +261,7 @@ char* makeExeToBspFilename(const char* lpCmdLine)
// displays the first filename
const char *in = lpCmdLine;
char* out = cleaned_filename;
*out = NULL;
*out = '\0';
// If the first character is a ", skip it (filenames with spaces in them are quoted)
if(*in == '\"')
{
@@ -276,7 +276,7 @@ char* makeExeToBspFilename(const char* lpCmdLine)
break;
// If we hit a null or a quote, stop copying. This will get just the first filename.
if(*in == NULL || *in == '\"')
if(*in == '\0' || *in == '\"')
break;
// Copy while swapping backslashes for forward ones
if(*in == '\\')

View File

@@ -34,4 +34,6 @@ class BspDemo : public DemoApplication
};
#endif //BSP_DEMO_H
#endif //BSP_DEMO_H

View File

@@ -710,4 +710,5 @@ const BSPEntity * BspLoader::getEntityByValue( const char* name, const char* val
}
}
return entity;
}
}

View File

@@ -269,8 +269,7 @@ void CcdPhysicsDemo::initPhysics()
{
CollisionDispatcher* dispatcher = new CollisionDispatcher();
ParallelIslandDispatcher* dispatcher2 = new ParallelIslandDispatcher();
SimdVector3 worldAabbMin(-10000,-10000,-10000);
SimdVector3 worldAabbMax(10000,10000,10000);

View File

@@ -32,4 +32,5 @@ class CcdPhysicsDemo : public DemoApplication
};
#endif //CCD_PHYSICS_DEMO_H
#endif //CCD_PHYSICS_DEMO_H

File diff suppressed because it is too large Load Diff

View File

@@ -87,4 +87,6 @@ public:
};
#endif //COLLADA_CONVERTER_H
#endif //COLLADA_CONVERTER_H

View File

@@ -37,4 +37,5 @@ class ColladaDemo : public DemoApplication
};
#endif //COLLADA_PHYSICS_DEMO_H
#endif //COLLADA_PHYSICS_DEMO_H

View File

@@ -45,8 +45,8 @@ GL_Simplex1to4 simplex;
PolyhedralConvexShape* shapePtr[maxNumObjects];
SimdTransform tr[numObjects];
int screenWidth = 640.f;
int screenHeight = 480.f;
int screenWidth = 640;
int screenHeight = 480;
void DrawRasterizerLine(float const* , float const*, int)
{

View File

@@ -33,4 +33,5 @@ class CollisionDemo : public DemoApplication
}
};
#endif //COLLISION_DEMO_H
#endif //COLLISION_DEMO_H

View File

@@ -45,8 +45,8 @@ GL_Simplex1to4 simplex;
CollisionObject objects[maxNumObjects];
CollisionWorld* collisionWorld = 0;
int screenWidth = 640.f;
int screenHeight = 480.f;
int screenWidth = 640;
int screenHeight = 480;
int main(int argc,char** argv)
@@ -74,8 +74,8 @@ void CollisionInterfaceDemo::initPhysics()
objects[0].m_worldTransform.setBasis(basisA);
objects[1].m_worldTransform.setBasis(basisB);
SimdPoint3 points0[3]={SimdPoint3(1,0,0),SimdPoint3(0,1,0),SimdPoint3(0,0,1)};
SimdPoint3 points1[5]={SimdPoint3(1,0,0),SimdPoint3(0,1,0),SimdPoint3(0,0,1),SimdPoint3(0,0,-1),SimdPoint3(-1,-1,0)};
//SimdPoint3 points0[3]={SimdPoint3(1,0,0),SimdPoint3(0,1,0),SimdPoint3(0,0,1)};
//SimdPoint3 points1[5]={SimdPoint3(1,0,0),SimdPoint3(0,1,0),SimdPoint3(0,0,1),SimdPoint3(0,0,-1),SimdPoint3(-1,-1,0)};
BoxShape* boxA = new BoxShape(SimdVector3(1,1,1));
BoxShape* boxB = new BoxShape(SimdVector3(0.5,0.5,0.5));

View File

@@ -32,4 +32,5 @@ class CollisionInterfaceDemo : public DemoApplication
};
#endif //COLLISION_INTERFACE_DEMO_H
#endif //COLLISION_INTERFACE_DEMO_H

View File

@@ -33,4 +33,5 @@ class ConcaveDemo : public DemoApplication
};
#endif //CONCAVE_DEMO_H
#endif //CONCAVE_DEMO_H

View File

@@ -164,7 +164,7 @@ void ConcaveDemo::initPhysics()
ConstraintSolver* solver = new SequentialImpulseConstraintSolver;
// ConstraintSolver* solver = new SequentialImpulseConstraintSolver;
CollisionDispatcher* dispatcher = new CollisionDispatcher();
@@ -188,7 +188,7 @@ void ConcaveDemo::initPhysics()
{
CollisionShape* boxShape = new BoxShape(SimdVector3(1,1,1));
startTransform.setOrigin(SimdVector3(2*i,1,1));
CcdPhysicsController* boxRigidBody = LocalCreatePhysicsObject(true, 1, startTransform,boxShape);
LocalCreatePhysicsObject(true, 1, startTransform,boxShape);
}
}
m_physicsEnvironmentPtr->setGravity(-1,-10,1);

View File

@@ -60,9 +60,7 @@ int main(int argc,char** argv)
void ConstraintDemo::initPhysics()
{
ConstraintSolver* solver = new SequentialImpulseConstraintSolver;
//ConstraintSolver* solver = new SequentialImpulseConstraintSolver;
//ConstraintSolver* solver = new OdeConstraintSolver;
CollisionDispatcher* dispatcher = new CollisionDispatcher();

View File

@@ -33,4 +33,5 @@ class ConstraintDemo : public DemoApplication
}
};
#endif //CONSTRAINT_DEMO_H
#endif //CONSTRAINT_DEMO_H

View File

@@ -33,4 +33,5 @@ class ContinuousConvexCollisionDemo : public DemoApplication
}
};
#endif //CONTINUOUS_CONVEX_COLLISION_DEMO_H
#endif //CONTINUOUS_CONVEX_COLLISION_DEMO_H

View File

@@ -58,8 +58,8 @@ SimdTransform fromTrans[maxNumObjects];
SimdTransform toTrans[maxNumObjects];
int screenWidth = 640.f;
int screenHeight = 480.f;
int screenWidth = 640;
int screenHeight = 480;
int main(int argc,char** argv)
@@ -158,16 +158,9 @@ void ContinuousConvexCollisionDemo::displayCallback(void) {
{
i=0;//for (i=1;i<numObjects;i++)
{
SimdScalar dt = 1.f;
SimdScalar boundingRadius = shapePtr[i]->GetAngularMotionDisc();
SimdScalar angspeed = angVels[i].length() * boundingRadius * dt;
SimdScalar linspeed = linVels[i].length() * dt;
SimdScalar totalspeed = angspeed + linspeed;
//for each object, subdivide the from/to transform in 10 equal steps
int numSubSteps = 10.f;
int numSubSteps = 10;
for (int s=0;s<10;s++)
{
SimdScalar subStep = s * 1.f/(float)numSubSteps;
@@ -188,8 +181,6 @@ void ContinuousConvexCollisionDemo::displayCallback(void) {
}
int shapeIndex = 1;
SimdMatrix3x3 mat;
mat.setEulerZYX(yaw,pitch,roll);
SimdQuaternion orn;

View File

@@ -76,10 +76,6 @@ GLDebugDrawer debugDrawer;
int main(int argc,char** argv)
{
int i;
char* filename = "file.obj";
@@ -308,7 +304,7 @@ void ConvexDecompositionDemo::initPhysics(const char* filename)
//convexDecomposition.performConvexDecomposition(desc);
ConvexBuilder cb(desc.mCallback);
int ret = cb.process(desc);
cb.process(desc);
if (outputFile)
fclose(outputFile);

View File

@@ -35,4 +35,6 @@ class ConvexDecompositionDemo : public DemoApplication
};
#endif //CONVEX_DECOMPOSITION_DEMO_H
#endif //CONVEX_DECOMPOSITION_DEMO_H

View File

@@ -128,7 +128,7 @@ void ForkLiftDemo::setupPhysics()
{
CollisionDispatcher* dispatcher = new CollisionDispatcher();
ParallelIslandDispatcher* dispatcher2 = new ParallelIslandDispatcher();
//ParallelIslandDispatcher* dispatcher2 = new ParallelIslandDispatcher();
SimdVector3 worldAabbMin(-30000,-30000,-30000);
SimdVector3 worldAabbMax(30000,30000,30000);

View File

@@ -50,8 +50,8 @@ const int numObjects = 2;
PolyhedralConvexShape* shapePtr[maxNumObjects];
SimdTransform tr[numObjects];
int screenWidth = 640.f;
int screenHeight = 480.f;
int screenWidth = 640;
int screenHeight = 480;
void DrawRasterizerLine(float const* , float const*, int)
{

View File

@@ -33,4 +33,5 @@ class LinearConvexCastDemo : public DemoApplication
}
};
#endif //LINEAR_CONVEX_CAST_DEMO_H
#endif //LINEAR_CONVEX_CAST_DEMO_H

View File

@@ -75,7 +75,7 @@ void BMF_BitmapFont::DrawString(const char* str)
glGetIntegerv(GL_UNPACK_ALIGNMENT, &alignment);
glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
while (c = (unsigned char) *str++) {
while ((c = (unsigned char) *str++)) {
BMF_CharData & cd = m_fontData->chars[c];
if (cd.data_offset==-1) {
@@ -98,7 +98,7 @@ int BMF_BitmapFont::GetStringWidth(char* str)
unsigned char c;
int length = 0;
while (c = (unsigned char) *str++) {
while ((c = (unsigned char) *str++)) {
length += m_fontData->chars[c].advance;
}
@@ -182,7 +182,7 @@ void BMF_BitmapFont::DrawStringTexture(char *str, float x, float y, float z)
int baseLine = -(m_fontData->ymin);
glBegin(GL_QUADS);
while (c = (unsigned char) *str++) {
while ((c = (unsigned char) *str++)) {
BMF_CharData & cd = m_fontData->chars[c];
if (cd.data_offset != -1) {

View File

@@ -167,4 +167,5 @@ class DemoApplication
};
#endif //DEMO_APPLICATION_H
#endif //DEMO_APPLICATION_H

View File

@@ -151,7 +151,6 @@ void GL_ShapeDrawer::DrawOpenGL(float* m, const CollisionShape* shape, const Sim
case TRIANGLE_SHAPE_PROXYTYPE:
case TETRAHEDRAL_SHAPE_PROXYTYPE:
{
const BU_Simplex1to4* tetra = static_cast<const BU_Simplex1to4*>(shape);
//todo:
// useWireframeFallback = false;
break;

View File

@@ -51,21 +51,14 @@ void GL_Simplex1to4::CalcClosest(float* m)
bool res;
SimdVector3 v;
SimdPoint3 pBuf[4];
SimdPoint3 qBuf[4];
SimdPoint3 yBuf[4];
for (int i=0;i<m_numVertices;i++)
{
v = tr(m_vertices[i]);
m_simplexSolver->addVertex(v,v,SimdPoint3(0.f,0.f,0.f));
res = m_simplexSolver->closest(v);
int res = m_simplexSolver->getSimplex(pBuf, qBuf, yBuf);
}
//draw v?
glDisable(GL_LIGHTING);
glBegin(GL_LINES);

View File

@@ -42,7 +42,7 @@ void RenderTexture::Printf(char* str, BMF_FontData* fontData, int startx,int sta
unsigned char c;
int rasterposx = startx;
int rasterposy = starty;
while (c = (unsigned char) *str++) {
while ((c = (unsigned char) *str++)) {
BMF_CharData & cd = fontData->chars[c];
if (cd.data_offset!=-1) {

View File

@@ -110,9 +110,8 @@ void Raytracer::initPhysics()
SimdVector3(-0.5f, 0.6f, 0.f),
SimdVector3(0.f, 0.f, 0.f)
};
SimdScalar radi[NUM_SPHERES] = { 0.35f,0.35f,0.45f,0.40f,0.40f };
MultiSphereShape* multiSphereShape = new MultiSphereShape(inertiaHalfExtents,positions,radi,NUM_SPHERES);
// MultiSphereShape* multiSphereShape = new MultiSphereShape(inertiaHalfExtents,positions,radi,NUM_SPHERES);
ConvexHullShape* convexHullShape = new ConvexHullShape(positions,3);

View File

@@ -33,4 +33,6 @@ class Raytracer : public DemoApplication
}
};
#endif //RAYTRACER_H
#endif //RAYTRACER_H

View File

@@ -34,8 +34,8 @@ VoronoiSimplexSolver simplexSolver;
float yaw=0.f,pitch=0.f,roll=0.f;
const int maxNumObjects = 4;
const int numObjects = 1;
int screenWidth = 640.f;
int screenHeight = 480.f;
int screenWidth = 640;
int screenHeight = 480;
/// simplex contains the vertices, and some extra code to draw and debug
GL_Simplex1to4 simplex;
@@ -115,4 +115,6 @@ void SimplexDemo::initPhysics()
SimdTransform tr;
tr.setIdentity();
}
}

View File

@@ -33,4 +33,6 @@ class SimplexDemo : public DemoApplication
}
};
#endif //SIMPLEX_DEMO_H
#endif //SIMPLEX_DEMO_H

View File

@@ -137,7 +137,7 @@ void UserCollisionAlgorithm::initPhysics()
ConstraintSolver* solver = new SequentialImpulseConstraintSolver;
//ConstraintSolver* solver = new SequentialImpulseConstraintSolver;
CollisionDispatcher* dispatcher = new CollisionDispatcher();
@@ -163,7 +163,7 @@ void UserCollisionAlgorithm::initPhysics()
{
CollisionShape* sphereShape = new SphereShape(1);
startTransform.setOrigin(SimdVector3(1,2*i,1));
CcdPhysicsController* boxRigidBody = LocalCreatePhysicsObject(true, 1, startTransform,sphereShape);
LocalCreatePhysicsObject(true, 1, startTransform,sphereShape);
}
}
m_physicsEnvironmentPtr->setGravity(-1,-10,1);

View File

@@ -32,4 +32,5 @@ class UserCollisionAlgorithm : public DemoApplication
};
#endif //USER_COLLISION_ALGORITHM_DEMO_H
#endif //USER_COLLISION_ALGORITHM_DEMO_H