From 0066d581a1663ce1e99df0ea83a78644909a86cd Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Fri, 16 Aug 2019 15:37:39 +0200 Subject: [PATCH] Fix warning raised by clang-tidy check cert-flp30-c Loop induction expression should not have floating-point type --- src/algorithms/libs/rtklib/rtklib_ephemeris.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/algorithms/libs/rtklib/rtklib_ephemeris.cc b/src/algorithms/libs/rtklib/rtklib_ephemeris.cc index 167bd3b27..c921766a1 100644 --- a/src/algorithms/libs/rtklib/rtklib_ephemeris.cc +++ b/src/algorithms/libs/rtklib/rtklib_ephemeris.cc @@ -452,13 +452,15 @@ void geph2pos(gtime_t time, const geph_t *geph, double *rs, double *dts, x[i] = geph->pos[i]; x[i + 3] = geph->vel[i]; } - for (tt = t < 0.0 ? -TSTEP : TSTEP; fabs(t) > 1e-9; t -= tt) + tt = t < 0.0 ? -TSTEP : TSTEP; + while (fabs(t) > 1e-9) { if (fabs(t) < TSTEP) { tt = t; } glorbit(tt, x, geph->acc); + t -= tt; } for (i = 0; i < 3; i++) {