From: Erik Hofman Date: Mon, 19 Dec 2011 15:50:21 +0000 (+0100) Subject: comment out unused variables and function and properly initialize variables X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=1fb790eb60bc36456d7fa58d04d410873eb58810;p=flightgear.git comment out unused variables and function and properly initialize variables --- diff --git a/src/AIModel/AIAircraft.cxx b/src/AIModel/AIAircraft.cxx index 69c519f63..ca72ee78c 100644 --- a/src/AIModel/AIAircraft.cxx +++ b/src/AIModel/AIAircraft.cxx @@ -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 diff --git a/src/AIModel/AIFlightPlanCreate.cxx b/src/AIModel/AIFlightPlanCreate.cxx index b603173de..ba2f29174 100644 --- a/src/AIModel/AIFlightPlanCreate.cxx +++ b/src/AIModel/AIFlightPlanCreate.cxx @@ -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); diff --git a/src/ATC/atc_mgr.cxx b/src/ATC/atc_mgr.cxx index ea81f390f..a693e11c9 100644 --- a/src/ATC/atc_mgr.cxx +++ b/src/ATC/atc_mgr.cxx @@ -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); diff --git a/src/ATC/atcdialog.cxx b/src/ATC/atcdialog.cxx index 5185ee0c0..e6b390992 100644 --- a/src/ATC/atcdialog.cxx +++ b/src/ATC/atcdialog.cxx @@ -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 +} diff --git a/src/ATC/trafficcontrol.cxx b/src/ATC/trafficcontrol.cxx index ee0f06a7f..1ba285f15 100644 --- a/src/ATC/trafficcontrol.cxx +++ b/src/ATC/trafficcontrol.cxx @@ -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; diff --git a/src/ATCDCL/ATCDialogOld.cxx b/src/ATCDCL/ATCDialogOld.cxx index b1824180c..e3baf4e66 100644 --- a/src/ATCDCL/ATCDialogOld.cxx +++ b/src/ATCDCL/ATCDialogOld.cxx @@ -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 = ""; diff --git a/src/Airports/gnnode.cxx b/src/Airports/gnnode.cxx index 9bde00780..0dc0e8ff0 100644 --- a/src/Airports/gnnode.cxx +++ b/src/Airports/gnnode.cxx @@ -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(); } diff --git a/src/Airports/groundnetwork.cxx b/src/Airports/groundnetwork.cxx index 4802b97c5..20d0a793d 100644 --- a/src/Airports/groundnetwork.cxx +++ b/src/Airports/groundnetwork.cxx @@ -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; diff --git a/src/Instrumentation/HUD/HUD_runway.cxx b/src/Instrumentation/HUD/HUD_runway.cxx index 42f2e44ac..ae2f12437 100644 --- a/src/Instrumentation/HUD/HUD_runway.cxx +++ b/src/Instrumentation/HUD/HUD_runway.cxx @@ -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(); diff --git a/src/Radio/itm.cpp b/src/Radio/itm.cpp index d5c3e7f8a..8f75162ce 100644 --- a/src/Radio/itm.cpp +++ b/src/Radio/itm.cpp @@ -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 //******************************************************** diff --git a/src/Radio/radio.cxx b/src/Radio/radio.cxx index 0b36a659d..34f43cf69 100644 --- a/src/Radio/radio.cxx +++ b/src/Radio/radio.cxx @@ -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 elevations; deque materials; diff --git a/src/Time/light.cxx b/src/Time/light.cxx index 88472cffe..d12d67049 100644 --- a/src/Time/light.cxx +++ b/src/Time/light.cxx @@ -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;