summaryrefslogtreecommitdiff
path: root/packet.c
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2010-03-29 16:20:47 -0400
committerEric S. Raymond <esr@thyrsus.com>2010-03-29 16:20:47 -0400
commiteaa18eb7a601d6c6753caf3d4a8d9541c4e158c1 (patch)
tree685901f4b613fc8041b150613f10ecc95dbf4fd8 /packet.c
parent0880dc595e638129dc123471eeb16cef32471f76 (diff)
downloadgpsd-eaa18eb7a601d6c6753caf3d4a8d9541c4e158c1.tar.gz
Furthr simplification of Superstar2 checksum code. All regression tess pass.
Diffstat (limited to 'packet.c')
-rw-r--r--packet.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/packet.c b/packet.c
index c783bbe7..3b92a2bd 100644
--- a/packet.c
+++ b/packet.c
@@ -1102,11 +1102,12 @@ void packet_parse(struct gps_packet_t *lexer)
#endif /* SIRF_ENABLE */
#ifdef SUPERSTAR2_ENABLE
else if (lexer->state == SUPERSTAR2_RECOGNIZED) {
- uint16_t a = 0, b, n;
+ unsigned a = 0, b;
+ size_t n;
lexer->length = 4 + (size_t) lexer->inbuffer[3] + 2;
for(n = 0; n < lexer->length - 2; n++)
- a += (uint16_t)lexer->inbuffer[n];
- b = (uint16_t)getleuw(lexer->inbuffer, lexer->length - 2);
+ a += (unsigned)lexer->inbuffer[n];
+ b = (unsigned)getleuw(lexer->inbuffer, lexer->length - 2);
gpsd_report(LOG_IO, "SuperStarII pkt dump: type %u len %u: %s\n",
lexer->inbuffer[1], (unsigned int)lexer->length,
gpsd_hexdump_wrapper(lexer->inbuffer, lexer->length, LOG_RAW));