diff --git a/examples/osgcatch/osgcatch.cpp b/examples/osgcatch/osgcatch.cpp index 8108ed3fc..1aae952f2 100644 --- a/examples/osgcatch/osgcatch.cpp +++ b/examples/osgcatch/osgcatch.cpp @@ -971,9 +971,7 @@ bool GameEventHandler::handle(const osgGA::GUIEventAdapter& ea,osgGA::GUIActionA { createNewCatchable(); } - - - + break; } case(osgGA::GUIEventAdapter::KEYDOWN): { @@ -987,6 +985,7 @@ bool GameEventHandler::handle(const osgGA::GUIEventAdapter& ea,osgGA::GUIActionA _rightKeyPressed=true; return true; } + break; } case(osgGA::GUIEventAdapter::KEYUP): { @@ -1000,6 +999,7 @@ bool GameEventHandler::handle(const osgGA::GUIEventAdapter& ea,osgGA::GUIActionA _rightKeyPressed=false; return true; } + break; } case(osgGA::GUIEventAdapter::DRAG): case(osgGA::GUIEventAdapter::MOVE): diff --git a/examples/osgfont/osgfont.cpp b/examples/osgfont/osgfont.cpp index bad750798..f0f54e59b 100644 --- a/examples/osgfont/osgfont.cpp +++ b/examples/osgfont/osgfont.cpp @@ -12,11 +12,6 @@ void textInfo(osgText::Text* text) { - const osgText::Text::TextureGlyphQuadMap& tgqm = text->getTextureGlyphQuadMap(); - - const osgText::Text::TextureGlyphQuadMap::const_iterator tgqmi = tgqm.begin(); - - osgText::String& s = text->getText(); for(unsigned int i = 0; i < s.size(); i++) diff --git a/examples/osgoscdevice/osgoscdevice.cpp b/examples/osgoscdevice/osgoscdevice.cpp index d0d8e2972..c201c4462 100644 --- a/examples/osgoscdevice/osgoscdevice.cpp +++ b/examples/osgoscdevice/osgoscdevice.cpp @@ -109,8 +109,9 @@ bool PickHandler::handle(const osgGA::GUIEventAdapter& ea,osgGA::GUIActionAdapte user_event->setName("osc_test_1"); _device->sendEvent(*user_event); + return true; } - + return false; } default: diff --git a/examples/osgphotoalbum/osgphotoalbum.cpp b/examples/osgphotoalbum/osgphotoalbum.cpp index b4bfe5800..545c7d1c3 100644 --- a/examples/osgphotoalbum/osgphotoalbum.cpp +++ b/examples/osgphotoalbum/osgphotoalbum.cpp @@ -644,6 +644,7 @@ bool SlideEventHandler::handle(const osgGA::GUIEventAdapter& ea,osgGA::GUIAction } _album->setVisibility(); + return true; } diff --git a/src/osgPlugins/exr/CMakeLists.txt b/src/osgPlugins/exr/CMakeLists.txt index e2ed9bb65..6191ed18f 100644 --- a/src/osgPlugins/exr/CMakeLists.txt +++ b/src/osgPlugins/exr/CMakeLists.txt @@ -5,9 +5,9 @@ SET(TARGET_SRC ReaderWriterEXR.cpp ) SET(TARGET_LIBRARIES_VARS ${OPENEXR_LIBRARIES_VARS} ${ILMBASE_LIBRARIES_VARS} ZLIB_LIBRARIES) -IF(CMAKE_COMPILER_IS_GNUCXX) - # Remove -Wshadow flag as it barfs on ffmoeg headers - STRING(REGEX REPLACE "-Wshadow" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") +IF(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID STREQUAL "Clang") + REMOVE_CXX_FLAG(-Wshadow) + SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-deprecated") ENDIF() #### end var setup ### diff --git a/src/osgPlugins/gdal/CMakeLists.txt b/src/osgPlugins/gdal/CMakeLists.txt index 73947a1bd..f1b670701 100644 --- a/src/osgPlugins/gdal/CMakeLists.txt +++ b/src/osgPlugins/gdal/CMakeLists.txt @@ -12,5 +12,11 @@ SET(TARGET_H SET(TARGET_LIBRARIES_VARS GDAL_LIBRARY ) SET(TARGET_ADDED_LIBRARIES osgTerrain ) +IF(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID STREQUAL "Clang") + REMOVE_CXX_FLAG(-Wunused-result) + SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-deprecated") + SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unused-result") +ENDIF() + #### end var setup ### SETUP_PLUGIN(gdal) diff --git a/src/osgPlugins/lwo/Surface.cpp b/src/osgPlugins/lwo/Surface.cpp index 75f84f06e..6432a5018 100644 --- a/src/osgPlugins/lwo/Surface.cpp +++ b/src/osgPlugins/lwo/Surface.cpp @@ -239,7 +239,8 @@ void Surface::generate_stateset(unsigned int max_tex_units, bool force_arb_compr break; case Block::SUBTRACTIVE: - OSG_WARN << "Warning: lwosg::Surface: 'Subtractive' blending mode is not supported, falling back to 'Difference' mode" << std::endl; + OSG_WARN << "Warning: lwosg::Surface: 'Subtractive' blending mode is not supported." << std::endl; + break; case Block::DIFFERENCE: tec->setCombine_RGB(osg::TexEnvCombine::SUBTRACT); break; diff --git a/src/osgPlugins/txp/ReaderWriterTXP.cpp b/src/osgPlugins/txp/ReaderWriterTXP.cpp index 8693ba742..091c690de 100644 --- a/src/osgPlugins/txp/ReaderWriterTXP.cpp +++ b/src/osgPlugins/txp/ReaderWriterTXP.cpp @@ -276,7 +276,7 @@ osgDB::ReaderWriter::ReadResult ReaderWriterTXP::local_readNode(const std::strin std::string childInfoStr; createChildrenLocationString(childrenChildLoc, childInfoStr); - char pagedLODfile[1024]; + char pagedLODfile[1084]; sprintf(pagedLODfile,"%s\\subtiles%d_%dx%d_%d%s.txp", archive->getDir(), loc.lod, @@ -380,7 +380,7 @@ osgDB::ReaderWriter::ReadResult ReaderWriterTXP::local_readNode(const std::strin if (tileLOD < (numLods-1)) { - char pagedLODfile[1024]; + char pagedLODfile[1094]; sprintf(pagedLODfile,"%s\\subtiles%d_%dx%d_%d.txp", archive->getDir(), tileLOD, diff --git a/src/osgPlugins/txp/TXPNode.cpp b/src/osgPlugins/txp/TXPNode.cpp index 165aaad64..3c57f9851 100644 --- a/src/osgPlugins/txp/TXPNode.cpp +++ b/src/osgPlugins/txp/TXPNode.cpp @@ -294,7 +294,7 @@ osg::Node* TXPNode::addPagedLODTile(int x, int y) // If you look at the code that calls it, it is effectively called only when // lod = 0. So all is OK int lod = 0; - char pagedLODfile[1024]; + char pagedLODfile[1070]; sprintf(pagedLODfile,"%s\\tile%d_%dx%d_%d.txp",_archive->getDir(),lod,x,y,_archive->getId()); diff --git a/src/osgPlugins/txp/trpage_rarchive.cpp b/src/osgPlugins/txp/trpage_rarchive.cpp index 7aee0c129..780463cc5 100644 --- a/src/osgPlugins/txp/trpage_rarchive.cpp +++ b/src/osgPlugins/txp/trpage_rarchive.cpp @@ -63,7 +63,7 @@ void trpgr_Archive::SetDirectory(const char *in_dir) // Open the given file and look for the file specific info bool trpgr_Archive::OpenFile(const char *name) { - char file[1024]; + char file[1025]; sprintf(file,"%s" PATHSEPERATOR "%s",dir,name); CloseFile(); @@ -138,7 +138,7 @@ bool trpgr_Archive::ReadSubArchive(int row, int col, trpgEndian cpuNess) trpgHeader blockHeader; trpgr_Parser bparser; - char blockpath[1024]; + char blockpath[1060]; //open the block archive // the block archive will be in the base dir + \\cols\\row\\archive.txp sprintf(blockpath,"%s%s%d%s%d%sarchive.txp",dir,PATHSEPERATOR,col,PATHSEPERATOR,row,PATHSEPERATOR); @@ -325,7 +325,7 @@ bool trpgr_Archive::ReadHeader(bool readAllBlocks) tileTable.GetMode(tileMode); if (tileMode == trpgTileTable::Local) { if (tileCache) delete tileCache; - char fullBase[1024]; + char fullBase[1060]; sprintf(fullBase,"%s" PATHSEPERATOR "tileFile",dir); tileCache = GetNewRAppFileCache(fullBase,"tpf"); } @@ -390,7 +390,7 @@ bool trpgr_Archive::ReadTile(uint32 x,uint32 y,uint32 lod,trpgMemReadBuffer &buf bool trpgr_Archive::ReadExternalTile(uint32 x,uint32 y,uint32 lod,trpgMemReadBuffer &buf) { // Figure out the file name - char filename[1024]; + char filename[1069]; int majorVer,minorVer; header.GetVersion(majorVer,minorVer); if((majorVer >= TRPG_NOMERGE_VERSION_MAJOR) && (minorVer >= TRPG_NOMERGE_VERSION_MINOR)) { @@ -554,7 +554,7 @@ void trpgrImageHelper::Init(trpgEndian inNess,char *inDir, // Set up the texture cache // It doesn't do anything until it's called anyway - char fullBase[1024]; + char fullBase[1035]; sprintf(fullBase,"%s" PATHSEPERATOR "texFile",dir); texCache = GetNewRAppFileCache(fullBase,"txf"); if(sepGeoTyp) { diff --git a/src/osgPlugins/txp/trpage_readbuf.cpp b/src/osgPlugins/txp/trpage_readbuf.cpp index 537f3f6f8..0fd5346bd 100644 --- a/src/osgPlugins/txp/trpage_readbuf.cpp +++ b/src/osgPlugins/txp/trpage_readbuf.cpp @@ -681,7 +681,7 @@ trpgrAppFile *trpgrAppFileCache::GetFile(trpgEndian ness,int id,int col,int row) OpenFile &of = files[oldID]; if (of.afile) delete of.afile; - char fileName[1024]; + char fileName[1056]; if(col==-1) { sprintf(fileName,"%s_%d.%s",baseName,id,ext); } diff --git a/src/osgPlugins/txp/trpage_warchive.cpp b/src/osgPlugins/txp/trpage_warchive.cpp index 2f7dcae22..bb9ece0e7 100644 --- a/src/osgPlugins/txp/trpage_warchive.cpp +++ b/src/osgPlugins/txp/trpage_warchive.cpp @@ -408,7 +408,7 @@ trpgLabelPropertyTable *trpgwArchive::GetLabelPropertyTable() // Same as above, only gets a basename as well bool trpgwArchive::OpenFile(const char *in_dir,const char *name) { - char filename[1024]; + char filename[1025]; strncpy(dir,in_dir,1023); @@ -773,7 +773,7 @@ bool trpgwArchive::IncrementTileFile() } // Open the next one - char filename[1024]; + char filename[1049]; sprintf(filename,"%s" PATHSEPERATOR "tileFile_%d.tpf",dir,tileFileCount++); tileFile = GetNewWAppFile(ness,filename,true); if (!tileFile->isValid()) @@ -802,7 +802,7 @@ bool trpgwArchive::DesignateTileFile(int id) } // Open a named on - char filename[1024]; + char filename[1049]; sprintf(filename,"%s" PATHSEPERATOR "tileFile_%d.tpf",dir,id); tileFile = GetNewWAppFile(ness,filename); if (!tileFile->isValid()) @@ -834,7 +834,7 @@ bool trpgwArchive::WriteTile(unsigned int x,unsigned int y,unsigned int lod, flo // External tiles get their own individual files if (tileMode == TileExternal || tileMode == TileExternalSaved) { // Make a new filename - char filename[1024]; + char filename[1069]; // Note: Windows specific sprintf(filename,"%s" PATHSEPERATOR "tile_%d_%d_%d.tpt",dir,x,y,lod); if (!(tfp = osgDB::fopen(filename,"wb"))) @@ -1502,7 +1502,7 @@ trpgwAppFile* trpgwImageHelper::GetNewWAppFile(trpgEndian inNess,const char *fil */ trpgwAppFile * trpgwImageHelper::IncrementTextureFile(bool geotyp) { - char filename[1024]; + char filename[1049]; trpgwAppFile *thefile = texFile; if(geotyp && separateGeoTypical) { @@ -1553,7 +1553,7 @@ bool trpgwImageHelper::DesignateTextureFile(int id) texFile = NULL; // Open one with the given base name - char filename[1024]; + char filename[1044]; sprintf(filename,"%s" PATHSEPERATOR "texFile_%d.txf",dir,id); texFile = GetNewWAppFile(ness,filename); if (!texFile->isValid()) diff --git a/src/osgPlugins/zip/CMakeLists.txt b/src/osgPlugins/zip/CMakeLists.txt index 93b2fc24d..e805b4181 100644 --- a/src/osgPlugins/zip/CMakeLists.txt +++ b/src/osgPlugins/zip/CMakeLists.txt @@ -11,4 +11,8 @@ SET(TARGET_H ADD_DEFINITIONS(-DZIP_STD) +IF(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID STREQUAL "Clang") + SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-implicit-fallthrough") +ENDIF() + SETUP_PLUGIN(zip)