summaryrefslogtreecommitdiff
path: root/libgps_core.c
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2009-12-03 08:41:20 +0000
committerEric S. Raymond <esr@thyrsus.com>2009-12-03 08:41:20 +0000
commit0e962fa95cb6ebfd9bd51173e28df0d942b7707d (patch)
treeb48f00aac4ba3b73ddd2d2c1a903232c8a99c686 /libgps_core.c
parent22e03ab16d59c37415b2093b7e05cae385869bcf (diff)
downloadgpsd-0e962fa95cb6ebfd9bd51173e28df0d942b7707d.tar.gz
Splint and compiler warning cleanup.
While we're at it, static variables in drivers are a no-no! That's what the driver union in the device structure is for. Repair driver_ubx.c to use it correctly. All regression tests pass.
Diffstat (limited to 'libgps_core.c')
-rw-r--r--libgps_core.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/libgps_core.c b/libgps_core.c
index 48d6d835..4871ecd9 100644
--- a/libgps_core.c
+++ b/libgps_core.c
@@ -617,7 +617,7 @@ int gps_stream(struct gps_data_t *gpsdata, unsigned int flags, void *d UNUSED)
char buf[GPS_JSON_COMMAND_MAX];
if ((flags & (WATCH_JSON|WATCH_OLDSTYLE|WATCH_NMEA|WATCH_RAW))== 0) {
- if (gpsdata->newstyle || (flags & WATCH_NEWSTYLE))
+ if (gpsdata->newstyle || (flags & WATCH_NEWSTYLE)!=0)
flags |= WATCH_JSON;
else
flags |= WATCH_OLDSTYLE;
@@ -641,7 +641,7 @@ int gps_stream(struct gps_data_t *gpsdata, unsigned int flags, void *d UNUSED)
buf[strlen(buf)-1] = '\0';
(void)strlcat(buf, "};", sizeof(buf));
}
- /*@i1@*/return gps_send(gpsdata, buf);
+ return gps_send(gpsdata, buf);
} else /* if ((flags & WATCH_ENABLE) != 0) */{
if ((flags & WATCH_OLDSTYLE) != 0) {
(void)strlcpy(buf, "w+x", sizeof(buf));
@@ -661,9 +661,8 @@ int gps_stream(struct gps_data_t *gpsdata, unsigned int flags, void *d UNUSED)
buf[strlen(buf)-1] = '\0';
(void)strlcat(buf, "};", sizeof(buf));
}
- /*@i1@*/return gps_send(gpsdata, buf);
+ return gps_send(gpsdata, buf);
}
- return 0;
}
extern char /*@observer@*/ *gps_errstr(const int err)