Skip to content

Commit

Permalink
Don't use constants from novascon.c ever in internal API
Browse files Browse the repository at this point in the history
  • Loading branch information
attipaci committed Jun 25, 2024
1 parent 7eb1ef1 commit 3e97f61
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 8 deletions.
2 changes: 1 addition & 1 deletion include/novascon.h
Original file line number Diff line number Diff line change
Expand Up @@ -67,4 +67,4 @@ extern const double ANGVEL;
extern const double RMASS[12];


#endif
#endif /* _CONSTS_ */
6 changes: 2 additions & 4 deletions src/novas.c
Original file line number Diff line number Diff line change
Expand Up @@ -1613,12 +1613,10 @@ short place(double jd_tt, const object *source, const observer *location, double

// Variable 'loc' determines whether Earth deflection is included.
if(loc == NOVAS_OBSERVER_ON_EARTH) {
double pog[3], vog[3];
double pog[3];

for(i = 3; --i >= 0;) {
for(i = 3; --i >= 0;)
pog[i] = pob[i] - peb[i];
vog[i] = vob[i] - veb[i];
}

limb_angle(pos, pog, NULL, &frlimb);
if(frlimb < 0.8)
Expand Down
7 changes: 4 additions & 3 deletions src/novascon.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@
* <a href="http://www.usno.navy.mil/USNO/astronomical-applications">http://www.usno.navy.mil/USNO/astronomical-applications</a>
*/

// We shall never use these in the internal API. We define precompiler constants instead...
#ifndef __NOVAS_INTERNAL_API__

#include "novas.h"
#include "novascon.h"

Expand All @@ -33,9 +36,7 @@ const double ANGVEL = NOVAS_EARTH_ANGVEL;
const double RMASS[12] = NOVAS_RMASS_INIT;





#endif /* __NOVAS_INTERNAL_API__ */



Expand Down

0 comments on commit 3e97f61

Please sign in to comment.