aboutsummaryrefslogtreecommitdiffstats
path: root/src/generic/crc16_ccitt.c
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2018-05-24 12:49:23 -0400
committerKevin O'Connor <kevin@koconnor.net>2018-05-28 10:43:39 -0400
commitcb4e165071ad56c4cf881f5221f02eeefde5de53 (patch)
tree0d88bd5e3ebaf53526cda428eebf3d7ad61876bf /src/generic/crc16_ccitt.c
parent2a55741ea883e6a9958a64c3463b4c3d60c21b63 (diff)
downloadkutter-cb4e165071ad56c4cf881f5221f02eeefde5de53.tar.gz
kutter-cb4e165071ad56c4cf881f5221f02eeefde5de53.tar.xz
kutter-cb4e165071ad56c4cf881f5221f02eeefde5de53.zip
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>
Diffstat (limited to 'src/generic/crc16_ccitt.c')
-rw-r--r--src/generic/crc16_ccitt.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/generic/crc16_ccitt.c b/src/generic/crc16_ccitt.c
index 8347bb83..87d08cac 100644
--- a/src/generic/crc16_ccitt.c
+++ b/src/generic/crc16_ccitt.c
@@ -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--) {