aboutsummaryrefslogtreecommitdiffstats
path: root/solar.c
diff options
context:
space:
mode:
authorMattias Andrée <m@maandree.se>2025-03-07 22:31:13 +0100
committerMattias Andrée <m@maandree.se>2025-03-07 22:31:13 +0100
commit7efe006a319f91f5bfa98a72b424a99897e9792f (patch)
treee590bff6f9a0529e30a804941da462ac78c60ace /solar.c
parentImprove quality, fix errors, update comments, update man pages, add new man pages (diff)
downloadlibred-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 '')
-rw-r--r--solar.c19
1 files changed, 17 insertions, 2 deletions
diff --git a/solar.c b/solar.c
index 1b316bb..97c6dd7 100644
--- a/solar.c
+++ b/solar.c
@@ -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