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

@@ -137,7 +137,15 @@ SOURCE=..\..\..\src\Demos\hangglide\Hat.h
# End Source File
# Begin Source File
SOURCE=..\..\..\src\Demos\hangglide\terrain_data.h
SOURCE=..\..\..\src\Demos\hangglide\terrain_coords.h
# End Source File
# Begin Source File
SOURCE=..\..\..\src\Demos\hangglide\terrain_normals.h
# End Source File
# Begin Source File
SOURCE=..\..\..\src\Demos\hangglide\terrain_texcoords.h
# End Source File
# End Group
# Begin Group "Resource Files"

View File

@@ -15,7 +15,9 @@ CXXFILES =\
HEADERFILES = \
GliderManipulator.h\
hat.h\
terrain_data.h\
terrain_coords.h\
terrain_normals.h\
terrain_texcoords.h\
LIBS += $(OSG_LIBS) $(GLUT_LIB) $(GL_LIBS) $(X_LIBS) $(OTHER_LIBS)

View File

@@ -7,7 +7,7 @@
#include <osg/Math>
#include <stdio.h>
#include "terrain_data.h"
#include "terrain_coords.h"
#include "hat.h"
static int inited = 0;

View File

@@ -8,7 +8,8 @@
#include <osgDB/ReadFile>
#include "terrain_data.h"
#include "terrain_coords.h"
#include "terrain_texcoords.h"
using namespace osg;

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -2,7 +2,7 @@
#include <osg/Version>
int main( int argc, char **argv )
int main( int, char **)
{
printf( "%s\n", osgGetVersion() );
return 0;

View File

@@ -40,14 +40,9 @@ Image::Image(const Image& image,const CopyOp& copyop):
{
if (image._data)
{
int num_components =
_pixelFormat == GL_LUMINANCE ? 1 :
_pixelFormat == GL_LUMINANCE_ALPHA ? 2 :
_pixelFormat == GL_RGB ? 3 :
_pixelFormat == GL_RGBA ? 4 : 4;
unsigned int size = computeRowWidthInBytes(_s,_pixelFormat,_dataType,_packing)*_t*_r;
int size = _s*_t*_r*num_components;
_data = (unsigned char*) malloc(size);
_data = (unsigned char*) osgMalloc(size);
memcpy(_data,image._data,size);
}
}
@@ -117,7 +112,7 @@ const unsigned int Image::computeNumComponents(GLenum type)
case(GL_RGBA): return 4;
case(GL_BGRA): return 4;
case(GL_LUMINANCE): return 1;
case(GL_LUMINANCE_ALPHA): return 1;
case(GL_LUMINANCE_ALPHA): return 2;
default: return 0;
}
}
@@ -181,7 +176,7 @@ void Image::createImage(int s,int t,int r,
if (_data) ::free(_data);
if (newTotalSize)
_data = (unsigned char *)malloc (newTotalSize);
_data = (unsigned char *)osgMalloc (newTotalSize);
else
_data = 0L;
}
@@ -265,7 +260,7 @@ void Image::scaleImage(const int s,const int t,const int r)
unsigned int newTotalSize = computeRowWidthInBytes(s,_pixelFormat,_dataType,_packing)*t;
// need to sort out what size to really use...
unsigned char* newData = (unsigned char *)malloc(newTotalSize);
unsigned char* newData = (unsigned char *)osgMalloc(newTotalSize);
if (!newData)
{
// should we throw an exception??? Just return for time being.

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());

View File

@@ -61,7 +61,7 @@ FT_Vector& FTGlyphContainer::render( unsigned int index, unsigned int next, FT_V
if (left<glyphs.size()) advance = glyphs[left]->Render( pen);
}
kernAdvance.x = advance + kernAdvance.x;
kernAdvance.x = static_cast<FT_Pos>(advance) + kernAdvance.x;
// kernAdvance.y = advance.y + kernAdvance.y;
return kernAdvance;
}

View File

@@ -33,7 +33,7 @@ void CALLBACK ftglEnd()
}
void CALLBACK ftglCombine( GLdouble coords[3], void* vertex_data[4], GLfloat weight[4], void** outData)
void CALLBACK ftglCombine( GLdouble coords[3], void* /*vertex_data*/[4], GLfloat /*weight*/[4], void** outData)
{
double* vertex = osgNew double[3]; // FIXME MEM LEAK