diff --git a/src/Instrumentation/HUD/HUD_label.cxx b/src/Instrumentation/HUD/HUD_label.cxx index 3b83c9f58..98a6a1df0 100644 --- a/src/Instrumentation/HUD/HUD_label.cxx +++ b/src/Instrumentation/HUD/HUD_label.cxx @@ -80,7 +80,7 @@ HUD::Label::Label(HUD *hud, const SGPropertyNode *n, float x, float y) : void HUD::Label::draw(void) { - if (!(_mode == NONE || _input.isValid() && blink())) + if (!(_mode == NONE || (_input.isValid() && blink()))) return; if (_box) { diff --git a/src/Instrumentation/HUD/HUD_ladder.cxx b/src/Instrumentation/HUD/HUD_ladder.cxx index 9fe331493..75b2e3afc 100644 --- a/src/Instrumentation/HUD/HUD_ladder.cxx +++ b/src/Instrumentation/HUD/HUD_ladder.cxx @@ -478,9 +478,9 @@ void HUD::Ladder::draw(void) else if (i == -90 && _nadir) draw_nadir(0.0, y); - if (_zenith && i > 85 || i > 90) + if ((_zenith && i > 85) || i > 90) continue; - if (_nadir && i < -85 || i < -90) + if ((_nadir && i < -85) || i < -90) continue; lo.x = -half_span; diff --git a/src/Instrumentation/HUD/HUD_runway.cxx b/src/Instrumentation/HUD/HUD_runway.cxx index 5c788e949..8eb443c36 100644 --- a/src/Instrumentation/HUD/HUD_runway.cxx +++ b/src/Instrumentation/HUD/HUD_runway.cxx @@ -183,7 +183,7 @@ void HUD::Runway::get_rwy_points(sgdVec3 *_points3d) double alt = current_aircraft.fdm_state->get_Runway_altitude() * SG_FEET_TO_METER; double length = _runway->lengthM() * 0.5; double width = _runway->widthM() * 0.5; - double frontLat, frontLon, backLat, backLon,az, tempLat, tempLon; + double frontLat = 0.0, frontLon = 0.0, backLat = 0.0, backLon = 0.0, az = 0.0, tempLat = 0.0, tempLon = 0.0; geo_direct_wgs_84(alt, _runway->latitude(), _runway->longitude(), _runway->headingDeg(), length, &backLat, &backLon, &az); sgGeodToCart(backLat * SG_DEGREES_TO_RADIANS, backLon * SG_DEGREES_TO_RADIANS, alt, _points3d[4]); diff --git a/src/Instrumentation/HUD/HUD_tape.cxx b/src/Instrumentation/HUD/HUD_tape.cxx index 5e73dfc1b..02fb76f15 100644 --- a/src/Instrumentation/HUD/HUD_tape.cxx +++ b/src/Instrumentation/HUD/HUD_tape.cxx @@ -243,11 +243,12 @@ void HUD::Tape::draw_vertical(float value) for (int i = 0; ; i++) { float v = vstart + i * _minor_divs; - if (!_modulo) + if (!_modulo) { if (v < _input.min()) continue; else if (v > _input.max()) break; + } float y = _y + (v - vmin) * factor(); @@ -335,8 +336,8 @@ void HUD::Tape::draw_vertical(float value) continue; if (_label_gap == 0.0 - || b < _center_y - _label_gap && t < _center_y - _label_gap - || b > _center_y + _label_gap && t > _center_y + _label_gap) { + || (b < _center_y - _label_gap && t < _center_y - _label_gap) + || (b > _center_y + _label_gap && t > _center_y + _label_gap)) { draw_text(x, y, s); } } @@ -451,11 +452,12 @@ void HUD::Tape::draw_horizontal(float value) for (int i = 0; ; i++) { float v = vstart + i * _minor_divs; - if (!_modulo) + if (!_modulo) { if (v < _input.min()) continue; else if (v > _input.max()) break; + } float x = _x + (v - vmin) * factor(); @@ -520,8 +522,8 @@ void HUD::Tape::draw_horizontal(float value) continue; if (_label_gap == 0.0 - || l < _center_x - _label_gap && r < _center_x - _label_gap - || l > _center_x + _label_gap && r > _center_x + _label_gap) { + || (l < _center_x - _label_gap && r < _center_x - _label_gap) + || (l > _center_x + _label_gap && r > _center_x + _label_gap)) { draw_text(x, y, s); } }