1
0
Fork 0

Nailed a uninitialized variable usage bug that was killing us on some

platforms with some compiler options.
This commit is contained in:
curt 1998-08-22 02:01:11 +00:00
parent dc5a0a3f1e
commit 378969e7b8

View file

@ -50,7 +50,7 @@ void fgCalculatePlanet(struct OrbElements planet, struct OrbElements theSun,
{ {
// struct CelestialCoord result; // struct CelestialCoord result;
fgSUNPOS SolarPosition; // fgSUNPOS SolarPosition;
double eccAnom, r, v, ecl, actTime, R, s, ir, Nr, B, FV, ring_magn, double eccAnom, r, v, ecl, actTime, R, s, ir, Nr, B, FV, ring_magn,
xv, yv, xh, yh, zh, xg, yg, zg, xe, ye, ze; xv, yv, xh, yh, zh, xg, yg, zg, xe, ye, ze;
@ -90,7 +90,7 @@ void fgCalculatePlanet(struct OrbElements planet, struct OrbElements theSun,
/* Let's calculate the brightness of the planet */ /* Let's calculate the brightness of the planet */
R = sqrt ( xg*xg + yg*yg + zg*zg); R = sqrt ( xg*xg + yg*yg + zg*zg);
s = SolarPosition.dist; s = solarPosition.dist;
FV = acos( (r*r + R*R - s*s) / (2*r*R)); FV = acos( (r*r + R*R - s*s) / (2*r*R));
FV *= 57.29578; /* convert radians to degrees */ FV *= 57.29578; /* convert radians to degrees */
switch(idx) switch(idx)
@ -210,10 +210,14 @@ void fgPlanetsRender( void ) {
/* $Log$ /* $Log$
/* Revision 1.6 1998/06/27 16:51:54 curt /* Revision 1.7 1998/08/22 02:01:11 curt
/* In fgCalculatePlanet() pass a pointer to a structure to be modified, rather /* Nailed a uninitialized variable usage bug that was killing us on some
/* than returning the entire structure. /* platforms with some compiler options.
/* /*
* Revision 1.6 1998/06/27 16:51:54 curt
* In fgCalculatePlanet() pass a pointer to a structure to be modified, rather
* than returning the entire structure.
*
* Revision 1.5 1998/04/28 01:19:01 curt * Revision 1.5 1998/04/28 01:19:01 curt
* Type-ified fgTIME and fgVIEW * Type-ified fgTIME and fgVIEW
* *