summaryrefslogtreecommitdiff
path: root/driver_geostar.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_geostar.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_geostar.c')
-rw-r--r--driver_geostar.c18
1 files changed, 0 insertions, 18 deletions
diff --git a/driver_geostar.c b/driver_geostar.c
index 03df4bc2..60d80eb4 100644
--- a/driver_geostar.c
+++ b/driver_geostar.c
@@ -48,10 +48,8 @@ static int geostar_write(struct gps_device_t *session,
putbyte(session->msgbuf, 2, 'G');
putbyte(session->msgbuf, 3, 'G');
- /*@-shiftimplementation +ignoresigns@*/
putbe16(session->msgbuf, 4, id);
putbe16(session->msgbuf, 6, len);
- /*@+shiftimplementation -ignoresigns@*/
/* Copy content */
memcpy(session->msgbuf + 8, data, len * 4);
@@ -63,9 +61,7 @@ static int geostar_write(struct gps_device_t *session,
cs ^= getleu32(session->msgbuf, i * 4);
}
- /*@-shiftimplementation +ignoresigns@*/
putle32(session->msgbuf, len * 4, cs);
- /*@+shiftimplementation -ignoresigns@*/
len += 1; /* Checksum */
@@ -96,9 +92,7 @@ static bool geostar_detect(struct gps_device_t *session)
myfd = session->gpsdata.gps_fd;
/* request firmware revision and look for a valid response */
- /*@-shiftimplementation +ignoresigns@*/
putbe32(buf, 0, 0);
- /*@+shiftimplementation +ignoresigns@*/
if (geostar_write(session, 0xc1, buf, 1) == 0) {
unsigned int n;
for (n = 0; n < 3; n++) {
@@ -140,7 +134,6 @@ static gps_mask_t geostar_analyze(struct gps_device_t *session)
return 0;
}
- /*@ +charint @*/
if (session->lexer.outbuflen < 12 || session->lexer.outbuffer[0] != 'P')
return 0;
@@ -155,7 +148,6 @@ static gps_mask_t geostar_analyze(struct gps_device_t *session)
str_appendf(buf2, sizeof(buf2),
"%02x", buf[len++] = session->lexer.outbuffer[i]);
}
- /*@ -charint @*/
id = (unsigned int)getleu16(session->lexer.outbuffer, OFFSET(0));
@@ -443,10 +435,8 @@ static gps_mask_t geostar_analyze(struct gps_device_t *session)
ul1 = getleu32(buf, OFFSET(2));
ul2 = getleu32(buf, OFFSET(3));
ul3 = getleu32(buf, OFFSET(4));
- /*@ -formattype @*/
(void)snprintf(session->subtype, sizeof(session->subtype), "%d.%d %d.%d.%d %x %c-%d\n",
ul4>>16, ul4&0xFFFF, ul1>>9, (ul1>>5)&0xF, ul1&0x1F, ul2, ul3>>24, ul3&0x00FFFFFF);
- /*@ +formattype @*/
gpsd_log(&session->context->errout, LOG_INF,
"Response to Request FW version command: %s\n",
session->subtype);
@@ -503,11 +493,9 @@ static ssize_t geostar_control_send(struct gps_device_t *session,
static void geostar_init_query(struct gps_device_t *session)
{
- /*@-compdef@*/
unsigned char buf[2 * 4];
/* Poll Software Version */
(void)geostar_write(session, 0xc1, buf, 1);
- /*@+compdef@*/
}
static void geostar_event_hook(struct gps_device_t *session, event_t event)
@@ -517,7 +505,6 @@ static void geostar_event_hook(struct gps_device_t *session, event_t event)
if (session->context->readonly)
return;
- /*@-shiftimplementation +ignoresigns@*/
if (event == event_identified || event == event_reactivate) {
/* Select binary packets */
putbe32(buf, 0, 0xffff0000);
@@ -552,7 +539,6 @@ static void geostar_event_hook(struct gps_device_t *session, event_t event)
putbe32(buf, 0, 3);
(void)geostar_write(session, 0xc2, buf, 1);
}
- /*@+shiftimplementation -ignoresigns@*/
}
#ifdef RECONFIGURE_ENABLE
@@ -577,12 +563,10 @@ static bool geostar_speed_switch(struct gps_device_t *session,
break;
}
- /*@-shiftimplementation@*/
putbe32(buf, 0, session->driver.geostar.physical_port);
putbe32(buf, 4, speed);
putbe32(buf, 8, stopbits);
putbe32(buf, 12, parity);
- /*@+shiftimplementation@*/
(void)geostar_write(session, 0x41, buf, 4);
return true; /* it would be nice to error-check this */
@@ -590,7 +574,6 @@ static bool geostar_speed_switch(struct gps_device_t *session,
static void geostar_mode(struct gps_device_t *session, int mode)
{
- /*@-shiftimplementation@*/
if (mode == MODE_NMEA) {
unsigned char buf[1 * 4];
/* Switch to NMEA mode */
@@ -603,7 +586,6 @@ static void geostar_mode(struct gps_device_t *session, int mode)
gpsd_log(&session->context->errout, LOG_ERROR,
"unknown mode %i requested\n", mode);
}
- /*@+shiftimplementation@*/
}
#endif /* RECONFIGURE_ENABLE */