summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cgps.c8
-rw-r--r--gps.h2
-rw-r--r--libgps_core.c12
-rw-r--r--libgps_shm.c2
-rw-r--r--libgps_sock.c2
5 files changed, 17 insertions, 9 deletions
diff --git a/cgps.c b/cgps.c
index 7d55df7d..78d9e60d 100644
--- a/cgps.c
+++ b/cgps.c
@@ -474,8 +474,9 @@ static void update_compass_panel(struct gps_data_t *gpsdata)
}
#endif /* TRUENORTH */
-/* This gets called once for each new GPS sentence. */
+/*@-mustfreefresh@*/
static void update_gps_panel(struct gps_data_t *gpsdata)
+/* This gets called once for each new GPS sentence. */
{
int i, j, n;
int newstate;
@@ -704,8 +705,8 @@ static void update_gps_panel(struct gps_data_t *gpsdata)
}
/* Be quiet if the user requests silence. */
- if (!silent_flag && raw_flag) {
- (void)waddstr(messages, gps_data(gpsdata));
+ if (!silent_flag && raw_flag && (s = gps_data(gpsdata)) != NULL) {
+ (void)waddstr(messages, s);
}
/* Reset the status_timer if the state has changed. */
@@ -720,6 +721,7 @@ static void update_gps_panel(struct gps_data_t *gpsdata)
(void)wrefresh(messages);
}
}
+/*@+mustfreefresh@*/
static void usage(char *prog)
{
diff --git a/gps.h b/gps.h
index f7244de8..80aedb5a 100644
--- a/gps.h
+++ b/gps.h
@@ -1729,7 +1729,7 @@ extern bool gps_waiting(const struct gps_data_t *, int);
extern int gps_stream(struct gps_data_t *, unsigned int, /*@null@*/void *);
extern int gps_mainloop(struct gps_data_t *, int,
void (*)(struct gps_data_t *));
-extern const char /*@observer@*/ *gps_data(const struct gps_data_t *);
+extern const char /*@null observer@*/ *gps_data(const struct gps_data_t *);
extern const char /*@observer@*/ *gps_errstr(const int);
/* dependencies on struct gpsdata_t end hrere */
diff --git a/libgps_core.c b/libgps_core.c
index d20c411e..47d82bc0 100644
--- a/libgps_core.c
+++ b/libgps_core.c
@@ -74,7 +74,7 @@ int gps_open(/*@null@*/const char *host,
{
int status = -1;
- /*@ -branchstate @*/
+ /*@ -branchstate -compdef @*/
if (!gpsdata)
return -1;
@@ -90,7 +90,7 @@ int gps_open(/*@null@*/const char *host,
#ifdef DBUS_EXPORT_ENABLE
if (host != NULL && strcmp(host, GPSD_DBUS_EXPORT) == 0) {
- status = gps_dbus_open(gpsdata);
+ /*@i@*/status = gps_dbus_open(gpsdata);
if (status != 0)
/* FIXME: it would be better not to throw away information here */
status = DBUS_FAILURE;
@@ -108,7 +108,7 @@ int gps_open(/*@null@*/const char *host,
gps_clear_fix(&gpsdata->fix);
return status;
- /*@ +branchstate @*/
+ /*@ +branchstate +compdef @*/
}
int gps_close(struct gps_data_t *gpsdata)
@@ -159,11 +159,11 @@ int gps_read(struct gps_data_t *gpsdata)
default:
status = 0;
}
- /*@ +usedef +compdef +uniondef @*/
libgps_debug_trace((DEBUG_CALLS, "gps_read() -> %d (%s)\n",
status, gps_maskdump(gpsdata->set)));
+ /*@ +usedef +compdef +uniondef @*/
return status;
}
@@ -212,7 +212,8 @@ int gps_stream(struct gps_data_t *gpsdata CONDITIONALLY_UNUSED,
return status;
}
-const char /*@observer@*/ *gps_data(const struct gps_data_t *gpsdata CONDITIONALLY_UNUSED)
+/*@-observertrans -dependenttrans@*/
+const char /*@null observer@*/ *gps_data(const struct gps_data_t *gpsdata CONDITIONALLY_UNUSED)
/* return the contents of the client data buffer */
{
const char *bufp = NULL;
@@ -230,6 +231,7 @@ const char /*@observer@*/ *gps_data(const struct gps_data_t *gpsdata CONDITIONAL
return bufp;
}
+/*@+observertrans +dependenttrans@*/
bool gps_waiting(const struct gps_data_t *gpsdata CONDITIONALLY_UNUSED, int timeout CONDITIONALLY_UNUSED)
/* is there input waiting from the GPS? */
diff --git a/libgps_shm.c b/libgps_shm.c
index 60558ec1..39782910 100644
--- a/libgps_shm.c
+++ b/libgps_shm.c
@@ -27,11 +27,13 @@ PERMISSIONS
#ifdef SHM_EXPORT_ENABLE
+/*@-matchfields@*/
struct privdata_t
{
enum export_t export_type;
void *shmseg;
};
+/*@+matchfields@*/
#define PRIVATE(gpsdata) ((struct privdata_t *)(gpsdata)->privdata)
diff --git a/libgps_sock.c b/libgps_sock.c
index 220dfb62..e4543908 100644
--- a/libgps_sock.c
+++ b/libgps_sock.c
@@ -39,6 +39,7 @@
extern char *strtok_r(char *, const char *, char **);
#endif /* S_SPLINT_S */
+/*@-matchfields@*/
struct privdata_t
{
enum export_t export_type;
@@ -50,6 +51,7 @@ struct privdata_t
int waitcount;
#endif /* LIBGPS_DEBUG */
};
+/*@+matchfields@*/
#define PRIVATE(gpsdata) ((struct privdata_t *)gpsdata->privdata)
/*@-branchstate@*/