]> git.mxchange.org Git - flightgear.git/commitdiff
- Fix compiler warnings.
authorDurk Talsma <durk@linux-iue5.site>
Mon, 27 Sep 2010 15:48:38 +0000 (17:48 +0200)
committerDurk Talsma <durk@linux-iue5.site>
Mon, 27 Sep 2010 15:48:38 +0000 (17:48 +0200)
src/AIModel/AIAircraft.cxx
src/AIModel/AIBallistic.cxx
src/AIModel/AIBase.cxx
src/AIModel/AIEscort.cxx
src/AIModel/AIFlightPlanCreate.cxx
src/AIModel/AIGroundVehicle.cxx
src/AIModel/AIShip.cxx
src/AIModel/submodel.cxx
src/Traffic/TrafficMgr.cxx

index ac79b97cc7f19aaad3f854f075d9c06be9bc3284..58db48478f8f4b413f92eccc3989d0de8a2f5864 100644 (file)
@@ -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) {
index 261885b24a1ac7ad745aea6cfa9d7398aad21275..7fa1474302d2c1c7840fc2b3a335947007c55612 100644 (file)
@@ -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;
index 501bb32cbbd2173468f39bded75ee05fbdb8b904..9471a770b5184d320d3d4f5446f1b089990c07fb 100644 (file)
@@ -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;
index 255524cc797222022543d6b09de79d996ad677fb..2b758e6abb7e3c1ec19fda419f7f78f253164469 100644 (file)
@@ -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)
index d276cc96ae26b63e9dbecc262903e6e881321c65..790de692359dadeda50b42245a8b07ee05d31bc6 100644 (file)
@@ -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();
index 83e67626d057ef0a8ca936c26a4a474e3acb780a..d130b3294359b68f35c6c46ed5ed751faca76a96 100644 (file)
@@ -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
index d0a3f3b65f780224d4daab8f365de086fee9a8f9..9eecd6c970f4870ca4ae51c445cb6564b29b7066 100644 (file)
 
 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;
 }
index d1b79256348a44f72c57e833b655b635ec5dea98..29b658603d437c4cc05fd026f656cb51348d3fa0 100644 (file)
@@ -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;
 
 
index f25516a2640ef445a30b4542d75e0a35232a92e1..615bb6c8c49e4275d337f539a744c1e8327e0972 100644 (file)
@@ -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,