Purge on warnings under Linux.

This commit is contained in:
Robert Osfield
2002-04-16 14:09:46 +00:00
parent f8340f9ef5
commit 2b4008bbbc
20 changed files with 4500 additions and 1562 deletions

View File

@@ -228,7 +228,7 @@ public:
if(ic>=nv) {
printf("Invalid vertices %d of %d. I1-3 %d %d %d.\n", ic, nv, i1, i2, i3);
}
if(i1>=verts.size() || i2>=verts.size() || i3>=verts.size()) {
if(i1>=static_cast<int>(verts.size()) || i2>=static_cast<int>(verts.size()) || i3>=static_cast<int>(verts.size())) {
printf("Invalid indices %d, %d, %d max allowed %d.\n", i1,i2,i3,verts.size());//, errm
}
s1=(verts[i2]-verts[i1]); // side 1 of face
@@ -769,7 +769,7 @@ private:
};
void _face::tesselate(const std::vector<Vec3> verts, const dwmaterial *themat,
GLUtesselator *ts, _dwobj *dwob, const Matrix *tmat) const {
GLUtesselator *ts, _dwobj *dwob, const Matrix * /*tmat*/) const {
int nvall=getallverts();
int nused=0;
avertex *poses=new avertex[2*nvall]; // passed to tesselator to redraw

View File

@@ -42,7 +42,7 @@ osgDB::ReaderWriter::WriteResult ReaderWriterDX::writeObject(
osgDB::ReaderWriter::WriteResult ReaderWriterDX::writeNode(
const osg::Node &node,
const std::string &filename,
const Options *options )
const Options *)
{
dx::WriterParms parms;
std::string messages;

View File

@@ -44,14 +44,14 @@ static char lib3ds_chunk_level[128]="";
static void
lib3ds_chunk_debug_enter(Lib3dsChunk *c)
lib3ds_chunk_debug_enter(Lib3dsChunk *)
{
strcat(lib3ds_chunk_level, " ");
}
static void
lib3ds_chunk_debug_leave(Lib3dsChunk *c)
lib3ds_chunk_debug_leave(Lib3dsChunk *)
{
lib3ds_chunk_level[strlen(lib3ds_chunk_level)-2]=0;
}
@@ -162,7 +162,7 @@ lib3ds_chunk_read_next(Lib3dsChunk *c, FILE *f)
* \ingroup chunk
*/
void
lib3ds_chunk_read_reset(Lib3dsChunk *c, FILE *f)
lib3ds_chunk_read_reset(Lib3dsChunk *, FILE *f)
{
fseek(f, -6, SEEK_CUR);
}

View File

@@ -108,7 +108,7 @@ lib3ds_light_dump(Lib3dsLight *light)
printf(" spot_aspect: %f\n", light->spot_aspect);
printf(" use_projector: %s\n", light->use_projector ? "yes" : "no");
printf(" projector: %s\n", light->projector);
printf(" spot_overshoot: %d\n", light->spot_overshoot);
printf(" spot_overshoot: %i\n", static_cast<int>(light->spot_overshoot));
printf(" ray_shadows: %s\n", light->ray_shadows ? "yes" : "no");
printf(" ray_bias: %f\n", light->ray_bias);
printf(" hot_spot: %f\n", light->hot_spot);

View File

@@ -255,7 +255,7 @@ texture_dump(const char *maptype, Lib3dsTextureMap *texture)
}
printf(" %s:\n", maptype);
printf(" name: %s\n", texture->name);
printf(" flags: %X\n", texture->flags);
printf(" flags: %ii\n", static_cast<unsigned int>(texture->flags));
printf(" percent: %f\n", texture->percent);
printf(" blur: %f\n", texture->blur);
printf(" scale: (%f, %f)\n", texture->scale[0], texture->scale[1]);
@@ -321,10 +321,10 @@ lib3ds_material_dump(Lib3dsMaterial *material)
texture_dump("reflection_map", &material->reflection_map);
texture_dump("reflection_mask", &material->reflection_mask);
printf(" autorefl_map:\n");
printf(" flags %X\n", material->autorefl_map.flags);
printf(" level %d\n", material->autorefl_map.level);
printf(" size %d\n", material->autorefl_map.size);
printf(" frame_step %d\n", material->autorefl_map.frame_step);
printf(" flags %X\n", static_cast<int>(material->autorefl_map.flags));
printf(" level %X\n", static_cast<int>(material->autorefl_map.level));
printf(" size %X\n", static_cast<int>(material->autorefl_map.size));
printf(" frame_step %d\n", static_cast<int>(material->autorefl_map.frame_step));
printf("\n");
}

View File

@@ -513,7 +513,7 @@ lib3ds_mesh_dump(Lib3dsMesh *mesh)
mesh->faceL[i].points[0],
mesh->faceL[i].points[1],
mesh->faceL[i].points[2],
mesh->faceL[i].smoothing
static_cast<int>(mesh->faceL[i].smoothing)
);
}
}

View File

@@ -407,7 +407,7 @@ lib3ds_node_dump(Lib3dsNode *node, Lib3dsIntd level)
* \ingroup node
*/
Lib3dsBool
lib3ds_node_read(Lib3dsNode *node, Lib3dsFile *file, FILE *f)
lib3ds_node_read(Lib3dsNode *node, Lib3dsFile *, FILE *f)
{
Lib3dsChunk c;
Lib3dsWord chunk;

View File

@@ -1364,7 +1364,7 @@ lib3ds_morph_track_eval(Lib3dsMorphTrack *track, char *p, Lib3dsFloat t)
* \ingroup tracks
*/
Lib3dsBool
lib3ds_morph_track_read(Lib3dsMorphTrack *track, FILE *f)
lib3ds_morph_track_read(Lib3dsMorphTrack *, FILE *)
{
/* FIXME: */
return(LIB3DS_TRUE);
@@ -1375,7 +1375,7 @@ lib3ds_morph_track_read(Lib3dsMorphTrack *track, FILE *f)
* \ingroup tracks
*/
Lib3dsBool
lib3ds_morph_track_write(Lib3dsMorphTrack *track, FILE *f)
lib3ds_morph_track_write(Lib3dsMorphTrack *, FILE *)
{
/* FIXME: */
ASSERT(0);

View File

@@ -114,7 +114,7 @@ class ReaderWriterPNG : public osgDB::ReaderWriter
png_read_image(png, row_p);
free(row_p);
int iBitCount;
int iBitCount=0;
if (trans == PNG_SOLID || trans == PNG_ALPHA || color == PNG_COLOR_TYPE_RGB_ALPHA || color == PNG_COLOR_TYPE_GRAY_ALPHA)
{
@@ -134,7 +134,9 @@ class ReaderWriterPNG : public osgDB::ReaderWriter
break;
default:
return ReadResult::FILE_NOT_HANDLED;
// error, will force return of ReadResult::FILE_NOT_HANDLED
// see below.
iBitCount = 0;
}
}
@@ -146,6 +148,9 @@ class ReaderWriterPNG : public osgDB::ReaderWriter
if (fp)
fclose(fp);
if (iBitCount==0)
return ReadResult::FILE_NOT_HANDLED;
osg::Image* pOsgImage = new osg::Image();
pOsgImage->setFileName(fileName.c_str());