diff options
author | Eric S. Raymond <esr@thyrsus.com> | 2013-09-16 09:27:49 -0400 |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 2013-09-16 09:27:49 -0400 |
commit | 89d4553e3c0bcbada1f82231808854aaae81bd02 (patch) | |
tree | 15caae70cae9769a004324de632025dd8a26fa42 /driver_ais.c | |
parent | cdd01a66dd0df37c4fdd49e9d6024275fb27458c (diff) | |
download | gpsd-89d4553e3c0bcbada1f82231808854aaae81bd02.tar.gz |
Fix up the ENDCHARS macro.
Diffstat (limited to 'driver_ais.c')
-rw-r--r-- | driver_ais.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/driver_ais.c b/driver_ais.c index 8e736ac6..2baec1b6 100644 --- a/driver_ais.c +++ b/driver_ais.c @@ -27,6 +27,7 @@ */ static void from_sixbit(unsigned char *bitvec, uint start, int count, char *to) +/* beginning at bitvec bit start, unpack count sixbit characters */ { /*@ +type @*/ #ifdef S_SPLINT_S @@ -71,7 +72,7 @@ bool ais_binary_decode(struct ais_t *ais, #define UBITS(s, l) ubits((unsigned char *)bits, s, l, false) #define SBITS(s, l) sbits((signed char *)bits, s, l, false) #define UCHARS(s, to) from_sixbit((unsigned char *)bits, s, sizeof(to)-1, to) -#define ENDCHARS(s, to) from_sixbit((unsigned char *)bits, s, bitlen-(s)-1, to) +#define ENDCHARS(s, to) from_sixbit((unsigned char *)bits, s, (bitlen-(s))/6,to) ais->type = UBITS(0, 6); ais->repeat = UBITS(6, 2); ais->mmsi = UBITS(8, 30); |