summaryrefslogtreecommitdiff
path: root/libgps_core.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 /libgps_core.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 'libgps_core.c')
-rw-r--r--libgps_core.c24
1 files changed, 7 insertions, 17 deletions
diff --git a/libgps_core.c b/libgps_core.c
index 9a26124d..b26e6ff1 100644
--- a/libgps_core.c
+++ b/libgps_core.c
@@ -57,13 +57,12 @@ void libgps_trace(int errlevel, const char *fmt, ...)
#define CONDITIONALLY_UNUSED UNUSED
#endif /* SOCKET_EXPORT_ENABLE */
-int gps_open(/*@null@*/const char *host,
- /*@null@*/const char *port CONDITIONALLY_UNUSED,
- /*@out@*/ struct gps_data_t *gpsdata)
+int gps_open(const char *host,
+ const char *port CONDITIONALLY_UNUSED,
+ struct gps_data_t *gpsdata)
{
int status = -1;
- /*@ -branchstate -compdef @*/
if (!gpsdata)
return -1;
@@ -80,7 +79,7 @@ int gps_open(/*@null@*/const char *host,
#ifdef DBUS_EXPORT_ENABLE
if (host != NULL && strcmp(host, GPSD_DBUS_EXPORT) == 0) {
- /*@i@*/status = gps_dbus_open(gpsdata);
+ status = gps_dbus_open(gpsdata);
if (status != 0)
status = DBUS_FAILURE;
}
@@ -106,7 +105,6 @@ int gps_open(/*@null@*/const char *host,
gps_clear_dop(&(gpsdata->dop));
return status;
- /*@ +branchstate +compdef @*/
}
#if defined(SHM_EXPORT_ENABLE) || defined(SOCKET_EXPORT_ENABLE)
@@ -145,7 +143,6 @@ int gps_read(struct gps_data_t *gpsdata CONDITIONALLY_UNUSED)
libgps_debug_trace((DEBUG_CALLS, "gps_read() begins\n"));
- /*@ -usedef -compdef -uniondef @*/
#ifdef SHM_EXPORT_ENABLE
if (BAD_SOCKET((intptr_t)(gpsdata->gps_fd))) {
status = gps_shm_read(gpsdata);
@@ -157,12 +154,9 @@ int gps_read(struct gps_data_t *gpsdata CONDITIONALLY_UNUSED)
status = gps_sock_read(gpsdata);
}
#endif /* SOCKET_EXPORT_ENABLE */
- /*@ +usedef +compdef +uniondef @*/
- /*@-usedef@*/
libgps_debug_trace((DEBUG_CALLS, "gps_read() -> %d (%s)\n",
status, gps_maskdump(gpsdata->set)));
- /*@+usedef@*/
return status;
}
@@ -189,7 +183,7 @@ int gps_send(struct gps_data_t *gpsdata CONDITIONALLY_UNUSED, const char *fmt CO
int gps_stream(struct gps_data_t *gpsdata CONDITIONALLY_UNUSED,
unsigned int flags CONDITIONALLY_UNUSED,
- /*@null@*/ void *d CONDITIONALLY_UNUSED)
+ void *d CONDITIONALLY_UNUSED)
{
int status = -1;
@@ -201,10 +195,9 @@ int gps_stream(struct gps_data_t *gpsdata CONDITIONALLY_UNUSED,
return status;
}
-const char /*@null observer@*/ *gps_data(const struct gps_data_t *gpsdata CONDITIONALLY_UNUSED)
+const char *gps_data(const struct gps_data_t *gpsdata CONDITIONALLY_UNUSED)
/* return the contents of the client data buffer */
{
- /*@-dependenttrans -observertrans@*/
const char *bufp = NULL;
#ifdef SOCKET_EXPORT_ENABLE
@@ -212,7 +205,6 @@ const char /*@null observer@*/ *gps_data(const struct gps_data_t *gpsdata CONDIT
#endif /* SOCKET_EXPORT_ENABLE */
return bufp;
- /*@+dependenttrans +observertrans@*/
}
bool gps_waiting(const struct gps_data_t *gpsdata CONDITIONALLY_UNUSED, int timeout CONDITIONALLY_UNUSED)
@@ -244,7 +236,6 @@ int gps_mainloop(struct gps_data_t *gpsdata CONDITIONALLY_UNUSED,
libgps_debug_trace((DEBUG_CALLS, "gps_mainloop() begins\n"));
- /*@ -usedef -compdef -uniondef @*/
#ifdef SHM_EXPORT_ENABLE
if ((intptr_t)(gpsdata->gps_fd) == SHM_PSEUDO_FD)
status = gps_shm_mainloop(gpsdata, timeout, hook);
@@ -257,7 +248,6 @@ int gps_mainloop(struct gps_data_t *gpsdata CONDITIONALLY_UNUSED,
if ((intptr_t)(gpsdata->gps_fd) >= 0)
status = gps_sock_mainloop(gpsdata, timeout, hook);
#endif /* SOCKET_EXPORT_ENABLE */
- /*@ +usedef +compdef +uniondef @*/
libgps_debug_trace((DEBUG_CALLS, "gps_mainloop() -> %d (%s)\n",
status, gps_maskdump(gpsdata->set)));
@@ -265,7 +255,7 @@ int gps_mainloop(struct gps_data_t *gpsdata CONDITIONALLY_UNUSED,
return status;
}
-extern const char /*@observer@*/ *gps_errstr(const int err)
+extern const char *gps_errstr(const int err)
{
/*
* We might add our own error codes in the future, e.g for