Attached are two patches: one for simgear, and one for flightgear. The changes are mostly minor except for a few fixes to uninitialized variables found by valgrind. Here's the list of changes:
== Changes in simgear-cleanups.diff: simgear/misc/props.cxx * Rearranged member initializers to shut gcc -Wall up simgear/sky/sky.cxx * Fixed (un)signed comparison == Changes in flightgear-cleanups.diff: src/Autopilot/newauto.cxx * Fixed uninitialized MaxAileron value (set to 0.5) src/Cockpit/kr_87.cxx * Fixed uninitialized values src/Cockpit/steam.cxx * Rearranged member initializers to shut gcc -Wall up src/Input/input.cxx * Fixed (un)signed comparisons * Rearranged member initializers src/Main/viewer.cxx * Rearranged member initializers src/Model/model.cxx * Fixed (un)signed comparisons src/Sound/fg_sound.cxx * Rearranged member initializers Thanks -- Cameron Moore [ Where do forest rangers go to "get away from it all?" ]
diff -urN ../FlightGear/src/Autopilot/newauto.cxx ./src/Autopilot/newauto.cxx --- ../FlightGear/src/Autopilot/newauto.cxx Mon Jul 8 22:59:43 2002 +++ ./src/Autopilot/newauto.cxx Tue Jul 9 01:20:05 2002 @@ -305,6 +305,9 @@ // 25% max control variablilty 0.5 / 2.0 disengage_threshold = 1.0; + // set default aileron max deflection + MaxAileron = 0.5; + #if !defined( USING_SLIDER_CLASS ) MaxRollAdjust = 2 * MaxRoll; RollOutAdjust = 2 * RollOut; diff -urN ../FlightGear/src/Cockpit/kr_87.cxx ./src/Cockpit/kr_87.cxx --- ../FlightGear/src/Cockpit/kr_87.cxx Thu Jul 4 14:37:06 2002 +++ ./src/Cockpit/kr_87.cxx Tue Jul 9 01:28:59 2002 @@ -76,6 +76,8 @@ need_update(true), valid(false), inrange(false), + dist(0.0), + heading(0.0), goal_needle_deg(0.0), et_flash_time(0.0), ant_mode(0), diff -urN ../FlightGear/src/Cockpit/steam.cxx ./src/Cockpit/steam.cxx --- ../FlightGear/src/Cockpit/steam.cxx Mon Jul 8 22:59:44 2002 +++ ./src/Cockpit/steam.cxx Mon Jul 8 23:56:20 2002 @@ -54,21 +54,22 @@ //////////////////////////////////////////////////////////////////////// FGSteam::FGSteam () - : the_STATIC_inhg(29.92), + : the_ALT_ft(0.0), the_ALT_datum_mb(1013.0), - the_VSI_case(29.92), - the_VSI_fps(0.0), + the_TC_rad(0.0), + the_TC_std(0.0), + the_STATIC_inhg(29.92), the_VACUUM_inhg(0.0), - the_MH_err(0.0), + the_VSI_fps(0.0), + the_VSI_case(29.92), the_MH_deg(0.0), the_MH_degps(0.0), - the_DG_err(0.0), + the_MH_err(0.0), the_DG_deg(0.0), the_DG_degps(0.0), the_DG_inhg(0.0), - the_TC_rad(0.0), - the_TC_std(0.0), + the_DG_err(0.0), _UpdateTimePending(1000000) { } diff -urN ../FlightGear/src/Input/input.cxx ./src/Input/input.cxx --- ../FlightGear/src/Input/input.cxx Mon Jul 8 22:59:50 2002 +++ ./src/Input/input.cxx Tue Jul 9 00:09:26 2002 @@ -403,12 +403,12 @@ // so we can play with it. if (x != m.x) { int delta = x - m.x; - for (int i = 0; i < mode.x_bindings[modifiers].size(); i++) + for (unsigned int i = 0; i < mode.x_bindings[modifiers].size(); i++) mode.x_bindings[modifiers][i]->fire(double(delta), double(xsize)); } if (y != m.y) { int delta = y - m.y; - for (int i = 0; i < mode.y_bindings[modifiers].size(); i++) + for (unsigned int i = 0; i < mode.y_bindings[modifiers].size(); i++) mode.y_bindings[modifiers][i]->fire(double(delta), double(ysize)); } @@ -487,7 +487,7 @@ std::cout << "Looking for bindings for joystick \"" << name << '"' << std::endl; vector<SGPropertyNode_ptr> nodes = js_nodes->getChildren("js-named"); - for (int i = 0; i < nodes.size(); i++) { + for (unsigned int i = 0; i < nodes.size(); i++) { SGPropertyNode_ptr node = nodes[i]; std::cout << " Trying \"" << node->getStringValue("name") << '"' << std::endl; if (!strcmp(node->getStringValue("name"), name)) { @@ -968,10 +968,10 @@ //////////////////////////////////////////////////////////////////////// FGInput::mouse::mouse () - : nModes(1), - current_mode(0), - x(-1), + : x(-1), y(-1), + nModes(1), + current_mode(0), modes(0) { } diff -urN ../FlightGear/src/Main/viewer.cxx ./src/Main/viewer.cxx --- ../FlightGear/src/Main/viewer.cxx Wed May 29 20:03:38 2002 +++ ./src/Main/viewer.cxx Tue Jul 9 00:22:18 2002 @@ -132,8 +132,6 @@ // Constructor FGViewer::FGViewer( fgViewType Type, bool from_model, int from_model_index, bool at_model, int at_model_index, double x_offset_m, double y_offset_m, double z_offset_m, double near_m ): - _scaling_type(FG_SCALING_MAX), - _fov_deg(55.0), _dirty(true), _lon_deg(0), _lat_deg(0), @@ -144,11 +142,13 @@ _roll_deg(0), _pitch_deg(0), _heading_deg(0), - _heading_offset_deg(0), - _pitch_offset_deg(0), _roll_offset_deg(0), + _pitch_offset_deg(0), + _heading_offset_deg(0), + _goal_pitch_offset_deg(0.0), _goal_heading_offset_deg(0.0), - _goal_pitch_offset_deg(0.0) + _scaling_type(FG_SCALING_MAX), + _fov_deg(55.0) { sgdZeroVec3(_absolute_view_pos); _type = Type; diff -urN ../FlightGear/src/Model/model.cxx ./src/Model/model.cxx --- ../FlightGear/src/Model/model.cxx Mon Jul 8 22:59:51 2002 +++ ./src/Model/model.cxx Tue Jul 9 00:11:28 2002 @@ -151,7 +151,7 @@ if (table_node != 0) { SGInterpTable * table = new SGInterpTable(); vector<SGPropertyNode_ptr> entries = table_node->getChildren("entry"); - for (int i = 0; i < entries.size(); i++) + for (unsigned int i = 0; i < entries.size(); i++) table->addEntry(entries[i]->getDoubleValue("ind", 0.0), entries[i]->getDoubleValue("dep", 0.0)); return table; @@ -176,7 +176,7 @@ // since the nodes are attached to the scene graph, they'll be // deleted automatically - int i; + unsigned int i; for (i = 0; i < _animations.size(); i++) delete _animations[i]; } diff -urN ../FlightGear/src/Sound/fg_sound.cxx ./src/Sound/fg_sound.cxx --- ../FlightGear/src/Sound/fg_sound.cxx Mon Jul 8 22:59:52 2002 +++ ./src/Sound/fg_sound.cxx Tue Jul 9 00:15:37 2002 @@ -64,14 +64,14 @@ FGSound::FGSound() : _sample(NULL), - _active(false), _condition(NULL), _property(NULL), - _dt_play(0.0), - _dt_stop(0.0), - _prev_value(0), + _active(false), _name(""), - _mode(FGSound::ONCE) + _mode(FGSound::ONCE), + _prev_value(0), + _dt_play(0.0), + _dt_stop(0.0) { }
diff -urN ../SimGear/simgear/misc/props.cxx ./simgear/misc/props.cxx --- ../SimGear/simgear/misc/props.cxx Mon Jul 8 23:08:47 2002 +++ ./simgear/misc/props.cxx Mon Jul 8 23:18:50 2002 @@ -652,8 +652,8 @@ * Copy constructor. */ SGPropertyNode::SGPropertyNode (const SGPropertyNode &node) - : _index(node._index), - _display_name(0), + : _display_name(0), + _index(node._index), _parent(0), // don't copy the parent _path(0), _path_cache(0), diff -urN ../SimGear/simgear/sky/sky.cxx ./simgear/sky/sky.cxx --- ../SimGear/simgear/sky/sky.cxx Sat May 18 23:43:49 2002 +++ ./simgear/sky/sky.cxx Mon Jul 8 23:21:19 2002 @@ -49,7 +49,7 @@ // Destructor SGSky::~SGSky( void ) { - for (int i = 0; i < cloud_layers.size(); i++) + for (unsigned int i = 0; i < cloud_layers.size(); i++) delete cloud_layers[i]; }