summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--driver_italk.c6
-rw-r--r--driver_sirf.c5
-rw-r--r--driver_ubx.c5
-rw-r--r--gpsd.h-tail5
-rw-r--r--subframe.c7
5 files changed, 16 insertions, 12 deletions
diff --git a/driver_italk.c b/driver_italk.c
index 65a2026e..aef87794 100644
--- a/driver_italk.c
+++ b/driver_italk.c
@@ -217,7 +217,8 @@ static gps_mask_t decode_itk_subframe(struct gps_device_t *session,
unsigned char *buf, size_t len)
{
unsigned short flags, prn, sf;
- unsigned int i, words[10];
+ unsigned int i;
+ uint32_t words[10];
if (len != 64) {
gpsd_report(LOG_PROG,
@@ -240,8 +241,7 @@ static gps_mask_t decode_itk_subframe(struct gps_device_t *session,
* words with parity checking done but parity bits still present."
*/
for (i = 0; i < 10; i++)
- words[i] =
- (unsigned int)(getleul(buf, 7 + 14 + 4 * i) >> 6) & 0xffffff;
+ words[i] = (uint32_t)(getleul(buf, 7 + 14 + 4 * i) >> 6) & 0xffffff;
gpsd_interpret_subframe(session, prn, words);
return ONLINE_IS;
diff --git a/driver_sirf.c b/driver_sirf.c
index 5a1a58d5..a2c67eb0 100644
--- a/driver_sirf.c
+++ b/driver_sirf.c
@@ -435,7 +435,8 @@ static gps_mask_t sirf_msg_swversion(struct gps_device_t *session,
static gps_mask_t sirf_msg_navdata(struct gps_device_t *session,
unsigned char *buf, size_t len)
{
- unsigned int i, words[10], chan, svid;
+ unsigned int i, chan, svid;
+ uint32_t words[10];
if (len != 43)
return 0;
@@ -444,7 +445,7 @@ static gps_mask_t sirf_msg_navdata(struct gps_device_t *session,
svid = (unsigned int)getub(buf, 2);
for (i = 0; i < 10; i++) {
- words[i] = (unsigned int)getbeul(buf, 4 * i + 3);
+ words[i] = (uint32_t)getbeul(buf, 4 * i + 3);
}
(void)gpsd_interpret_subframe_raw(session, svid, words);
diff --git a/driver_ubx.c b/driver_ubx.c
index a9bb3ccb..1e6eb887 100644
--- a/driver_ubx.c
+++ b/driver_ubx.c
@@ -275,7 +275,8 @@ static void ubx_msg_sbas(struct gps_device_t *session, unsigned char *buf)
*/
static void ubx_msg_sfrb(struct gps_device_t *session, unsigned char *buf)
{
- unsigned int i, words[10], chan, svid;
+ unsigned int i, chan, svid;
+ uint32_t words[10];
chan = (unsigned int)getub(buf, 0);
svid = (unsigned int)getub(buf, 1);
@@ -283,7 +284,7 @@ static void ubx_msg_sfrb(struct gps_device_t *session, unsigned char *buf)
/* UBX does all the parity checking, but still bad data gets through */
for (i = 0; i < 10; i++) {
- words[i] = (unsigned int)getleul(buf, 4 * i + 2) & 0xffffff;
+ words[i] = (uint32_t)getleul(buf, 4 * i + 2) & 0xffffff;
}
gpsd_interpret_subframe(session, svid, words);
diff --git a/gpsd.h-tail b/gpsd.h-tail
index f5857efb..0dc5fdb5 100644
--- a/gpsd.h-tail
+++ b/gpsd.h-tail
@@ -6,6 +6,7 @@
#endif /* GPSD_CONFIG_H */
#include <termios.h>
+#include <stdint.h>
#include "gps.h"
#ifdef _WIN32
@@ -554,8 +555,8 @@ extern void gpsd_assert_sync(struct gps_device_t *);
extern void gpsd_close(struct gps_device_t *);
extern void gpsd_zero_satellites(/*@out@*/struct gps_data_t *sp)/*@modifies sp@*/;
-extern void gpsd_interpret_subframe(struct gps_device_t *, unsigned int, unsigned int[]);
-extern int gpsd_interpret_subframe_raw(struct gps_device_t *, unsigned int, unsigned int[]);
+extern void gpsd_interpret_subframe(struct gps_device_t *, unsigned int, uint32_t[]);
+extern int gpsd_interpret_subframe_raw(struct gps_device_t *, unsigned int, uint32_t[]);
extern int gpsd_hexdump_level;
extern /*@ observer @*/ char *gpsd_hexdump(/*@null@*/const void *, size_t);
extern /*@ observer @*/ char *gpsd_hexdump_wrapper(/*@null@*/const void *, size_t, int);
diff --git a/subframe.c b/subframe.c
index bcd51227..ff8e1f76 100644
--- a/subframe.c
+++ b/subframe.c
@@ -3,6 +3,7 @@
* This file is Copyright (c) 2010 by the GPSD project
* BSD terms apply: see the file COPYING in the distribution root for details.
*/
+#include <math.h>
#include "gpsd.h"
#include "timebase.h"
@@ -18,7 +19,7 @@
/*@ -usedef @*/
int gpsd_interpret_subframe_raw(struct gps_device_t *session,
- unsigned int svid, unsigned int words[])
+ unsigned int svid, uint32_t words[])
{
unsigned int i;
unsigned int preamble, parity;
@@ -83,7 +84,7 @@ int gpsd_interpret_subframe_raw(struct gps_device_t *session,
/* you can find up to date almanac data for comparision here:
* https://gps.afspc.af.mil/gps/Current/current.alm
*/
-static void subframe_almanac( unsigned int svid, unsigned int words[],
+static void subframe_almanac( unsigned int svid, uint32_t words[],
unsigned int subframe, unsigned int sv,
unsigned int data_id)
{
@@ -123,7 +124,7 @@ static void subframe_almanac( unsigned int svid, unsigned int words[],
}
void gpsd_interpret_subframe(struct gps_device_t *session,
- unsigned int svid, unsigned int words[])
+ unsigned int svid, uint32_t words[])
{
/*
* Heavy black magic begins here!