summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--TODO9
-rw-r--r--drivers.c4
-rw-r--r--garmin.c8
-rw-r--r--gps.h56
-rw-r--r--gpsd.c9
-rw-r--r--gpsd.h18
-rw-r--r--libgps.c1
-rw-r--r--libgpsd.xml2
-rw-r--r--libgpsd_core.c12
-rw-r--r--nmea_parse.c30
-rw-r--r--ntpshm.c20
-rw-r--r--packet.c4
-rw-r--r--sirf.c9
-rw-r--r--tsip.c5
-rw-r--r--zodiac.c11
15 files changed, 113 insertions, 85 deletions
diff --git a/TODO b/TODO
index 4025d0cc..57cdfdef 100644
--- a/TODO
+++ b/TODO
@@ -160,6 +160,15 @@ a second, and a SiRF one maybe 18 times a second.
Is this worth doing? Maybe. It would reduce fix latency, possibly
to good effect if your GPS is in motion. Opinions? Calculations?
+*** Set the system time zone from latitude/longitude
+
+If we're going to give gpsd the capability to set system time via
+ntpd, why not let it set timezone as well? A good thing for hackers
+travelling with laptops!
+
+The major issue here is that I have not yet found code, or a
+database, that would allow mapping from lon/lat to timezone.
+
Local variables:
mode: outline
paragraph-separate: "[ ]*$"
diff --git a/drivers.c b/drivers.c
index ebc5b216..f7544700 100644
--- a/drivers.c
+++ b/drivers.c
@@ -12,7 +12,7 @@
*
**************************************************************************/
-static int nmea_parse_input(struct gps_device_t *session)
+static gps_mask_t nmea_parse_input(struct gps_device_t *session)
{
if (session->packet_type == SIRF_PACKET) {
gpsd_report(2, "SiRF packet seen when NMEA expected.\n");
@@ -22,7 +22,7 @@ static int nmea_parse_input(struct gps_device_t *session)
return 0;
#endif /* SIRFII_ENABLE */
} else if (session->packet_type == NMEA_PACKET) {
- int st = 0;
+ gps_mask_t st = 0;
gpsd_report(2, "<= GPS: %s", session->outbuffer);
if ((st=nmea_parse((char *)session->outbuffer,&session->gpsdata))==0) {
#ifdef NON_NMEA_ENABLE
diff --git a/garmin.c b/garmin.c
index 22247d28..ce55c27c 100644
--- a/garmin.c
+++ b/garmin.c
@@ -196,14 +196,14 @@ static inline double radtodeg( double rad) {
return (double)(rad * RAD_2_DEG );
}
-static int PrintPacket(struct gps_device_t *session, Packet_t *pkt );
+static gps_mask_t PrintPacket(struct gps_device_t *session, Packet_t *pkt );
static void SendPacket (struct gps_device_t *session, Packet_t *aPacket );
static int GetPacket (struct gps_device_t *session );
// For debugging, decodes and prints some known packets.
-static int PrintPacket(struct gps_device_t *session, Packet_t *pkt)
+static gps_mask_t PrintPacket(struct gps_device_t *session, Packet_t *pkt)
{
- int mask = 0;
+ gps_mask_t mask = 0;
int maj_ver;
int min_ver;
unsigned int mode;
@@ -843,7 +843,7 @@ static int garmin_get_packet(struct gps_device_t *session, /*@unused@*/ unsigned
return ( 0 == GetPacket( session ) ? 1 : 0);
}
-static int garmin_parse_input(struct gps_device_t *session)
+static gps_mask_t garmin_parse_input(struct gps_device_t *session)
{
return PrintPacket(session, (Packet_t*)session->GarminBuffer);
}
diff --git a/gps.h b/gps.h
index c464e863..45e889df 100644
--- a/gps.h
+++ b/gps.h
@@ -70,35 +70,37 @@ struct gps_fix_t {
double climb; /* Vertical speed, meters/sec */
double epc; /* Vertical speed uncertainty */
double separation; /* Geoidal separation, MSL - WGS84 (Meters) */
-#define NO_SEPARATION -99999.0 /* must be out of band */
+#define SEPARATION_NOT_VALID -99999.0 /* must be out of band */
};
+typedef /*@unsignedintegraltype@*/ unsigned int gps_mask_t;
+
struct gps_data_t {
- unsigned long set; /* has field been set since this was last cleared? */
-#define ONLINE_SET 0x00000001
-#define TIME_SET 0x00000002
-#define TIMERR_SET 0x00000004
-#define LATLON_SET 0x00000008
-#define ALTITUDE_SET 0x00000010
-#define SPEED_SET 0x00000020
-#define TRACK_SET 0x00000040
-#define CLIMB_SET 0x00000080
-#define STATUS_SET 0x00000100
-#define MODE_SET 0x00000200
-#define HDOP_SET 0x00000400
-#define VDOP_SET 0x00000800
-#define PDOP_SET 0x00001000
-#define HERR_SET 0x00002000
-#define VERR_SET 0x00004000
-#define PERR_SET 0x00008000
-#define SATELLITE_SET 0x00010000
-#define SPEEDERR_SET 0x00020000
-#define TRACKERR_SET 0x00040000
-#define CLIMBERR_SET 0x00080000
-#define DEVICE_SET 0x00100000
-#define DEVICELIST_SET 0x00200000
-#define DEVICEID_SET 0x00400000
-#define ERROR_SET 0x00800000
+ gps_mask_t set; /* has field been set since this was last cleared? */
+#define ONLINE_SET 0x00000001u
+#define TIME_SET 0x00000002u
+#define TIMERR_SET 0x00000004u
+#define LATLON_SET 0x00000008u
+#define ALTITUDE_SET 0x00000010u
+#define SPEED_SET 0x00000020u
+#define TRACK_SET 0x00000040u
+#define CLIMB_SET 0x00000080u
+#define STATUS_SET 0x00000100u
+#define MODE_SET 0x00000200u
+#define HDOP_SET 0x00000400u
+#define VDOP_SET 0x00000800u
+#define PDOP_SET 0x00001000u
+#define HERR_SET 0x00002000u
+#define VERR_SET 0x00004000u
+#define PERR_SET 0x00008000u
+#define SATELLITE_SET 0x00010000u
+#define SPEEDERR_SET 0x00020000u
+#define TRACKERR_SET 0x00040000u
+#define CLIMBERR_SET 0x00080000u
+#define DEVICE_SET 0x00100000u
+#define DEVICELIST_SET 0x00200000u
+#define DEVICEID_SET 0x00400000u
+#define ERROR_SET 0x00800000u
double online; /* NZ if GPS is on line, 0 if not.
*
* Note: gpsd clears this flag when sentences
@@ -180,7 +182,7 @@ extern struct gps_data_t *gps_open(const char *host, const char *port);
int gps_close(struct gps_data_t *);
int gps_query(struct gps_data_t *gpsdata, const char *requests);
int gps_poll(struct gps_data_t *gpsdata);
- void gps_set_raw_hook(struct gps_data_t *gpsdata, void (*hook)(struct gps_data_t *sentence, char *buf, int len, int level));
+void gps_set_raw_hook(struct gps_data_t *gpsdata, void (*hook)(struct gps_data_t *sentence, char *buf, int len, int level));
int gps_set_callback(struct gps_data_t *gpsdata, void (*callback)(struct gps_data_t *sentence, char *buf, int len, int level), pthread_t *handler);
int gps_del_callback(struct gps_data_t *gpsdata, pthread_t *handler);
diff --git a/gpsd.c b/gpsd.c
index db090e5d..8722d488 100644
--- a/gpsd.c
+++ b/gpsd.c
@@ -325,7 +325,7 @@ static void raw_hook(struct gps_data_t *ud UNUSED,
}
/*@ -globstate @*/
-static /*@null@*/ struct gps_device_t **find_device(char *device_name)
+static /*@null@*/ /*@observer@*/struct gps_device_t **find_device(char *device_name)
/* find the channel block for and existing device name */
{
struct gps_device_t **chp;
@@ -402,7 +402,7 @@ static bool assign_channel(struct subscriber_t *user)
}
/*@ +branchstate @*/
-static char *snarfline(char *p, /*@out@*/char **out)
+static /*@ observer @*/ char *snarfline(char *p, /*@out@*/char **out)
/* copy the rest of the command line, before CR-LF */
{
char *q;
@@ -851,7 +851,7 @@ static void handle_control(int sfd, char *buf)
for (cfd = 0; cfd < FD_SETSIZE; cfd++)
if (subscribers[cfd].device == *chp)
subscribers[cfd].device = NULL;
- *chp = NULL;
+ /*@i1@*/*chp = NULL; /* modifying observer storage */
(void)write(sfd, "OK\n", 3);
} else
(void)write(sfd, "ERROR\n", 6);
@@ -893,7 +893,8 @@ int main(int argc, char *argv[])
{
static char *pid_file = NULL;
static bool nowait = false;
- static int st, changed, dsock = -1, csock = -1;
+ static int st, dsock = -1, csock = -1;
+ static gps_mask_t changed;
static char *dgpsserver = NULL;
static char *service = NULL;
static char *control_socket = NULL;
diff --git a/gpsd.h b/gpsd.h
index dcd95cd4..db8316e5 100644
--- a/gpsd.h
+++ b/gpsd.h
@@ -52,7 +52,7 @@ struct gps_type_t {
/*@null@*/int (*probe)(struct gps_device_t *session);
/*@null@*/void (*initializer)(struct gps_device_t *session);
/*@null@*/int (*get_packet)(struct gps_device_t *session, unsigned int waiting);
- /*@null@*/int (*parse_packet)(struct gps_device_t *session);
+ /*@null@*/gps_mask_t (*parse_packet)(struct gps_device_t *session);
/*@null@*/size_t (*rtcm_writer)(struct gps_device_t *session, char *rtcmbuf, size_t rtcmbytes);
/*@null@*/bool (*speed_switcher)(struct gps_device_t *session, unsigned int speed);
/*@null@*/void (*mode_switcher)(struct gps_device_t *session, int mode);
@@ -98,7 +98,7 @@ struct gps_device_t {
unsigned int packet_length;
unsigned char inbuffer[MAX_PACKET_LENGTH*2+1];
unsigned short inbuflen;
- unsigned char *inbufptr;
+ unsigned /*@observer@*/char *inbufptr;
unsigned char outbuffer[MAX_PACKET_LENGTH+1];
unsigned short outbuflen;
unsigned long counter;
@@ -159,11 +159,11 @@ struct gps_device_t {
extern struct gps_type_t **gpsd_drivers;
/* GPS library internal prototypes */
-extern int nmea_parse(char *, struct gps_data_t *);
+extern gps_mask_t nmea_parse(char *, struct gps_data_t *);
extern int nmea_send(int, const char *, ... );
extern void nmea_add_checksum(char *);
-extern int sirf_parse(struct gps_device_t *, unsigned char *, int);
+extern gps_mask_t sirf_parse(struct gps_device_t *, unsigned char *, int);
extern void packet_reset(struct gps_device_t *session);
extern void packet_pushback(struct gps_device_t *session);
@@ -178,10 +178,10 @@ extern speed_t gpsd_get_speed(struct termios *);
extern void gpsd_close(struct gps_device_t *);
extern void gpsd_raw_hook(struct gps_device_t *, char *, size_t len, int level);
-extern void gpsd_zero_satellites(struct gps_data_t *);
-extern void gpsd_binary_fix_dump(struct gps_device_t *, char[], int);
-extern void gpsd_binary_satellite_dump(struct gps_device_t *, char[], int);
-extern void gpsd_binary_quality_dump(struct gps_device_t *, char[], int);
+extern void gpsd_zero_satellites(/*@out@*/struct gps_data_t *sp)/*@modifies sp@*/;
+extern void gpsd_binary_fix_dump(/*@in@*/struct gps_device_t *, char[], int);
+extern void gpsd_binary_satellite_dump(/*@in@*/struct gps_device_t *, char[], int);
+extern void gpsd_binary_quality_dump(/*@in@*/struct gps_device_t *, char[], int);
extern int netlib_connectsock(const char *, const char *, const char *);
@@ -201,7 +201,7 @@ extern int gpsd_open_dgps(char *);
extern struct gps_device_t * gpsd_init(struct gps_context_t *, char *device);
extern int gpsd_activate(struct gps_device_t *);
extern void gpsd_deactivate(struct gps_device_t *);
-extern int gpsd_poll(struct gps_device_t *);
+extern gps_mask_t gpsd_poll(struct gps_device_t *);
extern void gpsd_wrap(struct gps_device_t *);
/* caller should supply this */
diff --git a/libgps.c b/libgps.c
index fa468924..b036d27c 100644
--- a/libgps.c
+++ b/libgps.c
@@ -88,6 +88,7 @@ void gps_clear_fix(struct gps_fix_t *fixp)
fixp->epd = UNCERTAINTY_NOT_VALID;
fixp->eps = UNCERTAINTY_NOT_VALID;
fixp->epc = UNCERTAINTY_NOT_VALID;
+ fixp->separation = SEPARATION_NOT_VALID;
}
struct gps_data_t *gps_open(const char *host, const char *port)
diff --git a/libgpsd.xml b/libgpsd.xml
index 242c4ac1..7bb7fe87 100644
--- a/libgpsd.xml
+++ b/libgpsd.xml
@@ -40,7 +40,7 @@ C:
<paramdef>struct gps_device_t * <parameter>session</parameter></paramdef>
</funcprototype>
<funcprototype>
-<funcdef>int <function>gpsd_poll</function></funcdef>
+<funcdef>gps_mask_t <function>gpsd_poll</function></funcdef>
<paramdef>struct gps_device_t * <parameter>session</parameter></paramdef>
</funcprototype>
<funcprototype>
diff --git a/libgpsd_core.c b/libgpsd_core.c
index 06335eef..5e47a584 100644
--- a/libgpsd_core.c
+++ b/libgpsd_core.c
@@ -115,8 +115,10 @@ static void *gpsd_ppsmonitor(void *arg)
/* wait for status change on the device's carrier-detect line */
while (ioctl(session->gpsdata.gps_fd, TIOCMIWAIT, TIOCM_CAR) == 0) {
(void)gettimeofday(&tv,NULL);
+ /*@ +ignoresigns */
if (ioctl(session->gpsdata.gps_fd, TIOCMGET, &state) != 0)
break;
+ /*@ -ignoresigns */
state = (state & TIOCM_CAR) != 0;
gpsd_report(5, "carrier-detect on %s changed to %d\n",
@@ -172,7 +174,7 @@ int gpsd_activate(struct gps_device_t *session)
session->gpsdata.fix.track = TRACK_NOT_VALID;
#ifdef BINARY_ENABLE
session->mag_var = NO_MAG_VAR;
- session->gpsdata.fix.separation = NO_SEPARATION;
+ session->gpsdata.fix.separation = SEPARATION_NOT_VALID;
#endif /* BINARY_ENABLE */
#ifdef NTPSHM_ENABLE
@@ -291,7 +293,7 @@ static long handle_packet(struct gps_device_t *session)
return session->gpsdata.set;
}
-int gpsd_poll(struct gps_device_t *session)
+gps_mask_t gpsd_poll(struct gps_device_t *session)
/* update the stuff in the scoreboard structure */
{
int waiting;
@@ -372,7 +374,7 @@ void gpsd_wrap(struct gps_device_t *session)
(void)free(session);
}
-void gpsd_zero_satellites(struct gps_data_t *out)
+void gpsd_zero_satellites(/*@out@*/struct gps_data_t *out)
{
(void)memset(out->PRN, 0, sizeof(out->PRN));
(void)memset(out->elevation, 0, sizeof(out->elevation));
@@ -396,7 +398,7 @@ void gpsd_raw_hook(struct gps_device_t *session, char *sentence, size_t len, int
* and seconds have also been filled in, (c) that if the private member
* mag_var is nonzero it is a magnetic variation in degrees that should be
* passed on., and (d) if the private member separation does not have the
- * value NO_SEPARATION, it is a valid WGS84 geoidal separation in
+ * value SEPARATION_NOT_VALID, it is a valid WGS84 geoidal separation in
* meters for the fix.
*/
@@ -433,7 +435,7 @@ void gpsd_binary_fix_dump(struct gps_device_t *session, char bufp[], int len)
session->gpsdata.satellites_used,
hdop_str,
session->gpsdata.fix.altitude, 'M');
- if (session->gpsdata.fix.separation == NO_SEPARATION)
+ if (session->gpsdata.fix.separation == SEPARATION_NOT_VALID)
(void)strcat(bufp, ",,");
else
(void)snprintf(bufp+strlen(bufp), len-strlen(bufp),
diff --git a/nmea_parse.c b/nmea_parse.c
index 36af3310..58171701 100644
--- a/nmea_parse.c
+++ b/nmea_parse.c
@@ -97,7 +97,7 @@ static void merge_hhmmss(char *hhmmss, struct gps_data_t *out)
*
**************************************************************************/
-static int processGPRMC(int count, char *field[], struct gps_data_t *out)
+static gps_mask_t processGPRMC(int count, char *field[], struct gps_data_t *out)
/* Recommend Minimum Specific GPS/TRANSIT Data */
{
/*
@@ -117,7 +117,7 @@ static int processGPRMC(int count, char *field[], struct gps_data_t *out)
* SiRF chipsets don't return either Mode Indicator or magnetic variation.
*/
- int mask = ERROR_SET;
+ gps_mask_t mask = ERROR_SET;
if (strcmp(field[2], "V")==0) {
/* copes with Magellan EC-10X, see below */
@@ -160,7 +160,7 @@ static int processGPRMC(int count, char *field[], struct gps_data_t *out)
return mask;
}
-static int processGPGLL(int count, char *field[], struct gps_data_t *out)
+static gps_mask_t processGPGLL(int count, char *field[], struct gps_data_t *out)
/* Geographic position - Latitude, Longitude */
{
/* Introduced in NMEA 3.0. Here are the fields:
@@ -187,7 +187,7 @@ static int processGPGLL(int count, char *field[], struct gps_data_t *out)
* actually ships updates in GPLL that aren't redundant.
*/
char *status = field[7];
- int mask = ERROR_SET;
+ gps_mask_t mask = ERROR_SET;
if (strcmp(field[6], "A")==0 && (count < 8 || *status != 'N')) {
int newstatus = out->status;
@@ -212,7 +212,7 @@ static int processGPGLL(int count, char *field[], struct gps_data_t *out)
return mask;
}
-static int processGPGGA(int c UNUSED, char *field[], struct gps_data_t *out)
+static gps_mask_t processGPGGA(int c UNUSED, char *field[], struct gps_data_t *out)
/* Global Positioning System Fix Data */
{
/*
@@ -229,7 +229,7 @@ static int processGPGGA(int c UNUSED, char *field[], struct gps_data_t *out)
(empty field) time in seconds since last DGPS update
(empty field) DGPS station ID number (0000-1023)
*/
- int mask;
+ gps_mask_t mask;
out->status = atoi(field[6]);
gpsd_report(3, "GPGGA sets status %d\n", out->status);
@@ -286,7 +286,7 @@ static int processGPGGA(int c UNUSED, char *field[], struct gps_data_t *out)
return mask;
}
-static int processGPGSA(int c UNUSED, char *field[], struct gps_data_t *out)
+static gps_mask_t processGPGSA(int c UNUSED, char *field[], struct gps_data_t *out)
/* GPS DOP and Active Satellites */
{
/*
@@ -301,7 +301,8 @@ static int processGPGSA(int c UNUSED, char *field[], struct gps_data_t *out)
16 = HDOP
17 = VDOP
*/
- int i, mask;
+ gps_mask_t mask;
+ int i;
out->fix.mode = atoi(field[2]);
mask = MODE_SET;
@@ -321,7 +322,7 @@ static int processGPGSA(int c UNUSED, char *field[], struct gps_data_t *out)
return mask;
}
-static int processGPGSV(int count, char *field[], struct gps_data_t *out)
+static gps_mask_t processGPGSV(int count, char *field[], struct gps_data_t *out)
/* GPS Satellites in View */
{
/*
@@ -395,7 +396,7 @@ static int processGPGSV(int count, char *field[], struct gps_data_t *out)
return SATELLITE_SET;
}
-static int processPGRME(int c UNUSED, char *field[], struct gps_data_t *out)
+static gps_mask_t processPGRME(int c UNUSED, char *field[], struct gps_data_t *out)
/* Garmin Estimated Position Error */
{
/*
@@ -416,7 +417,7 @@ static int processPGRME(int c UNUSED, char *field[], struct gps_data_t *out)
return HERR_SET | VERR_SET | PERR_SET;
}
-static int processGPZDA(int c UNUSED, char *field[], struct gps_data_t *out)
+static gps_mask_t processGPZDA(int c UNUSED, char *field[], struct gps_data_t *out)
/* Time & Date */
{
/*
@@ -478,10 +479,10 @@ void nmea_add_checksum(char *sentence)
(void)snprintf(p, 5, "%02X\r\n", (unsigned)sum);
}
-int nmea_parse(char *sentence, struct gps_data_t *outdata)
+gps_mask_t nmea_parse(char *sentence, struct gps_data_t *outdata)
/* parse an NMEA sentence, unpack it into a session structure */
{
- typedef int (*nmea_decoder)(int count, char *f[], struct gps_data_t *out);
+ typedef gps_mask_t (*nmea_decoder)(int count, char *f[], struct gps_data_t *out);
static struct {
char *name;
int mask;
@@ -497,7 +498,8 @@ int nmea_parse(char *sentence, struct gps_data_t *outdata)
};
unsigned char buf[NMEA_MAX+1];
- int count, retval = 0;
+ int count;
+ gps_mask_t retval = 0;
unsigned int i;
char *p, *field[80], *s;
#ifdef __UNUSED__
diff --git a/ntpshm.c b/ntpshm.c
index dd1aa8f7..115a8038 100644
--- a/ntpshm.c
+++ b/ntpshm.c
@@ -56,11 +56,13 @@ static /*@null@*/ struct shmTime *getShmTime(int unit)
return NULL;
} else {
struct shmTime *p=(struct shmTime *)shmat (shmid, 0, 0);
+ /*@ -mustfreefresh */
if ((int)(long)p == -1) {
gpsd_report(1, "shmat failed\n");
- p=0;
+ return NULL;
}
return p;
+ /*@ +mustfreefresh */
}
}
@@ -141,7 +143,7 @@ int ntpshm_put(struct gps_device_t *session, double fixtime)
int ntpshm_pps(struct gps_device_t *session, struct timeval *tv)
{
- struct shmTime *shmTime,*shmTimeP;
+ struct shmTime *shmTime = NULL, *shmTimeP = NULL;
time_t seconds;
double offset;
@@ -152,18 +154,20 @@ int ntpshm_pps(struct gps_device_t *session, struct timeval *tv)
/* check if received time messages are within locking range */
+ /*@ +ignorequals */
if (abs((shmTime->receiveTimeStampSec-shmTime->clockTimeStampSec)*1000000 +
shmTime->receiveTimeStampUSec-shmTime->clockTimeStampUSec)
> PUT_MAX_OFFSET)
return -1;
+ /*@ -ignorequals */
if (tv->tv_usec < PPS_MAX_OFFSET) {
- seconds = tv->tv_sec;
- offset = tv->tv_usec / 1000000.0;
+ seconds = (time_t)tv->tv_sec;
+ offset = (double)tv->tv_usec / 1000000.0;
} else {
if (tv->tv_usec > (1000000 - PPS_MAX_OFFSET)) {
- seconds = tv->tv_sec + 1;
- offset = 1 - (tv->tv_usec / 1000000.0);
+ seconds = (time_t)(tv->tv_sec + 1);
+ offset = 1 - ((double)tv->tv_usec / 1000000.0);
} else {
shmTimeP->precision = -1; /* lost lock */
gpsd_report(2, "ntpshm_pps: lost PPS lock\n");
@@ -174,9 +178,9 @@ int ntpshm_pps(struct gps_device_t *session, struct timeval *tv)
shmTimeP->count++;
shmTimeP->clockTimeStampSec = seconds;
shmTimeP->clockTimeStampUSec = 0;
- shmTimeP->receiveTimeStampSec = tv->tv_sec;
+ shmTimeP->receiveTimeStampSec = (time_t)tv->tv_sec;
shmTimeP->receiveTimeStampUSec = tv->tv_usec;
- shmTimeP->precision = offset? (ceil(log(offset) / M_LN2)) != 0 : -20;
+ shmTimeP->precision = offset != 0 ? (int)(ceil(log(offset) / M_LN2)) : -20;
shmTimeP->count++;
shmTimeP->valid = 1;
diff --git a/packet.c b/packet.c
index a51d2309..025f5e2b 100644
--- a/packet.c
+++ b/packet.c
@@ -511,7 +511,9 @@ int packet_get(struct gps_device_t *session, unsigned int waiting)
session->inbufptr = session->inbuffer;
session->inbuflen = 0;
}
+ /*@ -modobserver @*/
newdata = (int)read(session->gpsdata.gps_fd, session->inbufptr, (size_t)waiting);
+ /*@ +modobserver @*/
#else
newdata = waiting;
#endif /* TESTMAIN */
@@ -530,7 +532,9 @@ int packet_get(struct gps_device_t *session, unsigned int waiting)
session->outbuflen = 0;
session->inbuflen += newdata;
while (session->inbufptr < session->inbuffer + session->inbuflen) {
+ /*@ -modobserver @*/
unsigned char c = *session->inbufptr++;
+ /*@ +modobserver @*/
nexstate(session, c);
if (isprint(c))
gpsd_report(7, "Character '%c', new state: %d\n",c,session->packet_state);
diff --git a/sirf.c b/sirf.c
index 9e46c245..1e0326f6 100644
--- a/sirf.c
+++ b/sirf.c
@@ -119,9 +119,10 @@ static void sirfbin_mode(struct gps_device_t *session, int mode)
}
}
-int sirf_parse(struct gps_device_t *session, unsigned char *buf, int len)
+gps_mask_t sirf_parse(struct gps_device_t *session, unsigned char *buf, int len)
{
- int st, i, j, cn, navtype, mask;
+ int st, i, j, cn, navtype;
+ gps_mask_t mask;
char buf2[MAX_PACKET_LENGTH*3+2];
double fv;
/*@ +charint @*/
@@ -687,9 +688,9 @@ int sirf_parse(struct gps_device_t *session, unsigned char *buf, int len)
return 0;
}
-static int sirfbin_parse_input(struct gps_device_t *session)
+static gps_mask_t sirfbin_parse_input(struct gps_device_t *session)
{
- int st;
+ gps_mask_t st;
if (session->packet_type == SIRF_PACKET){
st = sirf_parse(session, session->outbuffer, (int)session->outbuflen);
diff --git a/tsip.c b/tsip.c
index 598eb5d1..64ae80e2 100644
--- a/tsip.c
+++ b/tsip.c
@@ -119,9 +119,10 @@ static bool tsip_speed_switch(struct gps_device_t *session, unsigned int speed)
return true; /* it would be nice to error-check this */
}
-static int tsip_analyze(struct gps_device_t *session)
+static gps_mask_t tsip_analyze(struct gps_device_t *session)
{
- int i, len, mask = 0;
+ int i, len;
+ gps_mask_t mask = 0;
unsigned int id, u1;
short s1,s2;
float f1,f2,f3,f4,f5;
diff --git a/zodiac.c b/zodiac.c
index 35b6fc0c..b4a12012 100644
--- a/zodiac.c
+++ b/zodiac.c
@@ -139,7 +139,7 @@ static size_t zodiac_send_rtcm(struct gps_device_t *session,
| (session->outbuffer[2*(n)+0] << 16) \
| (session->outbuffer[2*(n)+1] << 24))
-static int handle1000(struct gps_device_t *session)
+static gps_mask_t handle1000(struct gps_device_t *session)
{
/* ticks = getlong(6); */
/* sequence = getword(8); */
@@ -218,7 +218,7 @@ static int handle1000(struct gps_device_t *session)
return TIME_SET|LATLON_SET|ALTITUDE_SET|CLIMB_SET|SPEED_SET|TRACK_SET|STATUS_SET|MODE_SET|HERR_SET|VERR_SET|SPEEDERR_SET;
}
-static int handle1002(struct gps_device_t *session)
+static gps_mask_t handle1002(struct gps_device_t *session)
{
int i, j, status, prn;
@@ -256,7 +256,7 @@ static int handle1002(struct gps_device_t *session)
return SATELLITE_SET;
}
-static int handle1003(struct gps_device_t *session)
+static gps_mask_t handle1003(struct gps_device_t *session)
{
int i;
@@ -329,10 +329,11 @@ static void handle1108(struct gps_device_t *session)
#endif
}
-static int zodiac_analyze(struct gps_device_t *session)
+static gps_mask_t zodiac_analyze(struct gps_device_t *session)
{
char buf[BUFSIZ];
- int i, mask = 0;
+ int i;
+ gps_mask_t mask = 0;
unsigned int id = (unsigned int)((session->outbuffer[3]<<8) | session->outbuffer[2]);
if (session->packet_type != ZODIAC_PACKET) {