fix return type of crc10_check and crc12_check

This commit is contained in:
Pavel Demin 2018-04-01 13:57:20 +02:00
parent 88fceebb02
commit 60c33e05cf
2 changed files with 6 additions and 2 deletions

View File

@ -1,3 +1,5 @@
#include <stdbool.h>
static unsigned short table[256] = static unsigned short table[256] =
{ {
0x0000, 0x048f, 0x091e, 0x0d91, 0x123c, 0x16b3, 0x1b22, 0x1fad, 0x0000, 0x048f, 0x091e, 0x0d91, 0x123c, 0x16b3, 0x1b22, 0x1fad,
@ -51,7 +53,7 @@ short crc10(unsigned char const *data, int length)
return remainder & 0x03ff; return remainder & 0x03ff;
} }
short crc10_check(unsigned char const *data, int length) bool crc10_check(unsigned char const *data, int length)
{ {
return !crc10(data, length); return !crc10(data, length);
} }

View File

@ -1,3 +1,5 @@
#include <stdbool.h>
static unsigned short table[256] = static unsigned short table[256] =
{ {
0x0000, 0x1c06, 0x340a, 0x280c, 0x6814, 0x7412, 0x5c1e, 0x4018, 0x0000, 0x1c06, 0x340a, 0x280c, 0x6814, 0x7412, 0x5c1e, 0x4018,
@ -51,7 +53,7 @@ short crc12(unsigned char const *data, int length)
return remainder & 0x0fff; return remainder & 0x0fff;
} }
short crc12_check(unsigned char const *data, int length) bool crc12_check(unsigned char const *data, int length)
{ {
return !crc12(data, length); return !crc12(data, length);
} }