Skip to content

Commit

Permalink
Some cppcheck fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
attipaci committed Feb 2, 2024
1 parent c18d35e commit 4ec1154
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 6 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ on:
jobs:

build:
name: Build libraries
name: Build library

runs-on: ubuntu-latest
env:
Expand All @@ -27,6 +27,9 @@ jobs:
- name: Build shared library
run: make shared

- name: Compile solsys variants
run: make solsys

- name: Generate CIO locator data
run: make cio_file

Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ include config.mk
api: static shared cio_file dox

.PHONY: all
all: api solsys tools test coverage
all: api solsys tools test coverage check

.PHONY: static
static: lib/novas.a
Expand Down
2 changes: 1 addition & 1 deletion src/eph_manager.c
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ short planet_ephemeris(const double tjd[2], enum de_planet target, enum de_plane
// and for target or center being the Earth-Moon barycenter.
if((target == DE_EARTH) || (origin == DE_EARTH)) do_moon = 1;
if((target == DE_MOON) || (origin == DE_MOON)) do_earth = 1;
if((target == DE_EMB) || (DE_EMB == 12)) do_earth = 1;
if((target == DE_EMB) || (origin == DE_EMB)) do_earth = 1;

if(do_earth) {
error = state(jed, DE_EARTH, pos_earth, vel_earth);
Expand Down
5 changes: 2 additions & 3 deletions src/solsys3.c
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,6 @@ short earth_sun_calc(double jd_tdb, enum novas_planet body, enum novas_origin or
velocity[i] = (p[2][i] - p[0][i]) / 0.2;
}
}

else return 2;

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

for(i = 0; i < 3; i++) {
if(position) position[i] -= pbary[i];
if(velocity) velocity[i] -= vbary[i];
position[i] -= pbary[i];
velocity[i] -= vbary[i];
}
}

Expand Down

0 comments on commit 4ec1154

Please sign in to comment.