Warning fixes

This commit is contained in:
Robert Osfield 2018-09-11 15:32:44 +01:00
parent 7c1a967a02
commit 697131a39b
13 changed files with 36 additions and 28 deletions

View File

@ -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):

View File

@ -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++)

View File

@ -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:

View File

@ -644,6 +644,7 @@ bool SlideEventHandler::handle(const osgGA::GUIEventAdapter& ea,osgGA::GUIAction
}
_album->setVisibility();
return true;
}

View File

@ -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 ###

View File

@ -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)

View File

@ -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;

View File

@ -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,

View File

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

View File

@ -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) {

View File

@ -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);
}

View File

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

View File

@ -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)