Fix warning raised by clang-tidy check cert-flp30-c

Loop induction expression should not have floating-point type
This commit is contained in:
Carles Fernandez 2019-08-16 15:37:39 +02:00
parent e89a92469b
commit 0066d581a1
No known key found for this signature in database
GPG Key ID: 4C583C52B0C3877D
1 changed files with 3 additions and 1 deletions

View File

@ -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++)
{