]> git.mxchange.org Git - flightgear.git/commitdiff
comment out unused variables and function and properly initialize variables
authorErik Hofman <erik@ehofman.com>
Mon, 19 Dec 2011 15:50:21 +0000 (16:50 +0100)
committerErik Hofman <erik@ehofman.com>
Mon, 19 Dec 2011 15:50:21 +0000 (16:50 +0100)
12 files changed:
src/AIModel/AIAircraft.cxx
src/AIModel/AIFlightPlanCreate.cxx
src/ATC/atc_mgr.cxx
src/ATC/atcdialog.cxx
src/ATC/trafficcontrol.cxx
src/ATCDCL/ATCDialogOld.cxx
src/Airports/gnnode.cxx
src/Airports/groundnetwork.cxx
src/Instrumentation/HUD/HUD_runway.cxx
src/Radio/itm.cpp
src/Radio/radio.cxx
src/Time/light.cxx

index 69c519f63d9824231fd4d33998b48bec2a980467..ca72ee78c4c4d4643bb54a9707c7c899f4bfbe05 100644 (file)
@@ -379,7 +379,7 @@ double FGAIAircraft::calcVerticalSpeed(double vert_ft, double dist_m, double spe
 {
     // err is negative when we passed too high
     double vert_m = vert_ft * SG_FEET_TO_METER;
-    double err_m  = err     * SG_FEET_TO_METER;
+    //double err_m  = err     * SG_FEET_TO_METER;
     //double angle = atan2(vert_m, dist_m);
     double speedMs = (speed * SG_NM_TO_METER) / 3600;
     //double vs = cos(angle) * speedMs; // Now in m/s
index b603173de38f1415edfd3bd62a194eed7a1a003c..ba2f291741f151b010c5fdf5097f8770be6d30d3 100644 (file)
@@ -909,7 +909,7 @@ bool FGAIFlightPlan::createLanding(FGAIAircraft * ac, FGAirport * apt,
 
 
     FGAIWaypoint *wpt;
-    double aptElev = apt->getElevation();
+    //double aptElev = apt->getElevation();
     double currElev = 0;
     char buffer[12];
     FGRunway * rwy = apt->getRunwayByIdent(activeRunway);
index ea81f390f0d528eb0f6ce4de9f67d29babf32b48..a693e11c98163bb9b576ef436a86dd3bd51b14fc 100644 (file)
@@ -94,9 +94,9 @@ void FGATCManager::init() {
     ai_ac.setTrafficRef(trafficRef);
     
     string flightPlanName = airport + "-" + airport + ".xml";
-    double cruiseAlt = 100; // Doesn't really matter right now.
-    double courseToDest = 180; // Just use something neutral; this value might affect the runway that is used though...
-    time_t deptime = 0;        // just make sure how flightplan processing is affected by this...
+    //double cruiseAlt = 100; // Doesn't really matter right now.
+    //double courseToDest = 180; // Just use something neutral; this value might affect the runway that is used though...
+    //time_t deptime = 0;        // just make sure how flightplan processing is affected by this...
 
 
     FGAirport *apt = FGAirport::findByIdent(airport); 
index 5185ee0c049fa4c07f586599980c3bfa7a55604b..e6b3909929cfda1e3086356c52f8e8d668161058 100644 (file)
@@ -110,10 +110,10 @@ void FGATCDialogNew::PopupDialog() {
 }
 
 void FGATCDialogNew::update(double dt) {
- double onBoardRadioFreq0 =
-        fgGetDouble("/instrumentation/comm[0]/frequencies/selected-mhz");
-    double onBoardRadioFreq1 =
-        fgGetDouble("/instrumentation/comm[1]/frequencies/selected-mhz");
+//  double onBoardRadioFreq0 =
+//      fgGetDouble("/instrumentation/comm[0]/frequencies/selected-mhz");
+//  double onBoardRadioFreq1 =
+//      fgGetDouble("/instrumentation/comm[1]/frequencies/selected-mhz");
 
     const char *dialog_name = "atc-dialog";
     _gui = (NewGUI *)globals->get_subsystem("gui");
@@ -163,4 +163,4 @@ void FGATCDialogNew::update(double dt) {
            // PopupCallback(n);
         cerr << "Selected transmission message" << n << endl;
     } */
-}
\ No newline at end of file
+}
index ee0f06a7fc6be64eb9957d33e534e208e5800595..1ba285f152f20d088c54bc9250b7339369bc6ef9 100644 (file)
@@ -1341,7 +1341,7 @@ void FGStartupController::render(bool visible)
     if (visible) {
         group = new osg::Group;
         FGScenery * local_scenery = globals->get_scenery();
-        double elevation_meters = 0.0;
+        //double elevation_meters = 0.0;
         double elevation_feet = 0.0;
 
 
index b1824180cbf5989bb22c79bb559b50913f81080c..e3baf4e66e702be81136e3ae5a3b4486a77b3a8f 100644 (file)
@@ -48,6 +48,7 @@ using std::endl;
 FGATCDialog *current_atcdialog;
 
 // For the command manager - maybe eventually this should go in the built in command list
+#if 0
 static bool do_ATC_dialog(const SGPropertyNode* arg) {
         cerr << "Running ATCDCL do_ATC_dialog" << endl;
        current_atcdialog->PopupDialog();
@@ -58,6 +59,7 @@ static bool do_ATC_freq_search(const SGPropertyNode* arg) {
        current_atcdialog->FreqDialog();
        return(true);
 }
+#endif
 
 ATCMenuEntry::ATCMenuEntry() {
   stationid    = "";
index 9bde0078037f6ecadf11974326ed50fd436435e7..0dc0e8ff0a5cf5fba1038d73bdd6d30d943a61e2 100644 (file)
@@ -91,8 +91,8 @@ double FGTaxiNode::getElevationFt(double refelev)
 
 double FGTaxiNode::getElevationM(double refelev)
 {
-    double refelevFt = refelev * SG_METER_TO_FEET;
-    double retval = getElevationFt(refelevFt);
+    //double refelevFt = refelev * SG_METER_TO_FEET;
+    //double retval = getElevationFt(refelevFt);
     //cerr << "Returning elevation : " << geod.getElevationM() << ". Ref elev (meters) = " << refelev << endl;
     return geod.getElevationM();
 }
index 4802b97c57cecafb9140340f326dbce836ac5c01..20d0a793de89d16ed4b341abe67383b2666f809e 100644 (file)
@@ -1337,11 +1337,11 @@ void FGGroundNetwork::render(bool visible)
     if (visible) {
         group = new osg::Group;
         FGScenery * local_scenery = globals->get_scenery();
-        double elevation_meters = 0.0;
+        // double elevation_meters = 0.0;
         double elevation_feet = 0.0;
         time_t now = time(NULL) + fgGetLong("/sim/time/warp");
         //for ( FGTaxiSegmentVectorIterator i = segments.begin(); i != segments.end(); i++) {
-        double dx = 0;
+        //double dx = 0;
         for   (TrafficVectorIterator i = activeTraffic.begin(); i != activeTraffic.end(); i++) {
             // Handle start point
             int pos = i->getCurrentPosition() - 1;
index 42f2e44acfd6aeb24ebc12ee851401d2b6a9bb63..ae2f1243785717ad6d5ddb89a5e7ba059e462007 100644 (file)
@@ -75,7 +75,8 @@ void HUD::Runway::draw()
         return;
 
     glPushAttrib(GL_LINE_STIPPLE | GL_LINE_STIPPLE_PATTERN | GL_LINE_WIDTH);
-    float modelView[4][4], projMat[4][4];
+    float projMat[4][4]={{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0}};
+    float modelView[4][4];
     bool anyLines;
     //Get the current view
 //    FGViewer* curr_view = globals->get_viewmgr()->get_current_view();
index d5c3e7f8a4265ded3e535dc1df99e672dfbcc94c..8f75162ce6263f8b7b6aef8d4cedf232a1881eb9 100644 (file)
@@ -135,7 +135,7 @@ double FORTRAN_DIM(const double &x, const double &y)
 }
 
 //#define set_warn(txt, err) printf("%s:%d %s\n", __func__, __LINE__, txt);
-#define set_warn(txt, err) 1;
+#define set_warn(txt, err)
 
 // :13: single-knife attenuation, page 6
 /*
@@ -813,6 +813,7 @@ void qlra(int kst[], int klimx, int mdvarx, prop_type &prop, propv_type &propv)
  * computers," Princeton Univ. Press, 1955) and the maximum error should be
  * 4.5e-4.
  */
+#if 1
 static
 double qerfi(double q)
 {
@@ -834,6 +835,7 @@ double qerfi(double q)
 
        return v;
 }
+#endif
 
 
 // :41: preparatory routine, page 20
@@ -850,6 +852,7 @@ double qerfi(double q)
  *   surface impedance @zgnd
  * It may be used with either the area prediction or the point-to-point mode.
  */
+#if 1
 static
 void qlrps(double fmhz, double zsys, double en0, int ipol, double eps, double sgm, prop_type &prop)
 
@@ -882,6 +885,7 @@ void qlrps(double fmhz, double zsys, double en0, int ipol, double eps, double sg
        prop.Z_g_real = prop_zgnd.real();
        prop.Z_g_imag = prop_zgnd.imag();
 }
+#endif
 
 
 // :30: Function curv, page 15
@@ -901,6 +905,7 @@ double curve(double const &c1, double const &c2, double const &x1, double const
 
 
 // :28: Area variablity, page 14
+#if 1
 static
 double avar(double zzt, double zzl, double zzc, prop_type &prop, propv_type &propv)
 {
@@ -1167,7 +1172,7 @@ double avar(double zzt, double zzl, double zzc, prop_type &prop, propv_type &pro
 
        return avarv;
 }
-
+#endif
 
 // :45: Find to horizons, page 24
 /*
@@ -1428,6 +1433,7 @@ double dlthx(double pfl[], const double &x1, const double &x2)
  *   pfl[0] = np, the number of points in the path
  *   pfl[1] = xi, the length of each increment
 */
+#if 1
 static
 void qlrpfl(double pfl[], int klimx, int mdvarx, prop_type &prop, propv_type &propv)
 {
@@ -1498,6 +1504,7 @@ void qlrpfl(double pfl[], int klimx, int mdvarx, prop_type &prop, propv_type &pr
 
        lrprop(0.0, prop);
 }
+#endif
 
 
 //********************************************************
index 0b36a659d639f2d629f181e82064d22ad5835f9b..34f43cf69fb05950de769a85ed885ac5cbefd9f5 100644 (file)
@@ -289,7 +289,7 @@ double FGRadioTransmission::ITM_calculate_attenuation(SGGeod pos, double freq, i
        
                
        int max_points = (int)floor(distance_m / point_distance);
-       double delta_last = fmod(distance_m, point_distance);
+       //double delta_last = fmod(distance_m, point_distance);
        
        deque<double> elevations;
        deque<string*> materials;
index 88472cffe235dbd3f11b8b4ff6cf4b2c0fdaccbb..d12d6704935375aaf73bd98bb866c13d6f256535 100644 (file)
@@ -281,7 +281,6 @@ void FGLight::update_sky_color () {
     _sky_color[3] = base_sky_color[3];
     gamma_correct_rgb( _sky_color.data() );
 
-    sqrt_sky_brightness /= _scattering;
     _cloud_color[0] = base_fog_color[0] * sky_brightness;
     _cloud_color[1] = base_fog_color[1] * sky_brightness;
     _cloud_color[2] = base_fog_color[2] * sky_brightness;