1
0
Fork 0

Adjust if/else indentation to fix -Wmisleading-indentation

This commit is contained in:
Gary Preston 2017-04-04 00:21:50 +01:00 committed by James Turner
parent dd0d03ea1d
commit d2ca422c8b

View file

@ -271,6 +271,7 @@ int Rotor::getValueforFGSet(int j,char *text,float *f)
{
if (_name[0]==0) return 0;
if (4>numRotorparts()) return 0; //compile first!
if (j==0)
{
snprintf(text, 256, "/rotors/%s/cone-deg", _name);
@ -280,8 +281,7 @@ int Rotor::getValueforFGSet(int j,char *text,float *f)
+((Rotorpart*)getRotorpart(3*(_number_of_parts>>2)))->getrealAlpha()
)/4*180/pi:0;
}
else
if (j==1)
else if (j==1)
{
snprintf(text, 256, "/rotors/%s/roll-deg", _name);
_roll = ( ((Rotorpart*)getRotorpart(0))->getrealAlpha()
@ -289,8 +289,7 @@ int Rotor::getValueforFGSet(int j,char *text,float *f)
)/2*(_ccw?-1:1);
*f=(_balance1>-1)?_roll *180/pi:0;
}
else
if (j==2)
else if (j==2)
{
snprintf(text, 256, "/rotors/%s/yaw-deg", _name);
_yaw=( ((Rotorpart*)getRotorpart(1*(_number_of_parts>>2)))->getrealAlpha()
@ -298,14 +297,12 @@ int Rotor::getValueforFGSet(int j,char *text,float *f)
)/2;
*f=(_balance1>-1)?_yaw*180/pi:0;
}
else
if (j==3)
else if (j==3)
{
snprintf(text, 256, "/rotors/%s/rpm", _name);
*f=(_balance1>-1)?_omega/2/pi*60:0;
}
else
if (j==4)
else if (j==4)
{
snprintf(text, 256, "/rotors/%s/tilt/pitch-deg",_name);
*f=_tilt_pitch*180/pi;
@ -360,8 +357,8 @@ int Rotor::getValueforFGSet(int j,char *text,float *f)
rk=Math::clamp(rk,0,1);//Delete this
rl=1-rk;
if(w==2) {k+=2;l+=2;}
else
if(w==1) {k+=1;l+=1;}
else if(w==1) {k+=1;l+=1;}
k%=4;
l%=4;
if (w==1) *f=rk*((Rotorpart*) getRotorpart(k*(_number_of_parts>>2)))->getrealAlpha()*180/pi