diff --git a/CHANGELOG.md b/CHANGELOG.md index daad1197..eace8b6d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,9 @@ Release candidate for the next feature release, expected around 1 February 2025. - Fixes to GCC version checking for macros. + - Fixed dummy `readeph()` implementation in `readeph0.c`, and `DEFAULT_READEPH` in `config.mk`. `readeph0.c` is not + linked by default, and was not linked in prior releases either. + ### Added @@ -114,6 +117,8 @@ Release candidate for the next feature release, expected around 1 February 2025. - Added `-g` to default `CFLAGS` as a matter of GNU best practice. + - Static library is now named `ibsupernovas.a`, which is symlinked to `libnovas.a` for back compatibility. + - Various small tweaks to Makefiles. - Updated `README.md` documentation. diff --git a/config.mk b/config.mk index 83a1aee5..f1850924 100644 --- a/config.mk +++ b/config.mk @@ -74,7 +74,7 @@ endif # Compile library with a default readeph() implementation for solsys1.c, which # will be used only if the application does not define another implementation # via calls to the to set_ephem_reader() function. -DEFAULT_READEPH ?= $(SRC)/readeph0.c +#DEFAULT_READEPH ?= $(SRC)/readeph0.c # Whether to build into the library planet_jplint() routines provided in @@ -190,7 +190,7 @@ ifeq ($(BUILTIN_SOLSYS_EPHEM), 1) SOURCES += $(SRC)/solsys-ephem.c endif -ifdef (DEFAULT_READEPH) +ifdef DEFAULT_READEPH SOURCES += $(DEFAULT_READEPH) CPPFLAGS += -DDEFAULT_READEPH=1 endif diff --git a/src/readeph0.c b/src/readeph0.c index 62f32fb8..f605b7cc 100644 --- a/src/readeph0.c +++ b/src/readeph0.c @@ -28,17 +28,19 @@ double * readeph_dummy(int mp, const char *name, double jd_tdb, int *error) { if(!name || !error) { novas_set_errno(EINVAL, fn, "NULL parameter: name=%p, error=%p", name, error); + if(error) *error = -1; return NULL; } if(isnanf(jd_tdb)) { - novas_set_errno(-1, EINVAL, fn, "NaN jd_tdb"); + novas_set_errno(EINVAL, fn, "NaN jd_tdb"); *error = -1; return NULL; } pv = (double*) calloc(6, sizeof(double)); - *error = 9; + if(pv) *error = 0; + else *error = -1; return pv; } diff --git a/test/Makefile b/test/Makefile index 83d96415..da0c91fa 100644 --- a/test/Makefile +++ b/test/Makefile @@ -12,7 +12,7 @@ LDFLAGS += -fprofile-arcs -ftest-coverage -lm include ../config.mk #OBJECTS := $(subst obj/,,$(OBJECTS)) -OBJECTS := novas.o nutation.o solsys3.o super.o frames.o timescale.o refract.o naif.o +OBJECTS := novas.o nutation.o solsys3.o super.o frames.o timescale.o refract.o naif.o readeph0.o TESTS := test-compat test-cio_file test-super test-errors COVFILES := novas.c.gcov nutation.c.gcov solsys3.c.gcov super.c.gcov timescale.c.gcov refract.c.gcov frames.c.gcov naif.c.gcov diff --git a/test/src/test-cspice.c b/test/src/test-cspice.c index 56c41a3c..f14f356a 100644 --- a/test/src/test-cspice.c +++ b/test/src/test-cspice.c @@ -65,7 +65,6 @@ static int test_cspice() { double jd = NOVAS_JD_J2000; double jd2[2] = { jd, 0.0 }; - char filename[1024]; object earth, mars; make_planet(NOVAS_EARTH, &earth); @@ -91,7 +90,6 @@ static int test_cspice_planet() { double jd = NOVAS_JD_J2000; double jd2[2] = { jd, 0.0 }; - char filename[1024]; object ssb, sun, earth, moon, mars, phobos; make_planet(NOVAS_SSB, &ssb);