diff options
author | Mattias Andrée <m@maandree.se> | 2025-03-07 22:31:13 +0100 |
---|---|---|
committer | Mattias Andrée <m@maandree.se> | 2025-03-07 22:31:13 +0100 |
commit | 7efe006a319f91f5bfa98a72b424a99897e9792f (patch) | |
tree | e590bff6f9a0529e30a804941da462ac78c60ace /solar.c | |
parent | Improve quality, fix errors, update comments, update man pages, add new man pages (diff) | |
download | libred-7efe006a319f91f5bfa98a72b424a99897e9792f.tar.gz libred-7efe006a319f91f5bfa98a72b424a99897e9792f.tar.bz2 libred-7efe006a319f91f5bfa98a72b424a99897e9792f.tar.xz |
Fix bugs
Signed-off-by: Mattias Andrée <m@maandree.se>
Diffstat (limited to 'solar.c')
-rw-r--r-- | solar.c | 19 |
1 files changed, 17 insertions, 2 deletions
@@ -1,5 +1,6 @@ /* See LICENSE file for copyright and license details. */ #include "libred.h" +#undef libred_solar_elevation #include <math.h> #include <time.h> #include <errno.h> @@ -21,6 +22,10 @@ #endif +/* old erroneous function declarations: */ +double libred_solar_elevation(double latitude, double longitude, double *elevation); + + /** * Get current Julian Centuries time (100 Julian Days since J2000) * and Julian Day time @@ -297,8 +302,8 @@ solar_elevation_from_time(double tc, double td, double latitude, double longitud * @return 0 on success, -1 on failure * @throws Any error specified for clock_gettime(3) on error */ -double -libred_solar_elevation(double latitude, double longitude, double *elevation) +int +libred_solar_elevation__int(double latitude, double longitude, double *elevation) { double tc, td; if (julian_time(&tc, &td)) @@ -308,6 +313,16 @@ libred_solar_elevation(double latitude, double longitude, double *elevation) } /** + * Kept for binary compatibility + */ +double +libred_solar_elevation(double latitude, double longitude, double *elevation) +{ + int r = libred_solar_elevation__int(latitude, longitude, elevation); + return (double)r; +} + +/** * This function is obsolete */ int |