summaryrefslogtreecommitdiff
path: root/driver_evermore.c
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2009-10-26 11:24:49 +0000
committerEric S. Raymond <esr@thyrsus.com>2009-10-26 11:24:49 +0000
commit3a3f93c26bc998deee204054abe08cd74dfb0817 (patch)
treefa360d76126676fae30b0579745fb54aa472d645 /driver_evermore.c
parent7c9d538c629e046924e96974e67732a01c706674 (diff)
downloadgpsd-3a3f93c26bc998deee204054abe08cd74dfb0817.tar.gz
Splint pacification, part 2.
Diffstat (limited to 'driver_evermore.c')
-rw-r--r--driver_evermore.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/driver_evermore.c b/driver_evermore.c
index 3301124e..e5aac8bd 100644
--- a/driver_evermore.c
+++ b/driver_evermore.c
@@ -164,7 +164,7 @@ gps_mask_t evermore_parse(struct gps_device_t *session, unsigned char *buf, size
tp++;
}
- type = getub(buf2, 1);
+ type = (unsigned char)getub(buf2, 1);
/*@ +usedef @*/
/*@ -usedef -compdef @*/
@@ -180,14 +180,16 @@ gps_mask_t evermore_parse(struct gps_device_t *session, unsigned char *buf, size
switch (type)
{
case 0x02: /* Navigation Data Output */
+ /*@ ignore @*//*@ splint is confused @*/
session->gpsdata.fix.time =
gpstime_to_unix((int)getleuw(buf2, 2), getleul(buf2, 4)*0.01) - session->context->leap_seconds;
+ /*@ end @*/
ecef_to_wgs84fix(&session->gpsdata,
getlesl(buf2, 8)*1.0, getlesl(buf2, 12)*1.0, getlesl(buf2, 16)*1.0,
getlesw(buf2, 20)/10.0, getlesw(buf2, 22)/10.0, getlesw(buf2, 24)/10.0);
- used = getub(buf2, 26) & 0x0f;
+ used = (unsigned char)getub(buf2, 26) & 0x0f;
//visible = (getub(buf2, 26) & 0xf0) >> 4;
- version = getleuw(buf2, 27)/100.0;
+ version = (uint)getleuw(buf2, 27)/100.0;
/* that's all the information in this packet */
if (used < 3)
session->gpsdata.fix.mode = MODE_NO_FIX;
@@ -217,8 +219,10 @@ gps_mask_t evermore_parse(struct gps_device_t *session, unsigned char *buf, size
return mask | CLEAR_SET | REPORT_SET;
case 0x04: /* DOP Data Output */
+ /*@ ignore @*//*@ splint is confused @*/
session->gpsdata.fix.time =
gpstime_to_unix((int)getleuw(buf2, 2), getleul(buf2, 4)*0.01) - session->context->leap_seconds;
+ /*@ end @*/
clear_dop(&session->gpsdata.dop);
session->gpsdata.dop.gdop = (double)getub(buf2, 8)*0.1;
session->gpsdata.dop.pdop = (double)getub(buf2, 9)*0.1;
@@ -257,8 +261,10 @@ gps_mask_t evermore_parse(struct gps_device_t *session, unsigned char *buf, size
return mask;
case 0x06: /* Channel Status Output */
+ /*@ ignore @*//*@ splint is confused @*/
session->gpsdata.skyview_time =
gpstime_to_unix((int)getleuw(buf2, 2), getleul(buf2, 4)*0.01) - session->context->leap_seconds;
+ /*@ end @*/
session->gpsdata.satellites_visible = (int)getub(buf2, 8);
session->gpsdata.satellites_used = 0;
memset(session->gpsdata.used, 0, sizeof(session->gpsdata.used));
@@ -306,8 +312,10 @@ gps_mask_t evermore_parse(struct gps_device_t *session, unsigned char *buf, size
case 0x08: /* Measurement Data Output */
/* clock offset is a manufacturer diagnostic */
/* (int)getleuw(buf2, 8); clock offset, 29000..29850 ?? */
+ /*@ ignore @*//*@ splint is confused @*/
session->gpsdata.fix.time =
gpstime_to_unix((int)getleuw(buf2, 2), getleul(buf2, 4)*0.01) - session->context->leap_seconds;
+ /*@ end @*/
visible = (unsigned char)getub(buf2, 10);
/* FIXME: read full statellite status for each channel */
/* we can get pseudo range (m), delta-range (m/s), doppler (Hz) and status for each channel */