From 1a0537e49321506dc4ec59bd2fa18ded15672812 Mon Sep 17 00:00:00 2001 From: Erik Hofman Date: Thu, 26 Jan 2017 15:37:43 +0100 Subject: [PATCH] Silence a few compiler warnings --- src/FDM/UIUCModel/uiuc_convert.cpp | 2 +- src/Input/FGEventInput.cxx | 12 ++++++------ src/Model/modelmgr.cxx | 17 ++++++++--------- src/Scripting/NasalSys.cxx | 3 ++- 4 files changed, 17 insertions(+), 17 deletions(-) diff --git a/src/FDM/UIUCModel/uiuc_convert.cpp b/src/FDM/UIUCModel/uiuc_convert.cpp index dd1e6d6c8..8a171db80 100644 --- a/src/FDM/UIUCModel/uiuc_convert.cpp +++ b/src/FDM/UIUCModel/uiuc_convert.cpp @@ -66,7 +66,7 @@ double uiuc_convert( int conversionType ) { - double factor; + double factor = 1; switch(conversionType) { diff --git a/src/Input/FGEventInput.cxx b/src/Input/FGEventInput.cxx index 07c5fe9f8..48bdc53b5 100644 --- a/src/Input/FGEventInput.cxx +++ b/src/Input/FGEventInput.cxx @@ -280,13 +280,13 @@ void FGInputDevice::update( double dt ) for( map::iterator it = handledEvents.begin(); it != handledEvents.end(); it++ ) (*it).second->update( dt ); - report_setting_list_t::const_iterator it; - for (it = reportSettings.begin(); it != reportSettings.end(); ++it) { - if ((*it)->Test()) { - std::string reportData = (*it)->reportBytes(nasalModule); - SendFeatureReport((*it)->getReportId(), reportData); - } + report_setting_list_t::const_iterator it; + for (it = reportSettings.begin(); it != reportSettings.end(); ++it) { + if ((*it)->Test()) { + std::string reportData = (*it)->reportBytes(nasalModule); + SendFeatureReport((*it)->getReportId(), reportData); } + } } void FGInputDevice::HandleEvent( FGEventData & eventData ) diff --git a/src/Model/modelmgr.cxx b/src/Model/modelmgr.cxx index 7fe04e0bb..552e5d16b 100644 --- a/src/Model/modelmgr.cxx +++ b/src/Model/modelmgr.cxx @@ -129,16 +129,15 @@ FGModelMgr::add_model (SGPropertyNode * node) else model->setHeadingDeg(node->getDoubleValue("heading-deg")); - - if (node->hasChild("enable-hot")) { - osg::Node::NodeMask mask = model->getSceneGraph()->getNodeMask(); - if (node->getBoolValue("enable-hot")) { - mask |= SG_NODEMASK_TERRAIN_BIT; - } else { - mask &= ~SG_NODEMASK_TERRAIN_BIT; - } - model->getSceneGraph()->setNodeMask(mask); + if (node->hasChild("enable-hot")) { + osg::Node::NodeMask mask = model->getSceneGraph()->getNodeMask(); + if (node->getBoolValue("enable-hot")) { + mask |= SG_NODEMASK_TERRAIN_BIT; + } else { + mask &= ~SG_NODEMASK_TERRAIN_BIT; } + model->getSceneGraph()->setNodeMask(mask); + } // Add this model to the global scene graph globals->get_scenery()->get_scene_graph()->addChild(model->getSceneGraph()); diff --git a/src/Scripting/NasalSys.cxx b/src/Scripting/NasalSys.cxx index d73e68a21..1940d038a 100644 --- a/src/Scripting/NasalSys.cxx +++ b/src/Scripting/NasalSys.cxx @@ -1220,7 +1220,8 @@ bool FGNasalSys::createModule(const char* moduleName, const char* fileName, naStr_fromdata(modname, (char*)moduleName, strlen(moduleName)); if (naIsNil(_globals)) return false; - if (!naHash_get(_globals, modname, &locals)) + + if (!naHash_get(_globals, modname, &locals)) locals = naNewHash(ctx); _cmdArg = (SGPropertyNode*)cmdarg;