diff --git a/src/Main/CameraGroup.cxx b/src/Main/CameraGroup.cxx index 04ab9e135..9ba93143d 100644 --- a/src/Main/CameraGroup.cxx +++ b/src/Main/CameraGroup.cxx @@ -298,7 +298,6 @@ CameraInfo* CameraGroup::buildCamera(SGPropertyNode* cameraNode) WindowBuilder *wBuild = WindowBuilder::getWindowBuilder(); const SGPropertyNode* windowNode = cameraNode->getNode("window"); GraphicsWindow* window = 0; - static int cameraNum = 0; int cameraFlags = DO_INTERSECTION_TEST; if (windowNode) { // New style window declaration / definition @@ -400,7 +399,6 @@ CameraInfo* CameraGroup::buildGUICamera(SGPropertyNode* cameraNode, const SGPropertyNode* windowNode = (cameraNode ? cameraNode->getNode("window") : 0); - static int cameraNum = 0; if (!window) { if (windowNode) { // New style window declaration / definition diff --git a/src/Main/fg_io.cxx b/src/Main/fg_io.cxx index 7d904d6f9..3ab62f82d 100644 --- a/src/Main/fg_io.cxx +++ b/src/Main/fg_io.cxx @@ -187,7 +187,7 @@ FGIO::parse_port_config( const string& config ) FGRUL *rul = new FGRUL; io = rul; } else if ( protocol == "generic" ) { - int configToken; + size_t configToken; if (tokens[1] == "socket") { configToken = 7; } else if (tokens[1] == "file") { diff --git a/src/Main/fg_os_osgviewer.cxx b/src/Main/fg_os_osgviewer.cxx index 058e31469..66d2622a8 100644 --- a/src/Main/fg_os_osgviewer.cxx +++ b/src/Main/fg_os_osgviewer.cxx @@ -79,9 +79,6 @@ static osg::ref_ptr mainCamera; void fgOSOpenWindow(bool stencil) { - osg::GraphicsContext::WindowingSystemInterface* wsi - = osg::GraphicsContext::getWindowingSystemInterface(); - viewer = new osgViewer::Viewer; viewer->setDatabasePager(FGScenery::getPagerSingleton()); CameraGroup* cameraGroup = 0; diff --git a/src/Main/fgviewer.cxx b/src/Main/fgviewer.cxx index 08ecdec5a..b1a399e19 100644 --- a/src/Main/fgviewer.cxx +++ b/src/Main/fgviewer.cxx @@ -72,8 +72,6 @@ static void dumpOut(osg::Node* node) char filename[24]; static int count = 1; - FGRenderer *renderer = globals->get_renderer(); - while (count < 1000) { FILE *fp; snprintf(filename, 24, "fgviewer-%03d.osg", count++); diff --git a/src/Main/globals.cxx b/src/Main/globals.cxx index 0b550b46c..b73056476 100644 --- a/src/Main/globals.cxx +++ b/src/Main/globals.cxx @@ -67,6 +67,9 @@ FGGlobals *globals; // Constructor FGGlobals::FGGlobals() : + props( new SGPropertyNode ), + initial_state( NULL ), + locale( NULL ), renderer( new FGRenderer ), subsystem_mgr( new SGSubsystemMgr ), event_mgr( new SGEventMgr ), @@ -85,9 +88,6 @@ FGGlobals::FGGlobals() : AI_mgr( NULL ), controls( NULL ), viewmgr( NULL ), - props( new SGPropertyNode ), - initial_state( NULL ), - locale( NULL ), commands( SGCommandMgr::instance() ), acmodel( NULL ), model_mgr( NULL ), diff --git a/src/Main/options.cxx b/src/Main/options.cxx index 685d61ff1..26054af82 100644 --- a/src/Main/options.cxx +++ b/src/Main/options.cxx @@ -996,7 +996,7 @@ fgOptRandomWind( const char *arg ) static int fgOptWind( const char *arg ) { - double min_hdg, max_hdg, speed, gust; + double min_hdg = 0.0, max_hdg = 0.0, speed = 0.0, gust = 0.0; if (!parse_wind( arg, &min_hdg, &max_hdg, &speed, &gust)) { SG_LOG( SG_GENERAL, SG_ALERT, "bad wind value " << arg ); return FG_OPTIONS_ERROR; @@ -1815,9 +1815,9 @@ unsigned int getNumMaturity(const char * str) { // changes should also be reflected in $FG_ROOT/data/options.xml & // $FG_ROOT/data/Translations/string-default.xml - const char levels[][20]= {"alpha","beta","early-production","production",0}; + const char* levels[] = {"alpha","beta","early-production","production"}; - for (unsigned int i=0; i<(sizeof(levels)/sizeof(levels[0])-1);i++) + for (size_t i=0; i<(sizeof(levels)/sizeof(levels[0]));i++) if (strcmp(str,levels[i])==0) return i; diff --git a/src/Main/renderer.cxx b/src/Main/renderer.cxx index f1458ead5..b222ca0fd 100644 --- a/src/Main/renderer.cxx +++ b/src/Main/renderer.cxx @@ -542,9 +542,6 @@ FGRenderer::update( bool refresh_camera_settings ) { SGConfigureDirectionalLights( use_point_sprites, enhanced_lighting, distance_attenuation ); - static const SGPropertyNode *groundlevel_nearplane - = fgGetNode("/sim/current-view/ground-level-nearplane-m"); - FGLight *l = static_cast(globals->get_subsystem("lighting")); // update fog params @@ -766,7 +763,6 @@ bool FGRenderer::pick(std::vector& pickList, const osgGA::GUIEventAdapter* ea) { - osgViewer::Viewer* viewer = globals->get_renderer()->getViewer(); // wipe out the return ... pickList.clear(); typedef osgUtil::LineSegmentIntersector::Intersections Intersections;