diff options
author | Eric S. Raymond <esr@thyrsus.com> | 2015-03-08 13:15:48 -0400 |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 2015-03-08 13:15:48 -0400 |
commit | 5a715483cd50180778974d96fdb3c4a8fef598e4 (patch) | |
tree | 63e4dee41f410c4c2db8fe9c75b4cebcf9f502ad | |
parent | 5fdd69a308ec9b799424d90de5a4888a25d51558 (diff) | |
download | gpsd-5a715483cd50180778974d96fdb3c4a8fef598e4.tar.gz |
splint cleanup of new code.
-rw-r--r-- | gpsd.c | 2 | ||||
-rw-r--r-- | gpsmon.c | 2 | ||||
-rw-r--r-- | libgpsd_core.c | 8 | ||||
-rw-r--r-- | ntpshmread.c | 1 | ||||
-rw-r--r-- | ppsthread.c | 5 |
5 files changed, 10 insertions, 8 deletions
@@ -1526,7 +1526,7 @@ static void all_reports(struct gps_device_t *device, gps_mask_t changed) //gpsd_log(&context.errout, LOG_PROG, "NTP: No time this packet\n"); } else if (isnan(device->newdata.time)) { //gpsd_log(&context.errout, LOG_PROG, "NTP: bad new time\n"); -#ifdef PPS_ENABLE +#if defined(PPS_ENABLE) && !defined(S_SPLINT_S) } else if (device->newdata.time <= device->pps_thread.fixin_real.tv_sec) { //gpsd_log(&context.errout, LOG_PROG, "NTP: Not a new time\n"); #endif /* PPS_ENABLE */ @@ -852,7 +852,7 @@ static void gpsmon_hook(struct gps_device_t *device, gps_mask_t changed UNUSED) * and it is a new second. */ if ( 0 != isnan(device->newdata.time)) { // "NTP: bad new time -#ifdef PPS_ENABLE +#if defined(PPS_ENABLE) && !defined(S_SPLINT_S) } else if (device->newdata.time <= device->pps_thread.fixin_real.tv_sec) { // "NTP: Not a new time #endif /* PPS_ENABLE */ diff --git a/libgpsd_core.c b/libgpsd_core.c index e8ed6852..4178b5f3 100644 --- a/libgpsd_core.c +++ b/libgpsd_core.c @@ -422,7 +422,7 @@ static void ppsthread_log(volatile struct pps_thread_t *pps_thread, } -/*@-usereleased -compdef@*/ +/*@-usereleased -compdef -compmempass@*/ void gpsd_clear(struct gps_device_t *session) /* device has been opened - clear its storage for use */ { @@ -443,15 +443,15 @@ void gpsd_clear(struct gps_device_t *session) /* set up the context structure for the PPS thread monitor */ memset((void *)&session->pps_thread, 0, sizeof(session->pps_thread)); session->pps_thread.devicefd = session->gpsdata.gps_fd; - session->pps_thread.devicename = session->gpsdata.dev.path; + /*@i2@*/session->pps_thread.devicename = session->gpsdata.dev.path; session->pps_thread.pps_hook = NULL; session->pps_thread.log_hook = ppsthread_log; - session->pps_thread.context = (void *)session; + /*@i4@*/session->pps_thread.context = (void *)session; #endif /* PPS_ENABLE */ session->opentime = timestamp(); } -/*@+usereleased +compdef@*/ +/*@+usereleased +compdef +compmempass@*/ int gpsd_open(struct gps_device_t *session) /* open a device for access to its data */ diff --git a/ntpshmread.c b/ntpshmread.c index 11532e1a..1282f779 100644 --- a/ntpshmread.c +++ b/ntpshmread.c @@ -20,6 +20,7 @@ #endif /* S_SPLINT_S*/ #include "ntpshm.h" +#include "compiler.h" struct shmTime /*@null@*/ *shm_get(const int unit, const bool create, const bool forall) /* initialize a SHM segment */ diff --git a/ppsthread.c b/ppsthread.c index 68b07070..9fddbba9 100644 --- a/ppsthread.c +++ b/ppsthread.c @@ -131,7 +131,8 @@ TS_NORM( r ); \ } while (0) -static pthread_mutex_t ppslast_mutex = PTHREAD_MUTEX_INITIALIZER; + +/*@i1@*/static pthread_mutex_t ppslast_mutex = PTHREAD_MUTEX_INITIALIZER; #if defined(HAVE_SYS_TIMEPPS_H) /*@-compdestroy -nullpass -unrecog@*/ @@ -246,7 +247,7 @@ static int init_kernel_pps(volatile struct pps_thread_t *pps_thread) * port file descriptor. */ // cppcheck-suppress redundantAssignment - ret = pps_thread->device_fd; + ret = pps_thread->devicefd; #endif /* assert(ret >= 0); */ pps_thread->log_hook(pps_thread, THREAD_INF, |