From a5b71554a23cf93a223b82eebc9cda0c383a6db2 Mon Sep 17 00:00:00 2001 From: curt Date: Sat, 19 Jul 1997 22:35:06 +0000 Subject: [PATCH] Moved fiddled with PI to avoid compiler warnings. --- LaRCsim/ls_constants.h | 3 +++ Slew/depend | 3 ++- Slew/slew.c | 14 +++++++++----- 3 files changed, 14 insertions(+), 6 deletions(-) diff --git a/LaRCsim/ls_constants.h b/LaRCsim/ls_constants.h index 3e90aab58..bdd123d86 100644 --- a/LaRCsim/ls_constants.h +++ b/LaRCsim/ls_constants.h @@ -80,6 +80,9 @@ systems of measure) */ /* Value of Pi from ref [3] */ +#ifdef PI +# undef PI /* avoid a harmless compiler warning */ +#endif #define PI 3.14159265358979323846264338327950288419716939967511 /* Value of earth radius from [8], ft */ diff --git a/Slew/depend b/Slew/depend index 9df003d84..77fd35e4e 100644 --- a/Slew/depend +++ b/Slew/depend @@ -2,4 +2,5 @@ slew.o: slew.c slew.h ../flight.h ../Slew/slew.h \ ../LaRCsim/ls_interface.h ../LaRCsim/../flight.h \ ../../Aircraft/aircraft.h ../../Aircraft/../Flight/flight.h \ ../../Aircraft/../Controls/controls.h \ - ../../Aircraft/../Controls/../limits.h ../../Controls/controls.h + ../../Aircraft/../Controls/../limits.h ../../Controls/controls.h \ + ../../constants.h diff --git a/Slew/slew.c b/Slew/slew.c index db258e811..f8029e01b 100644 --- a/Slew/slew.c +++ b/Slew/slew.c @@ -30,6 +30,7 @@ #include "../flight.h" #include "../../Aircraft/aircraft.h" #include "../../Controls/controls.h" +#include "../../constants.h" #ifndef M_PI @@ -76,10 +77,10 @@ void fgSlewUpdate() { c = ¤t_aircraft.controls; /* f->Psi += ( c->aileron / 8 ); - if ( f->Psi > PI2 ) { - f->Psi -= PI2; + if ( f->Psi > FG_2PI ) { + f->Psi -= FG_2PI; } else if ( f->Psi < 0 ) { - f->Psi += PI2; + f->Psi += FG_2PI; } f->vel_x = -c->elev; @@ -90,9 +91,12 @@ void fgSlewUpdate() { /* $Log$ -/* Revision 1.4 1997/06/21 17:12:51 curt -/* Capitalized subdirectory names. +/* Revision 1.5 1997/07/19 22:35:06 curt +/* Moved fiddled with PI to avoid compiler warnings. /* + * Revision 1.4 1997/06/21 17:12:51 curt + * Capitalized subdirectory names. + * * Revision 1.3 1997/05/29 22:40:00 curt * Working on incorporating the LaRCsim flight model. * -- 2.39.2