From ddb4fa050fd9142820c9211c72f5a6ef11d7ce67 Mon Sep 17 00:00:00 2001 From: Torsten Dreyer Date: Sun, 25 Dec 2011 14:41:47 +0100 Subject: [PATCH] Some warning fixes, mostly unused variables --- src/AIModel/AIAircraft.cxx | 6 +++--- src/AIModel/AIBallistic.cxx | 6 +++--- src/Cockpit/panel_io.cxx | 16 ++++++++-------- src/Instrumentation/HUD/HUD_ladder.cxx | 6 +++--- src/Instrumentation/HUD/HUD_runway.cxx | 4 ++-- src/Instrumentation/HUD/HUD_tape.cxx | 26 +++++++++++++------------- src/MultiPlayer/multiplaymgr.cxx | 4 ++-- 7 files changed, 34 insertions(+), 34 deletions(-) diff --git a/src/AIModel/AIAircraft.cxx b/src/AIModel/AIAircraft.cxx index ca72ee78c..5cd3d6277 100644 --- a/src/AIModel/AIAircraft.cxx +++ b/src/AIModel/AIAircraft.cxx @@ -1057,7 +1057,7 @@ void FGAIAircraft::updateHeading() { // If on ground, calculate heading change directly if (onGround()) { double headingDiff = fabs(hdg-tgt_heading); - double bank_sense = 0.0; +// double bank_sense = 0.0; /* double diff = fabs(hdg - tgt_heading); if (diff > 180) @@ -1077,9 +1077,9 @@ void FGAIAircraft::updateHeading() { if (sum > 360.0) sum -= 360.0; if (fabs(sum - tgt_heading) > 0.0001) { - bank_sense = -1.0; +// bank_sense = -1.0; } else { - bank_sense = 1.0; +// bank_sense = 1.0; } //if (trafficRef) // cerr << trafficRef->getCallSign() << " Heading " diff --git a/src/AIModel/AIBallistic.cxx b/src/AIModel/AIBallistic.cxx index 1df938c0b..68d72f92b 100644 --- a/src/AIModel/AIBallistic.cxx +++ b/src/AIModel/AIBallistic.cxx @@ -639,21 +639,21 @@ void FGAIBallistic::slaveToAC(double dt){ if (invisible) return; - double hdg, pch, rll, agl = 0; + double hdg, pch, rll;//, agl = 0; if (_pnode != 0) { setParentPos(); hdg = _p_hdg_node->getDoubleValue(); pch = _p_pch_node->getDoubleValue(); rll = _p_rll_node->getDoubleValue(); - agl = _p_agl_node->getDoubleValue(); +// agl = _p_agl_node->getDoubleValue(); setOffsetPos(_parentpos, hdg, pch, rll); setSpeed(_p_spd_node->getDoubleValue()); }else { hdg = manager->get_user_heading(); pch = manager->get_user_pitch(); rll = manager->get_user_roll(); - agl = manager->get_user_agl(); +// agl = manager->get_user_agl(); setOffsetPos(userpos, hdg, pch, rll); setSpeed(manager->get_user_speed()); } diff --git a/src/Cockpit/panel_io.cxx b/src/Cockpit/panel_io.cxx index 754afb30e..c0dcfd5dc 100644 --- a/src/Cockpit/panel_io.cxx +++ b/src/Cockpit/panel_io.cxx @@ -755,8 +755,8 @@ readPanel (const SGPropertyNode * root) int y = node->getIntValue("y", -1); int real_w = node->getIntValue("w", -1); int real_h = node->getIntValue("h", -1); - int w = node->getIntValue("w-base", -1); - int h = node->getIntValue("h-base", -1); +// int w = node->getIntValue("w-base", -1); +// int h = node->getIntValue("h-base", -1); if (x == -1 || y == -1) { SG_LOG( SG_COCKPIT, SG_ALERT, @@ -764,15 +764,15 @@ readPanel (const SGPropertyNode * root) return 0; } - float w_scale = 1.0; - float h_scale = 1.0; +// float w_scale = 1.0; +// float h_scale = 1.0; if (real_w != -1) { - w_scale = float(real_w) / float(w); - w = real_w; +// w_scale = float(real_w) / float(w); +// w = real_w; } if (real_h != -1) { - h_scale = float(real_h) / float(h); - h = real_h; +// h_scale = float(real_h) / float(h); +// h = real_h; } SG_LOG( SG_COCKPIT, SG_BULK, "Reading instrument " << name ); diff --git a/src/Instrumentation/HUD/HUD_ladder.cxx b/src/Instrumentation/HUD/HUD_ladder.cxx index 88bd17549..9b4ba1084 100644 --- a/src/Instrumentation/HUD/HUD_ladder.cxx +++ b/src/Instrumentation/HUD/HUD_ladder.cxx @@ -138,7 +138,7 @@ void HUD::Ladder::draw(void) //**************************************************************** //velocity vector reticle - computations float xvvr, /* yvvr, */ Vxx = 0.0, Vyy = 0.0, Vzz = 0.0; - float Axx = 0.0, Ayy = 0.0, Azz = 0.0, total_vel = 0.0, pot_slope, t1; + float Axx = 0.0, Ayy = 0.0, Azz = 0.0, total_vel = 0.0, pot_slope; //, t1; float up_vel, ground_vel, actslope = 0.0, psi = 0.0; float vel_x = 0.0, vel_y = 0.0, drift; float alpha; @@ -320,10 +320,10 @@ void HUD::Ladder::draw(void) if (_energy_marker) { if (total_vel < 5.0) { - t1 = 0; +// t1 = 0; t2 = 0; } else { - t1 = up_vel / total_vel; +// t1 = up_vel / total_vel; t2 = asin((Vxx * Axx + Vyy * Ayy + Vzz * Azz) / (9.81 * total_vel)); } pot_slope = ((t2 / 3) * SGD_RADIANS_TO_DEGREES) * _compression + vel_y; diff --git a/src/Instrumentation/HUD/HUD_runway.cxx b/src/Instrumentation/HUD/HUD_runway.cxx index ae2f12437..b115b3ae7 100644 --- a/src/Instrumentation/HUD/HUD_runway.cxx +++ b/src/Instrumentation/HUD/HUD_runway.cxx @@ -123,9 +123,9 @@ void HUD::Runway::draw() } //Calculate the 2D points via gluProject - int result = GL_TRUE; +// int result = GL_TRUE; for (int i = 0; i < 6; i++) { - result = simgear::project(_points3d[i][0], _points3d[i][1], _points3d[i][2], + /*result = */simgear::project(_points3d[i][0], _points3d[i][1], _points3d[i][2], _mm, _pm, _view, &_points2d[i][0], &_points2d[i][1], &_points2d[i][2]); } diff --git a/src/Instrumentation/HUD/HUD_tape.cxx b/src/Instrumentation/HUD/HUD_tape.cxx index 6820e8880..4897a7e4a 100644 --- a/src/Instrumentation/HUD/HUD_tape.cxx +++ b/src/Instrumentation/HUD/HUD_tape.cxx @@ -89,7 +89,7 @@ void HUD::Tape::draw(void) // (HUD_scale * pscale) void HUD::Tape::draw_vertical(float value) { - float vmin = 0.0, vmax = 0.0; + float vmin = 0.0;//, vmax = 0.0; float marker_xs; float marker_xe; float marker_ye; @@ -101,16 +101,16 @@ void HUD::Tape::draw_vertical(float value) if (!_pointer) { vmin = value - _half_width_units; // width units == needle travel - vmax = value + _half_width_units; // or picture unit span. +// vmax = value + _half_width_units; // or picture unit span. text_y = _center_y; } else if (_pointer_type == MOVING) { vmin = _input.min(); - vmax = _input.max(); +// vmax = _input.max(); } else { // FIXED vmin = value - _half_width_units; // width units == needle travel - vmax = value + _half_width_units; // or picture unit span. +// vmax = value + _half_width_units; // or picture unit span. text_y = _center_y; } @@ -348,12 +348,12 @@ void HUD::Tape::draw_vertical(float value) void HUD::Tape::draw_horizontal(float value) { - float vmin = 0.0, vmax = 0.0; + float vmin = 0.0;//, vmax = 0.0; float marker_xs; - float marker_xe; +// float marker_xe; float marker_ys; float marker_ye; - float text_y = 0.0; +// float text_y = 0.0; float top = _y + _h; float right = _x + _w; @@ -361,17 +361,17 @@ void HUD::Tape::draw_horizontal(float value) if (!_pointer) { vmin = value - _half_width_units; // width units == needle travel - vmax = value + _half_width_units; // or picture unit span. - text_y = _center_y; +// vmax = value + _half_width_units; // or picture unit span. +// text_y = _center_y; } else if (_pointer_type == MOVING) { vmin = _input.min(); - vmax = _input.max(); +// vmax = _input.max(); } else { // FIXED vmin = value - _half_width_units; // width units == needle travel - vmax = value + _half_width_units; // or picture unit span. - text_y = _center_y; +// vmax = value + _half_width_units; // or picture unit span. +// text_y = _center_y; } // left tick bar @@ -384,7 +384,7 @@ void HUD::Tape::draw_horizontal(float value) marker_ys = _y; // Starting point for marker_ye = top; // tick y location calcs - marker_xe = right; +// marker_xe = right; marker_xs = _x + ((value - vmin) * factor()); if (option_top()) { diff --git a/src/MultiPlayer/multiplaymgr.cxx b/src/MultiPlayer/multiplaymgr.cxx index 123317c63..d7a839706 100644 --- a/src/MultiPlayer/multiplaymgr.cxx +++ b/src/MultiPlayer/multiplaymgr.cxx @@ -965,10 +965,10 @@ FGMultiplayMgr::Send() } double sim_time = globals->get_sim_time_sec(); - static double lastTime = 0.0; +// static double lastTime = 0.0; // SG_LOG(SG_GENERAL, SG_INFO, "actual dt=" << sim_time - lastTime); - lastTime = sim_time; +// lastTime = sim_time; FlightProperties ifce;