Fixed some gcc warnings.
src/AIModel/AIFlightPlan.cxx: Clarify expression with extra round brackets. src/AIModel/AIFlightPlanCreate.cxx: Increased buffer size to match longest possible string. src/FDM/JSBSim/input_output/FGOutputFG.cpp: Use cast to avoid comparison of int with enum.
This commit is contained in:
parent
748f10ebc4
commit
a7b9721296
3 changed files with 6 additions and 6 deletions
|
@ -399,8 +399,8 @@ void FGAIFlightPlan::IncrementWaypoint(bool eraseWaypoints )
|
|||
int nextBearing = this->getBearing(currentWP, nextWP);
|
||||
|
||||
nextTurnAngle = SGMiscd::normalizePeriodic(-180, 180, nextBearing - currentBearing);
|
||||
if (previousWP->getSpeed()>0&&nextWP->getSpeed()<0 ||
|
||||
previousWP->getSpeed()<0&&nextWP->getSpeed()>0) {
|
||||
if ((previousWP->getSpeed() > 0 && nextWP->getSpeed() < 0) ||
|
||||
(previousWP->getSpeed() < 0 && nextWP->getSpeed() > 0)) {
|
||||
nextTurnAngle += 180;
|
||||
SG_LOG(SG_AI, SG_BULK, "Add 180 to turn angle pushback end");
|
||||
}
|
||||
|
|
|
@ -468,8 +468,8 @@ bool FGAIFlightPlan::createLandingTaxi(FGAIAircraft * ac, FGAirport * apt,
|
|||
// int route;
|
||||
for (int i = 0; i < size - 2; i++) {
|
||||
taxiRoute.next(node, &route);
|
||||
char buffer[20];
|
||||
snprintf(buffer, 20, "landingtaxi-%d-%d", node->getIndex(), i);
|
||||
char buffer[32];
|
||||
snprintf(buffer, sizeof(buffer), "landingtaxi-%d-%d", node->getIndex(), i);
|
||||
FGAIWaypoint *wpt =
|
||||
createOnGround(ac, buffer, node->geod(), apt->getElevation(),
|
||||
ac->getPerformance()->vTaxi());
|
||||
|
|
|
@ -214,7 +214,7 @@ void FGOutputFG::SocketDataFill(FGNetFDM* net)
|
|||
net->stall_warning = 0.0; // 0.0 - 1.0 indicating the amount of stall
|
||||
net->slip_deg = (float)(Auxiliary->Getbeta(inDegrees)); // slip ball deflection, deg
|
||||
|
||||
net->num_engines = min(FGNetFDM::FG_MAX_ENGINES,Propulsion->GetNumEngines()); // Number of valid engines
|
||||
net->num_engines = min((unsigned) FGNetFDM::FG_MAX_ENGINES, Propulsion->GetNumEngines()); // Number of valid engines
|
||||
|
||||
for (i=0; i<net->num_engines; i++) {
|
||||
FGEngine* engine = Propulsion->GetEngine(i);
|
||||
|
@ -254,7 +254,7 @@ void FGOutputFG::SocketDataFill(FGNetFDM* net)
|
|||
}
|
||||
}
|
||||
|
||||
net->num_tanks = min(FGNetFDM::FG_MAX_TANKS, Propulsion->GetNumTanks()); // Max number of fuel tanks
|
||||
net->num_tanks = min((unsigned) FGNetFDM::FG_MAX_TANKS, Propulsion->GetNumTanks()); // Max number of fuel tanks
|
||||
|
||||
for (i=0; i<net->num_tanks; i++) {
|
||||
net->fuel_quantity[i] = (float)(((FGTank *)Propulsion->GetTank(i))->GetContents());
|
||||
|
|
Loading…
Reference in a new issue