diff options
author | Eric S. Raymond <esr@thyrsus.com> | 2010-03-29 16:20:47 -0400 |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 2010-03-29 16:20:47 -0400 |
commit | eaa18eb7a601d6c6753caf3d4a8d9541c4e158c1 (patch) | |
tree | 685901f4b613fc8041b150613f10ecc95dbf4fd8 /packet.c | |
parent | 0880dc595e638129dc123471eeb16cef32471f76 (diff) | |
download | gpsd-eaa18eb7a601d6c6753caf3d4a8d9541c4e158c1.tar.gz |
Furthr simplification of Superstar2 checksum code. All regression tess pass.
Diffstat (limited to 'packet.c')
-rw-r--r-- | packet.c | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -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)); |