From: Durk Talsma Date: Mon, 27 Sep 2010 15:48:38 +0000 (+0200) Subject: - Fix compiler warnings. X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=df00df3feb95a35fb1087da3435d3d36a76e54b9;p=flightgear.git - Fix compiler warnings. --- diff --git a/src/AIModel/AIAircraft.cxx b/src/AIModel/AIAircraft.cxx index ac79b97cc..58db48478 100644 --- a/src/AIModel/AIAircraft.cxx +++ b/src/AIModel/AIAircraft.cxx @@ -648,7 +648,7 @@ bool FGAIAircraft::leadPointReached(FGAIFlightPlan::waypoint* curr) { // << dist_to_go << ": Lead distance " // << lead_dist << " " << curr->name // << " Ground target speed " << groundTargetSpeed << endl; - double bearing; + double bearing = 0; if (speed > 50) { // don't do bearing calculations for ground traffic bearing = getBearing(fp->getBearing(pos.getLatitudeDeg(), pos.getLongitudeDeg(), curr)); if (bearing < minBearing) { diff --git a/src/AIModel/AIBallistic.cxx b/src/AIModel/AIBallistic.cxx index 261885b24..7fa147430 100644 --- a/src/AIModel/AIBallistic.cxx +++ b/src/AIModel/AIBallistic.cxx @@ -46,6 +46,7 @@ _azimuth(0.0), _elevation(0.0), _rotation(0.0), _formate_to_ac(false), +_elapsed_time(0), _aero_stabilised(false), _drag_area(0.007), _life_timer(0.0), @@ -61,13 +62,12 @@ _slave_to_ac(false), _slave_load_to_ac(false), _contents_lb(0), _report_collision(false), -_report_expiry(false), _report_impact(false), _external_force(false), +_report_expiry(false), _impact_report_node(fgGetNode("/ai/models/model-impact", true)), -_old_height(0), -_elapsed_time(0), -hs(0) +hs(0), +_old_height(0) { no_roll = false; diff --git a/src/AIModel/AIBase.cxx b/src/AIModel/AIBase.cxx index 501bb32cb..9471a770b 100644 --- a/src/AIModel/AIBase.cxx +++ b/src/AIModel/AIBase.cxx @@ -53,11 +53,12 @@ const double FGAIBase::lbs_to_slugs = 0.031080950172; //conversion factor using namespace simgear; FGAIBase::FGAIBase(object_type ot) : + _name(""), + _parent(""), props( NULL ), model_removed( fgGetNode("/ai/models/model-removed", true) ), manager( NULL ), fp( NULL ), - _impact_lat(0), _impact_lon(0), _impact_elev(0), @@ -65,12 +66,9 @@ FGAIBase::FGAIBase(object_type ot) : _impact_pitch(0), _impact_roll(0), _impact_speed(0), - _refID( _newAIModelID() ), _otype(ot), - _initialized(false), - _parent(""), - _name("") + _initialized(false) { tgt_heading = hdg = tgt_altitude_ft = tgt_speed = 0.0; diff --git a/src/AIModel/AIEscort.cxx b/src/AIModel/AIEscort.cxx index 255524cc7..2b758e6ab 100644 --- a/src/AIModel/AIEscort.cxx +++ b/src/AIModel/AIEscort.cxx @@ -45,14 +45,14 @@ FGAIEscort::FGAIEscort() : FGAIShip(otEscort), _relbrg (0), -_stn_truebrg(0), _parent_speed(0), -_stn_limit(0), -_stn_angle_limit(0), -_stn_speed(0), +_interval(0), +_stn_truebrg(0), _stn_height(0), +_stn_speed(0), +_stn_angle_limit(0), +_stn_limit(0), _max_speed(0), -_interval(0), _MPControl(false), _patrol(false), _stn_deg_true(false) diff --git a/src/AIModel/AIFlightPlanCreate.cxx b/src/AIModel/AIFlightPlanCreate.cxx index d276cc96a..790de6923 100644 --- a/src/AIModel/AIFlightPlanCreate.cxx +++ b/src/AIModel/AIFlightPlanCreate.cxx @@ -419,13 +419,13 @@ void FGAIFlightPlan::createTakeOff(FGAIAircraft * ac, bool firstFlight, double vTaxi = ac->getPerformance()->vTaxi(); double vRotate = ac->getPerformance()->vRotate(); double vTakeoff = ac->getPerformance()->vTakeoff(); - double vClimb = ac->getPerformance()->vClimb(); + //double vClimb = ac->getPerformance()->vClimb(); double accelMetric = (accel * SG_NM_TO_METER) / 3600; double vTaxiMetric = (vTaxi * SG_NM_TO_METER) / 3600; double vRotateMetric = (vRotate * SG_NM_TO_METER) / 3600; double vTakeoffMetric = (vTakeoff * SG_NM_TO_METER) / 3600; - double vClimbMetric = (vClimb * SG_NM_TO_METER) / 3600; + //double vClimbMetric = (vClimb * SG_NM_TO_METER) / 3600; // Acceleration = dV / dT // Acceleration X dT = dV // dT = dT / Acceleration @@ -558,7 +558,7 @@ void FGAIFlightPlan::createDescent(FGAIAircraft * ac, FGAirport * apt, // Create a slow descent path that ends 250 lateral to the runway. double initialTurnRadius = getTurnRadius(vDescent, true); - double finalTurnRadius = getTurnRadius(vApproach, true); + //double finalTurnRadius = getTurnRadius(vApproach, true); // get length of the downwind leg for the intended runway double distanceOut = apt->getDynamics()->getApproachController()->getRunway(rwy->name())->getApproachDistance(); //12 * SG_NM_TO_METER; @@ -801,7 +801,7 @@ void FGAIFlightPlan::createDescent(FGAIAircraft * ac, FGAirport * apt, if (reposition) { double tempDistance; - double minDistance = HUGE_VAL; + //double minDistance = HUGE_VAL; string wptName; tempDistance = SGGeodesy::distanceM(current, initialTarget); time_t eta = @@ -836,7 +836,7 @@ void FGAIFlightPlan::createLanding(FGAIAircraft * ac, FGAirport * apt, const string & fltType) { double vTouchdown = ac->getPerformance()->vTouchdown(); - double vTaxi = ac->getPerformance()->vTaxi(); + //double vTaxi = ac->getPerformance()->vTaxi(); //string rwyClass = getRunwayClassFromTrafficType(fltType); //double heading = ac->getTrafficRef()->getCourse(); diff --git a/src/AIModel/AIGroundVehicle.cxx b/src/AIModel/AIGroundVehicle.cxx index 83e67626d..d130b3294 100644 --- a/src/AIModel/AIGroundVehicle.cxx +++ b/src/AIModel/AIGroundVehicle.cxx @@ -40,11 +40,11 @@ _speed_kt(0), _range_ft(0), _relbrg (0), _parent_speed(0), -_dt_count(0), -_next_run(0), _parent_x_offset(0), _parent_y_offset(0), _parent_z_offset(0), +_dt_count(0), +_next_run(0), _break_count(0) { @@ -285,7 +285,7 @@ bool FGAIGroundVehicle::getPitch() { double rear_elev_m = 0; double elev_front = 0; double elev_rear = 0; - double max_alt = 10000; + //double max_alt = 10000; if (globals->get_scenery()->get_elevation_m(SGGeod::fromGeodM(geodFront, 3000), elev_front, &_material, 0)){ @@ -480,7 +480,7 @@ void FGAIGroundVehicle::AdvanceFP(){ void FGAIGroundVehicle::setTowSpeed(){ - double diff = _range_ft - _x_offset; + //double diff = _range_ft - _x_offset; double x = 0; if (_range_ft > _x_offset * 3) x = 50; @@ -537,7 +537,7 @@ void FGAIGroundVehicle::RunGroundVehicle(double dt){ string parent_next_name = _selected_ac->getStringValue("waypoint/name-next"); bool parent_waiting = _selected_ac->getBoolValue("waypoint/waiting"); - bool parent_restart = _selected_ac->getBoolValue("controls/restart"); + //bool parent_restart = _selected_ac->getBoolValue("controls/restart"); if (parent_next_name == "END" && fp->getNextWaypoint()->name != "END" ){ SG_LOG(SG_GENERAL, SG_DEBUG, "AIGroundVeh1cle: " << _name diff --git a/src/AIModel/AIShip.cxx b/src/AIModel/AIShip.cxx index d0a3f3b65..9eecd6c97 100644 --- a/src/AIModel/AIShip.cxx +++ b/src/AIModel/AIShip.cxx @@ -43,35 +43,35 @@ FGAIShip::FGAIShip(object_type ot) : FGAIBase(ot), + + +_waiting(false), +_new_waypoint(true), +_tunnel(false), +_initial_tunnel(false), +_restart(false), +_hdg_constant(0.01), _limit(100), _elevation_m(0), _elevation_ft(0), _tow_angle(0), +_missed_count(0), +_wp_range(0), _dt_count(0), _next_run(0), +_roll_constant(0.001), +_roll_factor(-0.0083335), +_old_range(0), +_range_rate(0), +_missed_time_sec(30), +_day(86400), _lead_angle(0), _xtrack_error(0), -_tunnel(false), -_initial_tunnel(false), _curr_alt(0), _prev_alt(0), _until_time(""), _fp_init(false), -_missed(false), -_waiting(false), -_new_waypoint(true), -_missed_count(0), -_wait_count(0), -_missed_time_sec(30), -_day(86400), -_wp_range(0), -_old_range(0), -_range_rate(0), -_roll_constant(0.001), -_hdg_constant(0.01), -_roll_factor(-0.0083335), -_restart(false) - +_missed(false) { invisible = false; } diff --git a/src/AIModel/submodel.cxx b/src/AIModel/submodel.cxx index d1b792563..29b658603 100644 --- a/src/AIModel/submodel.cxx +++ b/src/AIModel/submodel.cxx @@ -204,7 +204,7 @@ void FGSubmodelMgr::update(double dt) if (trigger && (*submodel_iterator)->count != 0) { - int id = (*submodel_iterator)->id; + //int id = (*submodel_iterator)->id; string name = (*submodel_iterator)->name; SG_LOG(SG_GENERAL, SG_DEBUG, @@ -338,7 +338,7 @@ void FGSubmodelMgr::transform(submodel *sm) IC.mass = sm->weight * lbs_to_slugs; int id = sm->id; - int sub_id = sm->sub_id; + //int sub_id = sm->sub_id; string name = sm->name; diff --git a/src/Traffic/TrafficMgr.cxx b/src/Traffic/TrafficMgr.cxx index f25516a26..615bb6c8c 100644 --- a/src/Traffic/TrafficMgr.cxx +++ b/src/Traffic/TrafficMgr.cxx @@ -375,7 +375,7 @@ void FGTrafficManager::readTimeTableFromFile(SGPath infileName) string arrTimeGen = tokens[6]; string repeat = "WEEK"; string requiredAircraft = tokens[9]; - + if (weekdays.size() != 7) { SG_LOG(SG_GENERAL, SG_ALERT, "Found misconfigured weekdays string" << weekdays); exit(1); @@ -611,7 +611,7 @@ void FGTrafficManager::endElement(const char *name) if (fgGetBool("/sim/traffic-manager/dumpdata") == true) { SG_LOG(SG_GENERAL, SG_ALERT, "Traffic Dump AC," << homePort << "," << registration << "," << requiredAircraft << "," << acType << "," << livery << "," - << airline << "," << offset << "," << radius << "," << flighttype << "," << isHeavy << "," << mdl); + << airline << "," << m_class << "," << offset << "," << radius << "," << flighttype << "," << isHeavy << "," << mdl); } //scheduledAircraft.push_back(new FGAISchedule(mdl, // livery,