Fixed several compiler warnings
uninitialized or unused variables, init sequence, ...
This commit is contained in:
parent
07fe929288
commit
133cfbfa7f
8 changed files with 14 additions and 11 deletions
|
@ -59,8 +59,8 @@ FGAIBase::FGAIBase(object_type ot) :
|
|||
props( NULL ),
|
||||
model_removed( fgGetNode("/ai/models/model-removed", true) ),
|
||||
manager( NULL ),
|
||||
fp( NULL ),
|
||||
_installed(false),
|
||||
fp( NULL ),
|
||||
_impact_lat(0),
|
||||
_impact_lon(0),
|
||||
_impact_elev(0),
|
||||
|
|
|
@ -375,7 +375,7 @@ void FGAIWingman::Break(double dt) {
|
|||
void FGAIWingman::Join(double dt) {
|
||||
|
||||
double range, bearing, az2;
|
||||
double parent_hdg, parent_spd, parent_ht= 0;
|
||||
double parent_hdg, parent_spd = 0;
|
||||
double p_hdg, p_pch, p_rll = 0;
|
||||
|
||||
setTgtOffsets(dt, 25);
|
||||
|
@ -425,7 +425,7 @@ void FGAIWingman::Join(double dt) {
|
|||
double rel_brg = calcRelBearingDeg(bearing, hdg);
|
||||
double recip_brg = calcRecipBearingDeg(bearing);
|
||||
double angle = calcAngle(distance,_offsetpos, pos);
|
||||
double approx_angle = atan2(daltM, range);
|
||||
//double approx_angle = atan2(daltM, range);
|
||||
double frm_spd = 50; // formation speed
|
||||
double join_rnge = 1000.0;
|
||||
double recip_parent_hdg = calcRecipBearingDeg(parent_hdg);
|
||||
|
|
|
@ -332,8 +332,10 @@ void Gear::calcForce(RigidBody* body, State *s, float* v, float* rot)
|
|||
float b = ground[3] - Math::dot3(tmp, ground)+BumpAltitude;
|
||||
|
||||
// Calculate the point of ground _contact.
|
||||
_frac = a/(a-b);
|
||||
if(b < 0) _frac = 1;
|
||||
if(b < 0)
|
||||
_frac = 1;
|
||||
else
|
||||
_frac = a/(a-b);
|
||||
for(i=0; i<3; i++)
|
||||
_contact[i] = _pos[i] + _frac*_cmpr[i];
|
||||
|
||||
|
|
|
@ -99,7 +99,7 @@ void Rotorpart::inititeration(float dt,float *rot)
|
|||
float b;
|
||||
b=_rotor->getBalance();
|
||||
float s =Math::sin(_phi+_direction);
|
||||
float c =Math::cos(_phi+_direction);
|
||||
//float c =Math::cos(_phi+_direction);
|
||||
if (s>0)
|
||||
_balance=(b>0)?(1.-s*(1.-b)):(1.-s)*(1.+b);
|
||||
else
|
||||
|
@ -548,7 +548,7 @@ void Rotorpart::calcForce(float* v, float rho, float* out, float* torque,
|
|||
|
||||
float dirblade[3];
|
||||
Math::cross3(_normal,_directionofcentripetalforce,dirblade);
|
||||
float vblade=Math::abs(Math::dot3(dirblade,v));
|
||||
//float vblade=Math::abs(Math::dot3(dirblade,v));
|
||||
|
||||
alpha=_alphaalt+(alpha-_alphaalt)*factor;
|
||||
_alpha=alpha;
|
||||
|
|
|
@ -654,7 +654,7 @@ string DCLGPS::ExpandSIAPIdent(const string& ident) {
|
|||
Col 107-111 MSA center fix. We can ignore this.
|
||||
*/
|
||||
void DCLGPS::LoadApproachData() {
|
||||
FGNPIAP* iap;
|
||||
FGNPIAP* iap = NULL;
|
||||
GPSWaypoint* wp;
|
||||
GPSFlightPlan* fp;
|
||||
const GPSWaypoint* cwp;
|
||||
|
|
|
@ -125,7 +125,6 @@ HeadingIndicatorDG::update (double dt)
|
|||
double yaw_rate = _yaw_rate_node->getDoubleValue();
|
||||
double error = _error_node->getDoubleValue();
|
||||
double g = _g_node->getDoubleValue();
|
||||
int sign = 0;
|
||||
|
||||
if ( fabs ( yaw_rate ) > 5 ) {
|
||||
error += 0.033 * -yaw_rate * dt ;
|
||||
|
|
|
@ -342,6 +342,9 @@ public:
|
|||
case RESTRICT_NONE:
|
||||
assert(false);
|
||||
break;
|
||||
case SPEED_RESTRICT_MACH:
|
||||
assert(false);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -53,13 +53,12 @@ void fgSunPositionGST(double gst, double *lon, double *lat) {
|
|||
/* double *lat; (return) latitude */
|
||||
/* double *lon; (return) longitude */
|
||||
|
||||
double alpha, delta;
|
||||
double tmp;
|
||||
|
||||
SGPropertyNode* sun = fgGetNode("/ephemeris/sun");
|
||||
assert(sun);
|
||||
double xs = sun->getDoubleValue("xs");
|
||||
double ys = sun->getDoubleValue("ys");
|
||||
//double ys = sun->getDoubleValue("ys");
|
||||
double ye = sun->getDoubleValue("ye");
|
||||
double ze = sun->getDoubleValue("ze");
|
||||
double ra = atan2(ye, xs);
|
||||
|
|
Loading…
Reference in a new issue