diff options
author | Eric S. Raymond <esr@thyrsus.com> | 2015-03-08 10:23:32 -0400 |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 2015-03-08 10:23:32 -0400 |
commit | 93f417401f02b85e936d93cf5f7ba54d75de49de (patch) | |
tree | dc26b8d52b09aeafdcc19a58b1eb0e01a5d4ad8c | |
parent | c492d91075cbb10c13b2670a8d63e0dae1014ec4 (diff) | |
download | gpsd-93f417401f02b85e936d93cf5f7ba54d75de49de.tar.gz |
One of the float-elimination steps busted something. Revert.
-rw-r--r-- | driver_evermore.c | 12 | ||||
-rw-r--r-- | driver_italk.c | 10 | ||||
-rw-r--r-- | driver_navcom.c | 6 | ||||
-rw-r--r-- | driver_proto.c | 2 | ||||
-rw-r--r-- | driver_sirf.c | 4 | ||||
-rw-r--r-- | driver_tsip.c | 14 | ||||
-rw-r--r-- | driver_ubx.c | 5 | ||||
-rw-r--r-- | driver_zodiac.c | 2 | ||||
-rw-r--r-- | gpsd.h-tail | 2 | ||||
-rw-r--r-- | timebase.c | 4 |
10 files changed, 29 insertions, 32 deletions
diff --git a/driver_evermore.c b/driver_evermore.c index 4f63c183..f7328182 100644 --- a/driver_evermore.c +++ b/driver_evermore.c @@ -181,9 +181,9 @@ gps_mask_t evermore_parse(struct gps_device_t * session, unsigned char *buf, switch (type) { case 0x02: /* Navigation Data Output */ - session->newdata.time = (timestamp_t)gpsd_gpstime_resolve(session, - (unsigned short)getleu16(buf2, 3), - (double)getleu32(buf2, 5) * 0.01); + session->newdata.time = gpsd_gpstime_resolve(session, + (unsigned short)getleu16(buf2, 3), + (double)getleu32(buf2, 5) * 0.01); ecef_to_wgs84fix(&session->newdata, &session->gpsdata.separation, (double)getles32(buf2, 9) * 1.0, (double)getles32(buf2, 13) * 1.0, @@ -219,7 +219,7 @@ gps_mask_t evermore_parse(struct gps_device_t * session, unsigned char *buf, return mask | CLEAR_IS | REPORT_IS; case 0x04: /* DOP Data Output */ - session->newdata.time = (timestamp_t)gpsd_gpstime_resolve(session, + session->newdata.time = gpsd_gpstime_resolve(session, (unsigned short)getleu16(buf2, 3), (double)getleu32(buf2, 5) * 0.01); /* @@ -263,7 +263,7 @@ gps_mask_t evermore_parse(struct gps_device_t * session, unsigned char *buf, return mask; case 0x06: /* Channel Status Output */ - session->gpsdata.skyview_time = (timestamp_t)gpsd_gpstime_resolve(session, + session->gpsdata.skyview_time = gpsd_gpstime_resolve(session, (unsigned short)getleu16(buf2, 3), (double)getleu32(buf2, 5) * 0.01); session->gpsdata.satellites_visible = (int)getub(buf2, 9); @@ -318,7 +318,7 @@ gps_mask_t evermore_parse(struct gps_device_t * session, unsigned char *buf, case 0x08: /* Measurement Data Output */ /* clock offset is a manufacturer diagnostic */ /* (int)getleu16(buf2, 9); clock offset, 29000..29850 ?? */ - session->newdata.time = (timestamp_t)gpsd_gpstime_resolve(session, + session->newdata.time = gpsd_gpstime_resolve(session, (unsigned short)getleu16(buf2, 3), (double)getleu32(buf2, 5) * 0.01); visible = (unsigned char)getub(buf2, 11); diff --git a/driver_italk.c b/driver_italk.c index 327a7a6c..60883163 100644 --- a/driver_italk.c +++ b/driver_italk.c @@ -60,7 +60,7 @@ static gps_mask_t decode_itk_navfix(struct gps_device_t *session, || 0 == (flags & FIXINFO_FLAG_VALID)) return mask; - session->newdata.time = (timestamp_t)gpsd_gpstime_resolve(session, + session->newdata.time = gpsd_gpstime_resolve(session, (unsigned short) getles16(buf, 7 + 82), (unsigned int)getleu32(buf, 7 + 84) / 1000.0); mask |= TIME_SET | PPSTIME_IS; @@ -130,7 +130,7 @@ static gps_mask_t decode_itk_prnstatus(struct gps_device_t *session, } else { unsigned int i, nsv, nchan, st; - session->gpsdata.skyview_time = (timestamp_t)gpsd_gpstime_resolve(session, + session->gpsdata.skyview_time = gpsd_gpstime_resolve(session, (unsigned short)getleu16(buf, 7 + 4), (unsigned int)getleu32(buf, 7 + 6) / 1000.0), gpsd_zero_satellites(&session->gpsdata); @@ -190,7 +190,7 @@ static gps_mask_t decode_itk_utcionomodel(struct gps_device_t *session, if (session->context->leap_seconds < leap) session->context->leap_seconds = leap; - session->newdata.time = (timestamp_t)gpsd_gpstime_resolve(session, + session->newdata.time = gpsd_gpstime_resolve(session, (unsigned short) getleu16(buf, 7 + 36), (unsigned int)getleu32(buf, 7 + 38) / 1000.0); gpsd_log(&session->context->errout, LOG_DATA, @@ -255,8 +255,8 @@ static gps_mask_t decode_itk_pseudo(struct gps_device_t *session, if ((flags & 0x3) != 0x3) return 0; // bail if measurement time not valid. - session->newdata.time = (timestamp_t)gpsd_gpstime_resolve(session, - (unsigned short int)getleu16((char *)buf, 7 + 8), + session->newdata.time = gpsd_gpstime_resolve(session, + (unsigned short int)getleu16((char *)buf, 7 + 8), (unsigned int)getleu32(buf, 7 + 38) / 1000.0); /*@-type@*/ diff --git a/driver_navcom.c b/driver_navcom.c index 2a59c38c..5554f03b 100644 --- a/driver_navcom.c +++ b/driver_navcom.c @@ -404,7 +404,7 @@ static gps_mask_t handle_0xb1(struct gps_device_t *session) /* Timestamp */ week = (uint16_t) getleu16(buf, 3); tow = (uint32_t) getleu32(buf, 5); - session->newdata.time = (timestamp_t)gpsd_gpstime_resolve(session, week, tow / 1000.0); + session->newdata.time = gpsd_gpstime_resolve(session, week, tow / 1000.0); /* Get latitude, longitude */ lat = getles32(buf, 13); @@ -714,7 +714,7 @@ static gps_mask_t handle_0x86(struct gps_device_t *session) //uint8_t pdop = getub(buf, 15); /* Timestamp */ - session->gpsdata.skyview_time = (timestamp_t)gpsd_gpstime_resolve(session, + session->gpsdata.skyview_time = gpsd_gpstime_resolve(session, (unsigned short)week, (double)tow / 1000.0f); @@ -929,7 +929,7 @@ static gps_mask_t handle_0xb5(struct gps_device_t *session) session->newdata.epv = alt_sd * 1.96; mask |= (HERR_SET | VERR_SET); #endif /* __UNUSED__ */ - session->newdata.time = (timestamp_t)gpsd_gpstime_resolve(session, + session->newdata.time = gpsd_gpstime_resolve(session, (unsigned short)week, (double)tow / 1000.0f); gpsd_log(&session->context->errout, LOG_PROG, diff --git a/driver_proto.c b/driver_proto.c index 16b0ac7f..1b44990a 100644 --- a/driver_proto.c +++ b/driver_proto.c @@ -154,7 +154,7 @@ _proto__msg_utctime(struct gps_device_t *session, unsigned char *buf, size_t dat tow = GET_MS_TIMEOFWEEK(); gps_week = GET_WEEKNUMBER(); session->context->leap_seconds = GET_GPS_LEAPSECONDS(); - session->newdata.time = (timestamp_t)gpsd_gpstime_resolve(session, gps_week, tow / 1000.0); + session->newdata.time = gpsd_gpstime_resolve(session, gps_week, tow / 1000.0); return TIME_SET | PPSTIME_IS | ONLINE_SET; } diff --git a/driver_sirf.c b/driver_sirf.c index 0d0b81f5..b2cf575d 100644 --- a/driver_sirf.c +++ b/driver_sirf.c @@ -574,7 +574,7 @@ static gps_mask_t sirf_msg_svinfo(struct gps_device_t *session, if (len != 188) return 0; - session->gpsdata.skyview_time = (timestamp_t)gpsd_gpstime_resolve(session, + session->gpsdata.skyview_time = gpsd_gpstime_resolve(session, (unsigned short)getbes16(buf, 1), (unsigned int)getbeu32(buf, 3) * 1e-2); @@ -740,7 +740,7 @@ static gps_mask_t sirf_msg_navsol(struct gps_device_t *session, navtype, session->gpsdata.status, session->newdata.mode); /* byte 20 is HDOP, see below */ /* byte 21 is "mode 2", not clear how to interpret that */ - session->newdata.time = (timestamp_t)gpsd_gpstime_resolve(session, + session->newdata.time = gpsd_gpstime_resolve(session, (unsigned short)getbes16(buf, 22), (double)getbeu32(buf, 24) * 1e-2); #ifdef TIMEHINT_ENABLE if (session->newdata.mode <= MODE_NO_FIX) { diff --git a/driver_tsip.c b/driver_tsip.c index 750b990e..6e503841 100644 --- a/driver_tsip.c +++ b/driver_tsip.c @@ -266,8 +266,7 @@ static gps_mask_t tsip_parse_input(struct gps_device_t *session) session->context->leap_seconds = (int)round(f2); session->context->valid |= LEAP_SECOND_VALID; session->newdata.time = - (timestamp_t)gpsd_gpstime_resolve(session, - (unsigned short)s1, (double)f1); + gpsd_gpstime_resolve(session, (unsigned short)s1, (double)f1); mask |= TIME_SET | PPSTIME_IS; } gpsd_log(&session->context->errout, LOG_INF, @@ -372,7 +371,7 @@ static gps_mask_t tsip_parse_input(struct gps_device_t *session) f2 = getbef32((char *)buf, 16); /* time-of-fix */ if ((session->context->valid & GPS_TIME_VALID)!=0) { session->newdata.time = - (timestamp_t)gpsd_gpstime_resolve(session, + gpsd_gpstime_resolve(session, (unsigned short)session->context->gps_week, (double)f2); mask |= TIME_SET | PPSTIME_IS; @@ -646,7 +645,7 @@ static gps_mask_t tsip_parse_input(struct gps_device_t *session) f1 = getbef32((char *)buf, 32); /* time-of-fix */ if ((session->context->valid & GPS_TIME_VALID)!=0) { session->newdata.time = - (timestamp_t)gpsd_gpstime_resolve(session, + gpsd_gpstime_resolve(session, (unsigned short)session->context->gps_week, (double)f1); mask |= TIME_SET | PPSTIME_IS; @@ -741,7 +740,7 @@ static gps_mask_t tsip_parse_input(struct gps_device_t *session) session->context->leap_seconds = (int)u4; session->context->valid |= LEAP_SECOND_VALID; } - session->newdata.time = (timestamp_t)gpsd_gpstime_resolve(session, + session->newdata.time = gpsd_gpstime_resolve(session, (unsigned short)s4, (double)ul1 *1e-3); mask |= @@ -781,7 +780,7 @@ static gps_mask_t tsip_parse_input(struct gps_device_t *session) session->context->valid |= LEAP_SECOND_VALID; } session->newdata.time = - (timestamp_t)gpsd_gpstime_resolve(session, + gpsd_gpstime_resolve(session, (unsigned short)s1, (double)ul1 *1e3); session->gpsdata.status = STATUS_NO_FIX; session->newdata.mode = MODE_NO_FIX; @@ -844,8 +843,7 @@ static gps_mask_t tsip_parse_input(struct gps_device_t *session) session->context->leap_seconds = (int)s2; session->context->valid |= LEAP_SECOND_VALID; session->newdata.time = - (timestamp_t)gpsd_gpstime_resolve(session, - (unsigned short)s1, (double)ul1); + gpsd_gpstime_resolve(session, (unsigned short)s1, (double)ul1); mask |= TIME_SET | PPSTIME_IS | CLEAR_IS; gpsd_log(&session->context->errout, LOG_DATA, "SP-TTS 0xab time=%.2f mask={TIME}\n", diff --git a/driver_ubx.c b/driver_ubx.c index 932d5d64..350f4990 100644 --- a/driver_ubx.c +++ b/driver_ubx.c @@ -94,8 +94,7 @@ ubx_msg_nav_sol(struct gps_device_t *session, unsigned char *buf, unsigned int tow; tow = (unsigned int)getleu32(buf, 0); gw = (unsigned short)getles16(buf, 8); - session->newdata.time = (timestamp_t)gpsd_gpstime_resolve(session, - gw, tow / 1000.0); + session->newdata.time = gpsd_gpstime_resolve(session, gw, tow / 1000.0); mask |= TIME_SET | PPSTIME_IS; } @@ -224,7 +223,7 @@ ubx_msg_nav_timegps(struct gps_device_t *session, unsigned char *buf, flags = (unsigned int)getub(buf, 11); if ((flags & 0x7) != 0) session->context->leap_seconds = (int)getub(buf, 10); - session->newdata.time = (timestamp_t)gpsd_gpstime_resolve(session, + session->newdata.time = gpsd_gpstime_resolve(session, (unsigned short int)gw, (double)tow / 1000.0); diff --git a/driver_zodiac.c b/driver_zodiac.c index 95a3c62f..d3fe0b7e 100644 --- a/driver_zodiac.c +++ b/driver_zodiac.c @@ -244,7 +244,7 @@ static gps_mask_t handle1002(struct gps_device_t *session) session->gpsdata.skyview[i].ss = (float)getzword(17 + (3 * i)); session->gpsdata.skyview[i].used = (bool)(status & 1); } - session->gpsdata.skyview_time = (timestamp_t)gpsd_gpstime_resolve(session, + session->gpsdata.skyview_time = gpsd_gpstime_resolve(session, (unsigned short)gps_week, (double)gps_seconds); gpsd_log(&session->context->errout, LOG_DATA, diff --git a/gpsd.h-tail b/gpsd.h-tail index 54428636..413986ec 100644 --- a/gpsd.h-tail +++ b/gpsd.h-tail @@ -794,7 +794,7 @@ extern ssize_t gpsd_write(struct gps_device_t *, const char *, const size_t); extern void gpsd_time_init(struct gps_context_t *, time_t); extern void gpsd_set_century(struct gps_device_t *); -extern time_t gpsd_gpstime_resolve(/*@in@ */ struct gps_device_t *, +extern timestamp_t gpsd_gpstime_resolve(/*@in@ */ struct gps_device_t *, const unsigned short, const double); extern timestamp_t gpsd_utc_resolve(/*@in@*/struct gps_device_t *); extern void gpsd_century_update(/*@in@*/struct gps_device_t *, int); @@ -325,10 +325,10 @@ void gpsd_century_update(/*@in@*/struct gps_device_t *session, int century) } #endif /* NMEA_ENABLE */ -time_t gpsd_gpstime_resolve(/*@in@*/struct gps_device_t *session, +timestamp_t gpsd_gpstime_resolve(/*@in@*/struct gps_device_t *session, unsigned short week, double tow) { - time_t t; + timestamp_t t; /* * This code detects and compensates for week counter rollovers that |