command: Prefer uint8_t* for buffers; prefer uint8_fast_t for lengths

Prefer using 'uint8_t' buffers as it is too easy to run into C sign
extension problems with 'char' buffers.  Prefer using 'uint_fast8_t'
for buffer lengths as gcc does a better job compiling them on 32bit
mcus.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
Kevin O'Connor
2018-05-24 12:49:23 -04:00
parent 2a55741ea8
commit cb4e165071
11 changed files with 71 additions and 78 deletions

View File

@@ -8,7 +8,7 @@
// Implement the standard crc "ccitt" algorithm on the given buffer
uint16_t
crc16_ccitt(char *buf, uint8_t len)
crc16_ccitt(uint8_t *buf, uint_fast8_t len)
{
uint16_t crc = 0xffff;
while (len--) {