[prev in list] [next in list] [prev in thread] [next in thread] 

List:       gpsd-commit-watch
Subject:    [Gpsd-commit-watch] r2556 - trunk
From:       esr () sheep ! berlios ! de (Eric S !  Raymond at BerliOS)
Date:       2005-05-26 21:10:57
Message-ID: 200505262110.j4QLAvTc000160 () sheep ! berlios ! de
[Download RAW message or body]

Author: esr
Date: 2005-05-26 23:10:56 +0200 (Thu, 26 May 2005)
New Revision: 2556

Modified:
   trunk/.splintrc
   trunk/gpsd.c
   trunk/gpsd.h
   trunk/libgpsd_core.c
   trunk/ntpshm.c
   trunk/serial.c
Log:
Down to 1543 splint warnings.


Modified: trunk/.splintrc
===================================================================
--- trunk/.splintrc	2005-05-26 20:25:06 UTC (rev 2555)
+++ trunk/.splintrc	2005-05-26 21:10:56 UTC (rev 2556)
@@ -8,3 +8,6 @@
 -Du_int8_t=short
 -Dcaddr_t=short
 -DFD_SETSIZE=31
+-DCBAUDEX=0010000
+-DB57600=010001
+-DB115200=0010011

Modified: trunk/gpsd.c
===================================================================
--- trunk/gpsd.c	2005-05-26 20:25:06 UTC (rev 2555)
+++ trunk/gpsd.c	2005-05-26 21:10:56 UTC (rev 2556)
@@ -119,7 +119,7 @@
 	(void)(void)vsnprintf(buf + strlen(buf), sizeof(buf)-strlen(buf), fmt, ap);
 	va_end(ap);
 
-	if (in_background)
+	if (in_background!=0)
 	    syslog((errlevel == 0) ? LOG_ERR : LOG_NOTICE, "%s", buf);
 	else
 	    (void)fputs(buf, stderr);
@@ -171,7 +171,7 @@
     struct sockaddr_in sin;
     int s, type, one = 1;
 
-    memset((char *) &sin, '\0', sizeof(sin));
+    memset((char *) &sin, 0, sizeof(sin));
     sin.sin_family = AF_INET;
     sin.sin_addr.s_addr = INADDR_ANY;
 
@@ -533,13 +533,13 @@
 	    (void)snprintf(phrase, sizeof(phrase), ",L=2 " VERSION " \
abcdefiklmnpqrstuvwxy");	//ghj  break;
 	case 'M':
-	    if (!assign_channel(whoami)!=0 && (!whoami->device || \
whoami->device->gpsdata.fix.mode == MODE_NOT_SEEN)) +	    if \
(assign_channel(whoami)==0 && (!whoami->device || whoami->device->gpsdata.fix.mode == \
MODE_NOT_SEEN))  strcpy(phrase, ",M=?");
 	    else
 		(void)snprintf(phrase, sizeof(phrase), ",M=%d", whoami->device->gpsdata.fix.mode);
 	    break;
 	case 'N':
-	    if (!assign_channel(whoami)!=0)
+	    if (assign_channel(whoami)==0)
 		strcpy(phrase, ",N=?");
 	    else if (!whoami->device->device_type->mode_switcher)
 		strcpy(phrase, ",N=0");
@@ -559,7 +559,7 @@
 		(void)snprintf(phrase, sizeof(phrase), ",N=%d", \
whoami->device->gpsdata.driver_mode);  break;
 	case 'O':
-	    if (!assign_channel(whoami)!=0 || !have_fix(whoami->device))
+	    if (assign_channel(whoami)==0 || !have_fix(whoami->device))
 		strcpy(phrase, ",O=?");
 	    else {
 		(void)snprintf(phrase, sizeof(phrase), ",O=%s %.2f %.3f %.6f %.6f",
@@ -645,7 +645,7 @@
 		gpsd_report(3, "%d turned off raw mode\n", cfd);
 		(void)snprintf(phrase, sizeof(phrase), ",R=0");
 	    } else {
-		assign_channel(whoami)!=0;
+		assign_channel(whoami);
 		subscribers[cfd].raw = 1;
 		gpsd_report(3, "%d turned on raw mode\n", cfd);
 		(void)snprintf(phrase, sizeof(phrase), ",R=1");
@@ -679,7 +679,7 @@
 	    if (*p == '=') ++p;
 	    if (*p == '1' || *p == '+') {
 		subscribers[cfd].watcher = 1;
-		assign_channel(whoami)!=0;
+		assign_channel(whoami);
 		(void)snprintf(phrase, sizeof(phrase), ",W=1");
 		p++;
 	    } else if (*p == '0' || *p == '-') {
@@ -691,7 +691,7 @@
 		(void)snprintf(phrase, sizeof(phrase), ",W=0");
 	    } else {
 		subscribers[cfd].watcher = 1;
-		assign_channel(whoami)!=0;
+		assign_channel(whoami);
 		gpsd_report(3, "%d turned on watching\n", cfd);
 		(void)snprintf(phrase, sizeof(phrase), ",W=1");
 	    }
@@ -1209,6 +1209,6 @@
     }
 
     if (control_socket)
-	unlink(control_socket);
+	(void)unlink(control_socket);
     return 0;
 }

Modified: trunk/gpsd.h
===================================================================
--- trunk/gpsd.h	2005-05-26 20:25:06 UTC (rev 2555)
+++ trunk/gpsd.h	2005-05-26 21:10:56 UTC (rev 2556)
@@ -34,7 +34,7 @@
     int leap_seconds;
     int century;			/* for NMEA-only devices without ZDA */
 #ifdef NTPSHM_ENABLE
-    struct shmTime *shmTime[NTPSHMSEGS];
+    /*@null@*/struct shmTime *shmTime[NTPSHMSEGS];
     int shmTimeInuse[NTPSHMSEGS];
 # ifdef PPS_ENABLE
     int shmTimePPS;
@@ -170,7 +170,7 @@
 extern int gpsd_open(struct gps_device_t *);
 extern int gpsd_next_hunt_setting(struct gps_device_t *);
 extern int gpsd_switch_driver(struct gps_device_t *, char *);
-extern void gpsd_set_speed(struct gps_device_t *, speed_t, unsigned int, unsigned \
int); +extern void gpsd_set_speed(struct gps_device_t *, speed_t, unsigned char, \
unsigned int);  extern speed_t gpsd_get_speed(struct termios *);
 extern void gpsd_close(struct gps_device_t *);
 

Modified: trunk/libgpsd_core.c
===================================================================
--- trunk/libgpsd_core.c	2005-05-26 20:25:06 UTC (rev 2555)
+++ trunk/libgpsd_core.c	2005-05-26 21:10:56 UTC (rev 2556)
@@ -223,22 +223,22 @@
     session->gpsdata.fix.ept = 0.005;
 #ifdef BINARY_ENABLE
     if (session->gpsdata.set & LATLON_SET) {
-	if (!(session->gpsdata.set & HERR_SET) 
+	if ((session->gpsdata.set & HERR_SET)==0 
 	    && (session->gpsdata.set & HDOP_SET)) {
 	    session->gpsdata.fix.eph = session->gpsdata.hdop*UERE(session);
 	    session->gpsdata.set |= HERR_SET;
 	}
-	if (!(session->gpsdata.set & VERR_SET) 
+	if ((session->gpsdata.set & VERR_SET)==0 
 	    && (session->gpsdata.set & VDOP_SET)) {
 	    session->gpsdata.fix.epv = session->gpsdata.vdop*UERE(session);
 	    session->gpsdata.set |= VERR_SET;
 	}
-	if (!(session->gpsdata.set & PERR_SET) 
+	if ((session->gpsdata.set & PERR_SET)==0
 	    && (session->gpsdata.set & PDOP_SET)) {
 	    session->gpsdata.epe = session->gpsdata.pdop*UERE(session);
 	    session->gpsdata.set |= PERR_SET;
 	}
-	if (!(session->gpsdata.set & SPEEDERR_SET) && session->gpsdata.fix.time > \
session->lastfix.time) { +	if ((session->gpsdata.set & SPEEDERR_SET)==0 && \
session->gpsdata.fix.time > session->lastfix.time) {  session->gpsdata.fix.eps = 0.0;
 	    if (session->lastfix.mode > MODE_NO_FIX 
 		&& session->gpsdata.fix.mode > MODE_NO_FIX) {
@@ -249,7 +249,7 @@
 		    session->gpsdata.set |= SPEEDERR_SET;
 	    }
 	}
-	if (!(session->gpsdata.set & CLIMBERR_SET) && session->gpsdata.fix.time > \
session->lastfix.time) { +	if ((session->gpsdata.set & CLIMBERR_SET)==0 && \
session->gpsdata.fix.time > session->lastfix.time) {  session->gpsdata.fix.epc = 0.0;
 	    if (session->lastfix.mode > MODE_3D 
 		&& session->gpsdata.fix.mode > MODE_3D) {

Modified: trunk/ntpshm.c
===================================================================
--- trunk/ntpshm.c	2005-05-26 20:25:06 UTC (rev 2555)
+++ trunk/ntpshm.c	2005-05-26 21:10:56 UTC (rev 2556)
@@ -127,8 +127,8 @@
     microseconds = 1000000.0 * modf(fixtime,&seconds);
 
     shmTime->count++;
-    shmTime->clockTimeStampSec = seconds;
-    shmTime->clockTimeStampUSec = microseconds;
+    shmTime->clockTimeStampSec = (time_t)seconds;
+    shmTime->clockTimeStampUSec = (int)microseconds;
     shmTime->receiveTimeStampSec = tv.tv_sec;
     shmTime->receiveTimeStampUSec = tv.tv_usec;
     shmTime->count++;

Modified: trunk/serial.c
===================================================================
--- trunk/serial.c	2005-05-26 20:25:06 UTC (rev 2555)
+++ trunk/serial.c	2005-05-26 21:10:56 UTC (rev 2556)
@@ -35,7 +35,7 @@
 }
 
 void gpsd_set_speed(struct gps_device_t *session, 
-		   speed_t speed, unsigned int parity, unsigned int stopbits)
+		   speed_t speed, unsigned char parity, unsigned int stopbits)
 {
     speed_t	rate;
 
@@ -60,10 +60,12 @@
     else
       rate =  B115200;
 
-    if (rate!=cfgetispeed(&session->ttyset) || parity!=session->gpsdata.parity || \
stopbits!=session->gpsdata.stopbits) { +    if (rate!=cfgetispeed(&session->ttyset) \
|| (unsigned int)parity!=session->gpsdata.parity || \
stopbits!=session->gpsdata.stopbits) {  
+	/*@ignore@*/
 	(void)cfsetispeed(&session->ttyset, (speed_t)rate);
 	(void)cfsetospeed(&session->ttyset, (speed_t)rate);
+	/*@end@*/
  	session->ttyset.c_iflag &=~ (PARMRK | INPCK);
  	session->ttyset.c_cflag &=~ (CSIZE | CSTOPB | PARENB | PARODD);
  	session->ttyset.c_cflag |= (stopbits==2 ? CS7|CSTOPB : CS8);
@@ -85,8 +87,8 @@
     }
     gpsd_report(1, "speed %d, %d%c%d\n", speed, 9-stopbits, parity, stopbits);
 
-    session->gpsdata.baudrate = speed;
-    session->gpsdata.parity = parity;
+    session->gpsdata.baudrate = (unsigned int)speed;
+    session->gpsdata.parity = (unsigned int)parity;
     session->gpsdata.stopbits = stopbits;
     packet_reset(session);
 }
@@ -106,7 +108,7 @@
 
 	for (dp = gpsd_drivers; *dp; dp++) {
 	    (void)tcflush(session->gpsdata.gps_fd, TCIOFLUSH);  /* toss stale data */
-	    if ((*dp)->probe && (*dp)->probe(session)) {
+	    if ((*dp)->probe!=NULL && (*dp)->probe(session)!=NULL) {
 		gpsd_report(3, "probe found %s driver...\n", (*dp)->typename);
 		session->device_type = *dp;
 		if (session->device_type->initializer)
@@ -154,7 +156,7 @@
 
     if (session->counter++ >= SNIFF_RETRIES) {
 	session->counter = 0;
-	if (session->baudindex++ >= sizeof(rates)/sizeof(rates[0])) {
+	if (session->baudindex++ >= (unsigned int)(sizeof(rates)/sizeof(rates[0]))) {
 	    session->baudindex = 0;
 	    if (session->gpsdata.stopbits++ >= 2)
 		return 0;			/* hunt is over, no sync */
@@ -172,9 +174,11 @@
     if (session->gpsdata.gps_fd != -1) {
 	if (isatty(session->gpsdata.gps_fd)!=0) {
 	    /* force hangup on close on systems that don't do HUPCL properly */
-	    cfsetispeed(&session->ttyset, (speed_t)B0);
-	    cfsetospeed(&session->ttyset, (speed_t)B0);
-	    tcsetattr(session->gpsdata.gps_fd, TCSANOW, &session->ttyset);
+	    /*@ ignore @*/
+	    (void)cfsetispeed(&session->ttyset, (speed_t)B0);
+	    (void)cfsetospeed(&session->ttyset, (speed_t)B0);
+	    /*@ end @*/
+	    (void)tcsetattr(session->gpsdata.gps_fd,TCSANOW, &session->ttyset);
 	}
 	/* this is the clean way to do it */
 	session->ttyset_old.c_cflag |= HUPCL;


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic