diff --git a/CMakeLists.txt b/CMakeLists.txt index 16380bc26..268449e14 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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 diff --git a/bsa/bsa_file.cpp b/bsa/bsa_file.cpp index 7a7600ad1..a6bf47848 100644 --- a/bsa/bsa_file.cpp +++ b/bsa/bsa_file.cpp @@ -129,7 +129,7 @@ void BSAFile::readHeader() // Set up the the FileStruct table files.resize(filenum); - for(int i=0;isecond; - assert(res >= 0 && res < files.size()); + assert(res >= 0 && res < static_cast (files.size())); return res; } } diff --git a/esm/esm_reader.hpp b/esm/esm_reader.hpp index 52f67fea0..85d956689 100644 --- a/esm/esm_reader.hpp +++ b/esm/esm_reader.hpp @@ -394,7 +394,7 @@ public: void getHExact(void*p, int size) { getSubHeader(); - if(size != c.leftSub) + if(size !=static_cast (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 (c.leftSub) != size) fail("skipHSubSize() mismatch"); } @@ -508,7 +508,7 @@ public: void getSubHeaderIs(int size) { getSubHeader(); - if(size != c.leftSub) + if(size != static_cast (c.leftSub)) fail("getSubHeaderIs(): Sub header mismatch"); } diff --git a/game/mwrender/playerpos.hpp b/game/mwrender/playerpos.hpp index cf1d02092..47175651c 100644 --- a/game/mwrender/playerpos.hpp +++ b/game/mwrender/playerpos.hpp @@ -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) diff --git a/input/listener.hpp b/input/listener.hpp index 5b9d4fb49..ef4cce57f 100644 --- a/input/listener.hpp +++ b/input/listener.hpp @@ -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(); diff --git a/nif/data.hpp b/nif/data.hpp index d7d233dff..920c7cf45 100644 --- a/nif/data.hpp +++ b/nif/data.hpp @@ -198,7 +198,7 @@ struct NiPosData : Record // translation in NiKeyframeData. for(int i=0; igetFloat(); + /*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; igetInt(); - int y = nif->getInt(); - int offset = nif->getInt(); + /*int x =*/ nif->getInt(); + /*int y =*/ nif->getInt(); + /*int offset =*/ nif->getInt(); } // Skip the data diff --git a/nif/extra.hpp b/nif/extra.hpp index 64c512509..788fe3113 100644 --- a/nif/extra.hpp +++ b/nif/extra.hpp @@ -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 diff --git a/nif/nif_file.cpp b/nif/nif_file.cpp index 0decd77e1..dc7fc2ed8 100644 --- a/nif/nif_file.cpp +++ b/nif/nif_file.cpp @@ -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 (data->bones.size())) nif->fail("Mismatch in NiSkinData bone count"); root->makeRootBone(data->trafo); diff --git a/nif/nif_file.hpp b/nif/nif_file.hpp index a827758d4..a1c34b3bb 100644 --- a/nif/nif_file.hpp +++ b/nif/nif_file.hpp @@ -95,7 +95,7 @@ class NIFFile ~NIFFile() { - for(int i=0; i= 0 && index < records.size()); + assert(index >= 0 && index < static_cast (records.size())); Record *res = records[index]; assert(res != NULL); return res; diff --git a/nif/property.hpp b/nif/property.hpp index c17bcfe62..3500a25b7 100644 --- a/nif/property.hpp +++ b/nif/property.hpp @@ -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 } diff --git a/nif/record_ptr.hpp b/nif/record_ptr.hpp index 3011aaa17..c5618941e 100644 --- a/nif/record_ptr.hpp +++ b/nif/record_ptr.hpp @@ -118,13 +118,13 @@ class RecordListT X& operator[](int index) { - assert(index >= 0 && index < list.size()); + assert(index >= 0 && index < static_cast (list.size())); return list[index].get(); } bool has(int index) { - assert(index >= 0 && index < list.size()); + assert(index >= 0 && index < static_cast (list.size())); return !list[index].empty(); } diff --git a/nifogre/ogre_nif_loader.cpp b/nifogre/ogre_nif_loader.cpp index de00b443f..ba88e86ae 100644 --- a/nifogre/ogre_nif_loader.cpp +++ b/nifogre/ogre_nif_loader.cpp @@ -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);