diff options
-rw-r--r-- | SConstruct | 2 | ||||
-rw-r--r-- | driver_nmea2000.c | 10 | ||||
-rw-r--r-- | driver_superstar2.c | 4 | ||||
-rw-r--r-- | ppsthread.c | 29 |
4 files changed, 25 insertions, 20 deletions
@@ -1439,7 +1439,7 @@ def Utility(target, source, action): # Note: test_bits.c is unsplintable because of the PRI64 macros. # If you get preprocessor or fatal errors, add +showscan. # explicitly force splint to only use our splintrc file -splintopts = "-I/usr/include/libusb-1.0 +quiet +nof +showscan -f .splintrc" +splintopts = "-I/usr/include/libusb-1.0 +quiet +nof -f .splintrc" if sys.platform.startswith('darwin'): splintopts = splintopts + " +skip-sys-headers" diff --git a/driver_nmea2000.c b/driver_nmea2000.c index 0ede7e79..957a55fb 100644 --- a/driver_nmea2000.c +++ b/driver_nmea2000.c @@ -1397,9 +1397,9 @@ static void find_pgn(struct can_frame *frame, struct gps_device_t *session) session->driver.nmea2000.workpgn = (void *) work; /*@i1@*/session->lexer.outbuflen = frame->can_dlc & 0x0f; for (l2=0;l2<session->lexer.outbuflen;l2++) { - /*@i1@*/session->lexer.outbuffer[l2]= frame->data[l2]; + /*@i3@*/session->lexer.outbuffer[l2]= frame->data[l2]; } - /*@i1@*/} else if ((frame->data[0] & 0x1f) == 0) { + /*@i2@*/} else if ((frame->data[0] & 0x1f) == 0) { unsigned int l2; /*@i2@*/session->driver.nmea2000.fast_packet_len = frame->data[1]; @@ -1415,16 +1415,16 @@ static void find_pgn(struct can_frame *frame, struct gps_device_t *session) session->lexer.inbuflen = 0; session->driver.nmea2000.idx += 1; for (l2=2;l2<8;l2++) { - /*@i1@*/session->lexer.inbuffer[session->lexer.inbuflen++] = frame->data[l2]; + /*@i3@*/session->lexer.inbuffer[session->lexer.inbuflen++] = frame->data[l2]; } gpsd_log(&session->context->errout, LOG_DATA, "pgn %6d:%s \n", work->pgn, work->name); - /*@i1@*/} else if (frame->data[0] == session->driver.nmea2000.idx) { + /*@i2@*/} else if (frame->data[0] == session->driver.nmea2000.idx) { unsigned int l2; for (l2=1;l2<8;l2++) { if (session->driver.nmea2000.fast_packet_len > session->lexer.inbuflen) { - /*@i1@*/session->lexer.inbuffer[session->lexer.inbuflen++] = frame->data[l2]; + /*@i3@*/session->lexer.inbuffer[session->lexer.inbuflen++] = frame->data[l2]; } } if (session->lexer.inbuflen == session->driver.nmea2000.fast_packet_len) { diff --git a/driver_superstar2.c b/driver_superstar2.c index 90cdcd28..b0003773 100644 --- a/driver_superstar2.c +++ b/driver_superstar2.c @@ -115,8 +115,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; - /*@i1@*/session->gpsdata.dop.hdop = getleu16(buf, 66) * 0.1; - /*@i1@*/session->gpsdata.dop.vdop = getleu16(buf, 68) * 0.1; + /*@i3@*/session->gpsdata.dop.hdop = getleu16(buf, 66) * 0.1; + /*@i3@*/session->gpsdata.dop.vdop = getleu16(buf, 68) * 0.1; /* other DOP if available */ mask |= DOP_SET | USED_IS; diff --git a/ppsthread.c b/ppsthread.c index 00037b33..594e8945 100644 --- a/ppsthread.c +++ b/ppsthread.c @@ -53,17 +53,8 @@ #include <stdbool.h> #include <limits.h> #include <errno.h> -#include <pthread.h> #include <math.h> #ifdef S_SPLINT_S -#include <sys/timepps.h> -/*@-incondefs@*/ -typedef long int time_t; -extern int pthread_create (pthread_t *__restrict __newthread, - /*@null@*/const pthread_attr_t *__restrict __attr, - void *(*__start_routine) (void *), - void *__restrict __arg); -/*@+incondefs@*/ /*@-type@*/ int strerror_r(int errnum, char *buf, size_t buflen); /*@+type@*/ @@ -75,6 +66,7 @@ struct timespec }; /*@+matchfields@*/ #else +#include <pthread.h> #include <sys/socket.h> #include <unistd.h> #endif /* S_SPLINT_S */ @@ -174,8 +166,10 @@ static pthread_mutex_t ppslast_mutex = PTHREAD_MUTEX_INITIALIZER; static int init_kernel_pps(volatile struct pps_thread_t *pps_thread) /* return handle for kernel pps, or -1; requires root privileges */ { +#ifndef S_SPLINT_S pps_params_t pp; int pps_caps; +#endif /* S_SPLINT_S */ int ret; #ifdef __linux__ /* These variables are only needed by Linux to find /dev/ppsN. */ @@ -296,6 +290,7 @@ static int init_kernel_pps(volatile struct pps_thread_t *pps_thread) pps_thread->devicename, path, ret); +#ifndef S_SPLINT_S /* RFC 2783 implies the time_pps_setcap() needs priviledges * * keep root a tad longer just in case */ if ( 0 > time_pps_create(ret, (pps_handle_t *)&pps_thread->kernelpps_handle )) { @@ -368,6 +363,7 @@ static int init_kernel_pps(volatile struct pps_thread_t *pps_thread) (void)time_pps_destroy(pps_thread->kernelpps_handle); return -1; } +#endif /* S_SPLINT_S */ return 0; } #endif /* defined(HAVE_SYS_TIMEPPS_H) */ @@ -491,9 +487,10 @@ static int get_edge_rfc2783( volatile struct pps_thread_t *thread_context, int *edge, volatile struct timedelta_t *last_fixtime) { - +#ifndef S_SPLINT_S pps_info_t pi; char ts_str1[TIMESPEC_LEN], ts_str2[TIMESPEC_LEN]; +#endif /* S_SPLINT_S */ struct timespec kernelpps_tv; if ( pps_canwait ) { @@ -521,6 +518,7 @@ static int get_edge_rfc2783( volatile struct pps_thread_t *thread_context, */ memset( (void *)&kernelpps_tv, 0, sizeof(kernelpps_tv)); } +#ifndef S_SPLINT_S memset( (void *)&pi, 0, sizeof(pi)); /* paranoiia, and to shutup splint */ if ( 0 > time_pps_fetch(thread_context->kernelpps_handle, PPS_TSFMT_TSPEC , &pi, &kernelpps_tv)) { @@ -536,6 +534,7 @@ static int get_edge_rfc2783( volatile struct pps_thread_t *thread_context, } return 0; } +#endif /* S_SPLINT_S */ if ( pps_canwait ) { int pthread_err; /* return code from pthread functions */ @@ -564,6 +563,7 @@ static int get_edge_rfc2783( volatile struct pps_thread_t *thread_context, } +#ifndef S_SPLINT_S // find the last edge if ( pi.assert_timestamp.tv_sec > pi.clear_timestamp.tv_sec ) { /* assert 1 sec or more after than clear */ @@ -612,6 +612,7 @@ static int get_edge_rfc2783( volatile struct pps_thread_t *thread_context, (unsigned long) pi.assert_sequence, ts_str2, (unsigned long) pi.clear_sequence); +#endif /* S_SPLINT_S */ thread_context->log_hook(thread_context, THREAD_PROG, "KPPS:%s data: last edge %s\n", thread_context->devicename, @@ -653,7 +654,9 @@ static /*@null@*/ void *gpsd_ppsmonitor(void *arg) #endif /* TIOCMIWAIT */ #if defined(HAVE_SYS_TIMEPPS_H) +#ifndef S_SPLINT_S int pps_caps; +#endif /* S_SPLINT_S */ long cycle_kpps = 0, duration_kpps = 0; /* kpps_pulse stores the time of the last two edges */ struct timespec pulse_kpps[2] = { {0, 0}, {0, 0} }; @@ -674,6 +677,7 @@ static /*@null@*/ void *gpsd_ppsmonitor(void *arg) } /* if no TIOCMIWAIT, we hope to have PPS_CANWAIT */ +#ifndef S_SPLINT_S #if defined(HAVE_SYS_TIMEPPS_H) /* get RFC2783 features supported */ pps_caps = 0; @@ -697,6 +701,7 @@ static /*@null@*/ void *gpsd_ppsmonitor(void *arg) pps_canwait = true; } #endif /* HAVE_SYS_TIMEPPS_H */ +#endif /* S_SPLINT_S */ if ( not_a_tty && !pps_canwait ) { /* for now, no way to wait for an edge, in the future maybe figure out @@ -1083,7 +1088,7 @@ static /*@null@*/ void *gpsd_ppsmonitor(void *arg) thread_context->log_hook(thread_context, THREAD_PROG, "PPS:%s descriptor cleaned up\n", thread_context->devicename); - (void)time_pps_destroy(thread_context->kernelpps_handle); + /*@i1@*/(void)time_pps_destroy(thread_context->kernelpps_handle); } #endif if (thread_context->wrap_hook != NULL) @@ -1113,7 +1118,7 @@ void pps_thread_activate(volatile struct pps_thread_t *pps_thread) } #endif memset( &pt, 0, sizeof(pt)); - retval = pthread_create(&pt, NULL, gpsd_ppsmonitor, (void *)pps_thread); + /*@i1@*/retval = pthread_create(&pt, NULL, gpsd_ppsmonitor, (void *)pps_thread); pps_thread->log_hook(pps_thread, THREAD_PROG, "PPS:%s thread %s\n", pps_thread->devicename, (retval==0) ? "launched" : "FAILED"); |