summaryrefslogtreecommitdiff
path: root/driver_superstar2.c
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2015-03-30 17:10:53 -0400
committerEric S. Raymond <esr@thyrsus.com>2015-03-30 17:10:53 -0400
commit28bf37132d86cc59320e21d843960d086cef664c (patch)
treebf085b5f89f1d1061b6a88ecc66c50721b13d86c /driver_superstar2.c
parentecb7e1ff3ec73000918c56861c55258c2d4deada (diff)
downloadgpsd-28bf37132d86cc59320e21d843960d086cef664c.tar.gz
Retire splint from our set of static analyzers.
The proximate cause was that we've been seing emission of error messages that were randomly and disturbingly variable across different environments - notably Raspbian and Gentoo splint gave nontrivially different results than Ubuntu 14.10 splint. And this was *not* due to Ubuntu patches! A pristine splint built from the 3.1.2 tarball on Ubuntu didn't match the Raspbian and Gentoo results either. But this has been coming for a while. Easy access to more modern static analyzers such as coverity, scan-build and cppcheck has been decreasing the utility of splint, which is unmaintained and somewhat buggy and not easy to use. Only file not cleaned is ppsthread.c, because Gary has been working on it during this cleanup. All regression tests pass. PPS observed live on GR601-W.
Diffstat (limited to 'driver_superstar2.c')
-rw-r--r--driver_superstar2.c22
1 files changed, 2 insertions, 20 deletions
diff --git a/driver_superstar2.c b/driver_superstar2.c
index b0003773..8de7ee03 100644
--- a/driver_superstar2.c
+++ b/driver_superstar2.c
@@ -86,11 +86,9 @@ superstar2_msg_navsol_lla(struct gps_device_t *session,
"superstar2 #20 - user navigation data\n");
mask = 0;
- /*@ +charint @*/
flags = (unsigned char)getub(buf, 72);
if ((flags & 0x0f) != 0x03) /* mode 3 is navigation */
return mask;
- /*@ -charint @*/
/* extract time data */
(void)memset(&tm, '\0', sizeof(tm));
@@ -115,8 +113,8 @@ superstar2_msg_navsol_lla(struct gps_device_t *session,
mask |= LATLON_SET | ALTITUDE_SET | SPEED_SET | TRACK_SET | CLIMB_SET;
session->gpsdata.satellites_used = (int)getub(buf, 71) & 0x0f;
- /*@i3@*/session->gpsdata.dop.hdop = getleu16(buf, 66) * 0.1;
- /*@i3@*/session->gpsdata.dop.vdop = getleu16(buf, 68) * 0.1;
+ session->gpsdata.dop.hdop = getleu16(buf, 66) * 0.1;
+ session->gpsdata.dop.vdop = getleu16(buf, 68) * 0.1;
/* other DOP if available */
mask |= DOP_SET | USED_IS;
@@ -196,10 +194,8 @@ superstar2_msg_svinfo(struct gps_device_t *session,
session->gpsdata.skyview[i].azimuth = (short)getub(buf, off + 2) +
(short)((unsigned short)(getub(buf, off + 3) & 0x1) << 1);
session->gpsdata.skyview[i].used = used;
- /*@ +charint @*/
if (used)
nsv++;
- /*@ -charint @*/
if (session->gpsdata.skyview[i].PRN)
st++;
@@ -221,11 +217,9 @@ superstar2_msg_version(struct gps_device_t *session,
#define SZ 16
char main_sw[SZ], hw_part[SZ], boot_sw[SZ], ser_num[SZ];
- /*@ +charint @*/
/* byte 98 is device type, value = 3 means superstar2 */
if ((data_len != 101) || ((getub(buf, 98) & 0x0f) != 3))
return 0;
- /*@ -charint @*/
(void)snprintf(main_sw, 15, "%s", (char *)buf + 4);
(void)snprintf(hw_part, 15, "%s", (char *)buf + 18);
@@ -257,10 +251,8 @@ superstar2_msg_timing(struct gps_device_t *session, unsigned char *buf,
gpsd_log(&session->context->errout, LOG_PROG,
"superstar2 #113 - timing status\n");
- /*@ +charint @*/
if ((getub(buf, 55) & 0x30) != 0)
mask = 0;
- /*@ -charint @*/
else {
double d;
/* extract time data */
@@ -324,10 +316,8 @@ superstar2_msg_measurement(struct gps_device_t *session, unsigned char *buf,
}
/* request for ionospheric and utc time data #75 */
-/*@ +charint @*/
static unsigned char iono_utc_msg[] = { 0x01, 0x4b, 0xb4, 0x00, 0x00, 0x01 };
-/*@ -charint @*/
/**
@@ -444,7 +434,6 @@ static void superstar2_event_hook(struct gps_device_t *session, event_t event)
return;
if (event == event_identified) {
- /*@ +charint @*/
unsigned char version_msg[] = { 0x01, 0x2d, 0xd2, 0x00, 0x00, 0x01 };
unsigned char svinfo_msg[] = { 0x01, 0xa1, 0x5e, 0x00, 0x00, 0x01 };
unsigned char timing_msg[] = { 0x01, 0xf1, 0x0e, 0x00, 0x00, 0x01 };
@@ -452,7 +441,6 @@ static void superstar2_event_hook(struct gps_device_t *session, event_t event)
unsigned char ephemeris_msg[] = { 0x01, 0x96, 0x69, 0x00, 0x00, 0x01 };
unsigned char measurement_msg[] =
{ 0x01, 0x97, 0x68, 0x01, 0x00, 0x01, 0x01 };
- /*@ -charint @*/
(void)superstar2_write(session, (char *)timing_msg,
sizeof(timing_msg));
@@ -495,14 +483,12 @@ static ssize_t
superstar2_control_send(struct gps_device_t *session, char *msg,
size_t msglen)
{
- /*@ +charint -mayaliasunique @*/
session->msgbuf[0] = 0x1; /* SOH */
session->msgbuf[1] = msg[0];
session->msgbuf[2] = msg[0] ^ 0xff;
session->msgbuf[3] = (char)(msglen + 1);
(void)memcpy(session->msgbuf + 4, msg + 1, msglen - 1);
session->msgbuflen = (size_t) (msglen + 5);
- /*@ -charint +mayaliasunique @*/
return superstar2_write(session, session->msgbuf, session->msgbuflen);
}
#endif /* CONTROLSEND_ENABLE */
@@ -516,13 +502,11 @@ static bool superstar2_set_speed(struct gps_device_t *session,
|| stopbits != (int)session->gpsdata.dev.stopbits) {
return false;
} else {
- /*@ +charint @*/
unsigned char speed_msg[] =
{ 0x01, 0x48, 0xB7, 0x01, 0x00, 0x00, 0x00 };
/* high bit 0 in the mode word means set NMEA mode */
speed_msg[4] = (unsigned char)(speed / 300);
- /*@ -charint @*/
return (superstar2_write(session, (char *)speed_msg, 7) == 7);
}
}
@@ -530,14 +514,12 @@ static bool superstar2_set_speed(struct gps_device_t *session,
static void superstar2_set_mode(struct gps_device_t *session, int mode)
{
if (mode == MODE_NMEA) {
- /*@ +charint @*/
unsigned char mode_msg[] =
{ 0x01, 0x48, 0xB7, 0x01, 0x00, 0x00, 0x00 };
/* high bit 0 in the mode word means set NMEA mode */
mode_msg[4] = (unsigned char)(session->gpsdata.dev.baudrate / 300);
(void)superstar2_write(session, (char *)mode_msg, 7);
- /*@ -charint @*/
} else {
session->back_to_nmea = false;
}