increased warning level for gcc; fixed code to remove resulting warnings (except mangle)

actorid
Marc Zinnschlag 15 years ago
parent 518ddab30e
commit 261af208cd

@ -103,6 +103,11 @@ if (APPLE)
)
endif (APPLE)
# Compiler settings
if (CMAKE_COMPILER_IS_GNUCC)
add_definitions (-Wall)
endif (CMAKE_COMPILER_IS_GNUCC)
# Main executable
add_executable(openmw
MACOSX_BUNDLE

@ -129,7 +129,7 @@ void BSAFile::readHeader()
// Set up the the FileStruct table
files.resize(filenum);
for(int i=0;i<filenum;i++)
for(size_t i=0;i<filenum;i++)
{
FileStruct &fs = files[i];
fs.fileSize = offsets[i*2];
@ -156,7 +156,7 @@ int BSAFile::getIndex(const char *str)
else
{
int res = it->second;
assert(res >= 0 && res < files.size());
assert(res >= 0 && res < static_cast<int> (files.size()));
return res;
}
}

@ -394,7 +394,7 @@ public:
void getHExact(void*p, int size)
{
getSubHeader();
if(size != c.leftSub)
if(size !=static_cast<int> (c.leftSub))
fail("getHExact() size mismatch");
getExact(p,size);
}
@ -480,7 +480,7 @@ public:
void skipHSubSize(int size)
{
skipHSub();
if(c.leftSub != size)
if(static_cast<int> (c.leftSub) != size)
fail("skipHSubSize() mismatch");
}
@ -508,7 +508,7 @@ public:
void getSubHeaderIs(int size)
{
getSubHeader();
if(size != c.leftSub)
if(size != static_cast<int> (c.leftSub))
fail("getSubHeaderIs(): Sub header mismatch");
}

@ -15,7 +15,7 @@ namespace MWRender
public:
PlayerPos(Ogre::Camera *cam) :
camera(cam), x(0), y(0), z(0) {}
x(0), y(0), z(0), camera(cam) {}
// Set the player position. Uses Morrowind coordinates.
void setPos(float _x, float _y, float _z)

@ -17,7 +17,7 @@ namespace Input
InputListener(Render::OgreRenderer &rend,
Input::OISManager &input,
const Input::Dispatcher &_disp)
: doExit(false), disp(_disp)
: disp(_disp), doExit(false)
{
// Set up component pointers
mWindow = rend.getWindow();

@ -198,7 +198,7 @@ struct NiPosData : Record
// translation in NiKeyframeData.
for(int i=0; i<count; i++)
{
float time = nif->getFloat();
/*float time =*/ nif->getFloat();
nif->getVector(); // This isn't really shared between type 1
// and type 2, most likely
if(type == 2)
@ -267,14 +267,14 @@ struct NiPixelData : Record
mips = nif->getInt();
// Bytes per pixel, should be bpp * 8
int bytes = nif->getInt();
/*int bytes =*/ nif->getInt();
for(int i=0; i<mips; i++)
{
// Image size and offset in the following data field
int x = nif->getInt();
int y = nif->getInt();
int offset = nif->getInt();
/*int x =*/ nif->getInt();
/*int y =*/ nif->getInt();
/*int offset =*/ nif->getInt();
}
// Skip the data

@ -50,7 +50,7 @@ struct NiVertWeightsExtraData : Extra
// We should have s*4+2 == i, for some reason. Might simply be the
// size of the rest of the record, unhelpful as that may be.
int i = nif->getInt();
/*int i =*/ nif->getInt();
int s = nif->getShort(); // number of vertices
nif->getFloatLen(s); // vertex weights I guess

@ -178,7 +178,7 @@ void NIFFile::parse()
void NiSkinInstance::post(NIFFile *nif)
{
int bnum = bones.length();
if(bnum != data->bones.size())
if(bnum != static_cast<int> (data->bones.size()))
nif->fail("Mismatch in NiSkinData bone count");
root->makeRootBone(data->trafo);

@ -95,7 +95,7 @@ class NIFFile
~NIFFile()
{
for(int i=0; i<records.size(); i++)
for(std::size_t i=0; i<records.size(); i++)
{
delete records[i];
}
@ -104,7 +104,7 @@ class NIFFile
/// Get a given record
Record *getRecord(int index)
{
assert(index >= 0 && index < records.size());
assert(index >= 0 && index < static_cast<int> (records.size()));
Record *res = records[index];
assert(res != NULL);
return res;

@ -122,9 +122,9 @@ struct NiTexturingProperty : Property
if(textures[5].inUse)
{
// Ignore these at the moment
float lumaScale = nif->getFloat();
float lumaOffset = nif->getFloat();
const Vector4 *lumaMatrix = nif->getVector4();
/*float lumaScale =*/ nif->getFloat();
/*float lumaOffset =*/ nif->getFloat();
/*const Vector4 *lumaMatrix =*/ nif->getVector4();
}
textures[6].read(nif); // Decal
}

@ -118,13 +118,13 @@ class RecordListT
X& operator[](int index)
{
assert(index >= 0 && index < list.size());
assert(index >= 0 && index < static_cast<int> (list.size()));
return list[index].get();
}
bool has(int index)
{
assert(index >= 0 && index < list.size());
assert(index >= 0 && index < static_cast<int> (list.size()));
return !list[index].empty();
}

@ -193,7 +193,7 @@ static void createMaterial(const String &name,
if(!texName.empty())
{
Pass *pass = material->getTechnique(0)->getPass(0);
TextureUnitState *txt = pass->createTextureUnitState(texName);
/*TextureUnitState *txt =*/ pass->createTextureUnitState(texName);
/* As of yet UNTESTED code from Chris:
pass->setTextureFiltering(Ogre::TFO_ANISOTROPIC);

Loading…
Cancel
Save