summaryrefslogtreecommitdiff
path: root/sirfmon.c
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2005-05-26 22:32:15 +0000
committerEric S. Raymond <esr@thyrsus.com>2005-05-26 22:32:15 +0000
commitc9d8489fbb4eb4d33f6aeb209da6c5fb5b009751 (patch)
tree2aa593c2b5038a2d1c52c38f6df93daa205c6cd6 /sirfmon.c
parentc15a1d0e43a86aa1f92a8fe8c43fc8e8e185bd82 (diff)
downloadgpsd-c9d8489fbb4eb4d33f6aeb209da6c5fb5b009751.tar.gz
1485 splint warnings.
Diffstat (limited to 'sirfmon.c')
-rw-r--r--sirfmon.c24
1 files changed, 13 insertions, 11 deletions
diff --git a/sirfmon.c b/sirfmon.c
index 74aa0893..2c7aa059 100644
--- a/sirfmon.c
+++ b/sirfmon.c
@@ -122,25 +122,25 @@ static void nmea_add_checksum(char *sentence)
p++;
}
*p++ = '*';
- sprintf(p, "%02X\r\n", sum);
+ (void)snprintf(p, 4, "%02X\r\n", (unsigned int)sum);
}
}
static int nmea_send(int fd, const char *fmt, ... )
/* ship a command to the GPS, adding * and correct checksum */
{
- unsigned int status;
+ size_t status;
char buf[BUFLEN];
va_list ap;
va_start(ap, fmt) ;
- vsnprintf(buf, sizeof(buf)-5, fmt, ap);
+ (void)vsnprintf(buf, sizeof(buf)-5, fmt, ap);
va_end(ap);
strcat(buf, "*");
nmea_add_checksum(buf);
- status = write(fd, buf, strlen(buf));
+ status = (size_t)write(fd, buf, strlen(buf));
if (status == strlen(buf)) {
- return status;
+ return (int)status;
} else {
return -1;
}
@@ -167,7 +167,7 @@ static void decode_time(int week, int tow)
(void)wmove(mid2win, 3, 29);
(void)wprintw(mid2win, "%d %02d:%02d:%05.2f", day, h,m,(double)s/100);
(void)wmove(mid2win, 4, 8);
- (void)wprintw(mid2win, "%f", timestamp()-gpstime_to_unix(week,tow/100));
+ (void)wprintw(mid2win, "%f", timestamp()-gpstime_to_unix(week,tow/100.0));
(void)wmove(mid2win, 4, 29);
(void)wprintw(mid2win, "%d", gmt_offset);
}
@@ -588,8 +588,10 @@ static int set_speed(unsigned int speed, unsigned int stopbits)
else
rate = B57600;
- cfsetispeed(&ttyset, (speed_t)rate);
- cfsetospeed(&ttyset, (speed_t)rate);
+ /*@ ignore @*/
+ (void)cfsetispeed(&ttyset, (speed_t)rate);
+ (void)cfsetospeed(&ttyset, (speed_t)rate);
+ /*@ end @*/
}
ttyset.c_cflag &=~ CSIZE;
ttyset.c_cflag |= (CSIZE & (stopbits==2 ? CS7 : CS8));
@@ -679,7 +681,7 @@ static int serial_initialize(char *device)
/* Save original terminal parameters */
if (tcgetattr(devicefd, &ttyset) != 0 || !(bps = hunt_open(&stopbits))) {
- fputs("Can't sync up with device!\n", stderr);
+ (void)fputs("Can't sync up with device!\n", stderr);
exit(1);
}
@@ -884,10 +886,10 @@ int main (int argc, char **argv)
while ((option = getopt(argc, argv, "hvF:")) != -1) {
switch (option) {
case 'v':
- printf("sirfmon %s\n", VERSION);
+ (void)printf("sirfmon %s\n", VERSION);
exit(0);
case 'h': case '?': default:
- fputs("usage: sirfmon [-?hv] [server[:port:[device]]]\n", stderr);
+ (void)fputs("usage: sirfmon [-?hv] [server[:port:[device]]]\n", stderr);
exit(1);
}
}