Skip to content

Commit

Permalink
Correct some splint annotations.
Browse files Browse the repository at this point in the history
The codebase now splints completely clean - no errors, no warnings, no
splint croaking on include files it can't handle.
  • Loading branch information
eric-s-raymond committed Sep 11, 2009
1 parent 657a827 commit b87239e
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 7 deletions.
2 changes: 1 addition & 1 deletion driver_navcom.c
Original file line number Diff line number Diff line change
Expand Up @@ -778,7 +778,7 @@ static gps_mask_t handle_0x86(struct gps_device_t *session)
session->gpsdata.PRN[i] = (int)prn;
session->gpsdata.elevation[i] = (int)ele;
session->gpsdata.azimuth[i] = (int)azm;
/*@i1@*/s = session->gpsdata.ss[i++] = (float)(p2_snr ? p2_snr : ca_snr) / 4.0;
/*@i4@*/s = session->gpsdata.ss[i++] = (float)(p2_snr ? p2_snr : ca_snr) / 4.0;
}
gpsd_report(LOG_IO,
"Navcom: prn = %3u, ele = %02u, azm = %03u, snr = %d (%s), "
Expand Down
6 changes: 3 additions & 3 deletions gpsd.c
Original file line number Diff line number Diff line change
Expand Up @@ -327,9 +327,9 @@ static int filesock(char *filename)
gpsd_report(LOG_ERROR, "Can't create device-control socket\n");
return -1;
}
(void)strlcpy(addr.sun_path, filename, 104); /* from sys/un.h */
/*@i1@*/addr.sun_family = AF_UNIX;
(void)bind(sock, (struct sockaddr *) &addr, (socklen_t)sizeof(addr));
/*@i1@*/(void)strlcpy(addr.sun_path, filename, 104); /* from sys/un.h */
addr.sun_family = AF_UNIX;
(void)bind(sock, (struct sockaddr *) &addr, (int)sizeof(addr));
if (listen(sock, QLEN) == -1) {
gpsd_report(LOG_ERROR, "can't listen on local socket %s\n", filename);
return -1;
Expand Down
2 changes: 1 addition & 1 deletion libgps.c
Original file line number Diff line number Diff line change
Expand Up @@ -588,7 +588,7 @@ int gps_del_callback(struct gps_data_t *gpsdata, pthread_t *handler)
int res;

/*@i@*/res = pthread_cancel(*handler); /* we cancel the whole thread */
/*@i1@*/pthread_join(*handler, NULL); /* wait for thread to actually terminate */
/*@i2@*/pthread_join(*handler, NULL); /* wait for thread to actually terminate */
gpsdata->thread_hook = NULL; /* finally we cancel the callback */
if (res == 0) /* tell gpsd to stop sending data */
/*@i1@*/(void)gps_stream(gpsdata, WATCH_DISABLE); /* disable watcher mode */
Expand Down
4 changes: 2 additions & 2 deletions libgpsd_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ void ntpd_link_activate(struct gps_device_t *session)
*/
if (session->shmindex >= 0 && session->context->shmTimePPS)
if ((session->shmTimeP = ntpshm_alloc(session->context)) >= 0)
/*@i1@*/(void)pthread_create(&pt,NULL,gpsd_ppsmonitor,(void *)session);
(void)pthread_create(&pt,NULL,gpsd_ppsmonitor,(void *)session);

#endif /* defined(PPS_ENABLE) && defined(TIOCMIWAIT) */
#endif /* NTPSHM_ENABLE */
Expand Down Expand Up @@ -719,7 +719,7 @@ gps_mask_t gpsd_poll(struct gps_device_t *session)
session->gpsdata.dev.path,
session->packet.type);
if (session->packet.type > COMMENT_PACKET) {
/*@i1@*/session->observed |= PACKET_TYPEMASK(session->packet.type);
/*@i2@*/session->observed |= PACKET_TYPEMASK(session->packet.type);
first_sync = (session->device_type == NULL);
for (dp = gpsd_drivers; *dp; dp++)
if (session->packet.type == (*dp)->packet_type) {
Expand Down
2 changes: 2 additions & 0 deletions netlib.c
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,10 @@ int netlib_connectsock(const char *host, const char *service, const char *protoc

if ((phe = gethostbyname(host)))
memcpy((char *) &sin.sin_addr, phe->h_addr, phe->h_length);
#ifndef S_SPLINT_S
else if ((sin.sin_addr.s_addr = inet_addr(host)) == INADDR_NONE)
return NL_NOHOST;
#endif /* S_SPLINT_S */

ppe = getprotobyname(protocol);
if (strcmp(protocol, "udp") == 0) {
Expand Down

0 comments on commit b87239e

Please sign in to comment.