diff options
author | Eric S. Raymond <esr@thyrsus.com> | 2010-12-24 06:02:23 -0500 |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 2010-12-24 06:02:23 -0500 |
commit | 1244df56d664261c97d1ed8424f0a2ad08bc77ec (patch) | |
tree | 6dd1b04ab35c6964bd3cd59041735102561ad425 /subframe.c | |
parent | 3dc9a10d4d20e44a4750e3a5620464ee3d1a3eb6 (diff) | |
download | gpsd-1244df56d664261c97d1ed8424f0a2ad08bc77ec.tar.gz |
Reorder some declarations so as not to choke older compilers.
Diffstat (limited to 'subframe.c')
-rw-r--r-- | subframe.c | 23 |
1 files changed, 11 insertions, 12 deletions
@@ -22,7 +22,7 @@ int gpsd_interpret_subframe_raw(struct gps_device_t *session, unsigned int svid, uint32_t words[]) { unsigned int i; - unsigned int preamble, parity; + uint32_t preamble, parity; /* * This function assumes an array of 10 ints, each of which carries @@ -67,7 +67,7 @@ int gpsd_interpret_subframe_raw(struct gps_device_t *session, if (invert) { words[i] ^= 0x3fffffc0; } - parity = isgps_parity(words[i]); + parity = (uint32_t)isgps_parity((isgps30bits_t)words[i]); if (parity != (words[i] & 0x3f)) { gpsd_report(LOG_IO, "50B: gpsd_interpret_subframe_raw parity fail words[%d] 0x%x != 0x%x\n", @@ -455,8 +455,16 @@ void gpsd_interpret_subframe(struct gps_device_t *session, * plus SV health for SV 25 through 32 */ { - sv = -1; unsigned char svf[33]; + unsigned char svh25 = ((words[7] >> 0) & 0x00003F); + unsigned char svh26 = ((words[8] >> 18) & 0x00003F); + unsigned char svh27 = ((words[8] >> 12) & 0x00003F); + unsigned char svh28 = ((words[8] >> 6) & 0x00003F); + unsigned char svh29 = ((words[8] >> 0) & 0x00003F); + unsigned char svh30 = ((words[9] >> 18) & 0x00003F); + unsigned char svh31 = ((words[9] >> 12) & 0x00003F); + unsigned char svh32 = ((words[9] >> 6) & 0x00003F); + sv = -1; svf[1] = ((words[2] >> 12) & 0x00000F); svf[2] = ((words[2] >> 8) & 0x00000F); svf[3] = ((words[2] >> 4) & 0x00000F); @@ -490,15 +498,6 @@ void gpsd_interpret_subframe(struct gps_device_t *session, svf[31] = ((words[7] >> 12) & 0x00000F); svf[32] = ((words[7] >> 8) & 0x00000F); - unsigned char svh25 = ((words[7] >> 0) & 0x00003F); - unsigned char svh26 = ((words[8] >> 18) & 0x00003F); - unsigned char svh27 = ((words[8] >> 12) & 0x00003F); - unsigned char svh28 = ((words[8] >> 6) & 0x00003F); - unsigned char svh29 = ((words[8] >> 0) & 0x00003F); - unsigned char svh30 = ((words[9] >> 18) & 0x00003F); - unsigned char svh31 = ((words[9] >> 12) & 0x00003F); - unsigned char svh32 = ((words[9] >> 6) & 0x00003F); - gpsd_report(LOG_PROG, "50B: SF:4-25 data_id %d " "SV1:%u SV2:%u SV3:%u SV4:%u " "SV5:%u SV6:%u SV7:%u SV8:%u " |