diff --git a/src/ephemeris.c b/src/ephemeris.c index 97b3c381b..79fb1cdad 100644 --- a/src/ephemeris.c +++ b/src/ephemeris.c @@ -385,17 +385,14 @@ extern void geph2pos(gtime_t time, const geph_t *geph, double *rs, double *dts, *-----------------------------------------------------------------------------*/ extern double seph2clk(gtime_t time, const seph_t *seph) { - double t; - int i; - trace(4,"seph2clk: time=%s sat=%2d\n",time_str(time,3),seph->sat); - t=timediff(time,seph->t0); + double ts = timediff(time, seph->t0), t = ts; - for (i=0;i<2;i++) { - t-=seph->af0+seph->af1*t; + for (int i = 0; i < 2; i++) { + t = ts - (seph->af0 + seph->af1 * t); } - return seph->af0+seph->af1*t; + return seph->af0 + seph->af1 * t; } /* sbas ephemeris to satellite position and clock bias ------------------------- * compute satellite position and clock bias with sbas ephemeris