Skip to content

Commit 4ec1154

Browse files
committed
Some cppcheck fixes
1 parent c18d35e commit 4ec1154

File tree

4 files changed

+8
-6
lines changed

4 files changed

+8
-6
lines changed

.github/workflows/build.yml

+4-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ on:
1313
jobs:
1414

1515
build:
16-
name: Build libraries
16+
name: Build library
1717

1818
runs-on: ubuntu-latest
1919
env:
@@ -27,6 +27,9 @@ jobs:
2727
- name: Build shared library
2828
run: make shared
2929

30+
- name: Compile solsys variants
31+
run: make solsys
32+
3033
- name: Generate CIO locator data
3134
run: make cio_file
3235

Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ include config.mk
1818
api: static shared cio_file dox
1919

2020
.PHONY: all
21-
all: api solsys tools test coverage
21+
all: api solsys tools test coverage check
2222

2323
.PHONY: static
2424
static: lib/novas.a

src/eph_manager.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,7 @@ short planet_ephemeris(const double tjd[2], enum de_planet target, enum de_plane
278278
// and for target or center being the Earth-Moon barycenter.
279279
if((target == DE_EARTH) || (origin == DE_EARTH)) do_moon = 1;
280280
if((target == DE_MOON) || (origin == DE_MOON)) do_earth = 1;
281-
if((target == DE_EMB) || (DE_EMB == 12)) do_earth = 1;
281+
if((target == DE_EMB) || (origin == DE_EMB)) do_earth = 1;
282282

283283
if(do_earth) {
284284
error = state(jed, DE_EARTH, pos_earth, vel_earth);

src/solsys3.c

+2-3
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,6 @@ short earth_sun_calc(double jd_tdb, enum novas_planet body, enum novas_origin or
176176
velocity[i] = (p[2][i] - p[0][i]) / 0.2;
177177
}
178178
}
179-
180179
else return 2;
181180

182181
// If 'origin' = 0, move origin to solar system barycenter.
@@ -228,8 +227,8 @@ short earth_sun_calc(double jd_tdb, enum novas_planet body, enum novas_origin or
228227
}
229228

230229
for(i = 0; i < 3; i++) {
231-
if(position) position[i] -= pbary[i];
232-
if(velocity) velocity[i] -= vbary[i];
230+
position[i] -= pbary[i];
231+
velocity[i] -= vbary[i];
233232
}
234233
}
235234

0 commit comments

Comments
 (0)