Skip to content

Commit

Permalink
fix table declaration
Browse files Browse the repository at this point in the history
  • Loading branch information
qiyongzhong0 committed Mar 12, 2021
1 parent 00b2d90 commit 636e25a
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
3 changes: 1 addition & 2 deletions src/crc16.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ static const u16 crc16_table[] = {
0x8201, 0x42C0, 0x4380, 0x8341, 0x4100, 0x81C1, 0x8081, 0x4040
};
#elif (defined(CRC16_USING_CONST_TABLE) && (CRC16_POLY == 0x8408))
const u16 crc16_table[] = {
static const u16 crc16_table[] = {
0x0000, 0x1189, 0x2312, 0x329B, 0x4624, 0x57AD, 0x6536, 0x74BF,
0x8C48, 0x9DC1, 0xAF5A, 0xBED3, 0xCA6C, 0xDBE5, 0xE97E, 0xF8F7,
0x1081, 0x0108, 0x3393, 0x221A, 0x56A5, 0x472C, 0x75B7, 0x643E,
Expand Down Expand Up @@ -126,6 +126,5 @@ u16 crc16_cal(u8 *pdata,u32 len)
{
return(crc16_cyc_cal(CRC16_INIT_VAL, pdata, len) ^ CRC16_INIT_VAL);
}

#endif

4 changes: 2 additions & 2 deletions src/crc32.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#ifdef CRCLIB_USING_CRC32

#if (defined(CRC32_USING_CONST_TABLE) && (CRC32_POLY == 0xEDB88320))
const u32 crc32_table[] = {
static const u32 crc32_table[] = {
0x00000000, 0x77073096, 0xEE0E612C, 0x990951BA, 0x076DC419, 0x706AF48F, 0xE963A535, 0x9E6495A3,
0x0EDB8832, 0x79DCB8A4, 0xE0D5E91E, 0x97D2D988, 0x09B64C2B, 0x7EB17CBD, 0xE7B82D07, 0x90BF1D91,
0x1DB71064, 0x6AB020F2, 0xF3B97148, 0x84BE41DE, 0x1ADAD47D, 0x6DDDE4EB, 0xF4D4B551, 0x83D385C7,
Expand Down Expand Up @@ -46,7 +46,7 @@ const u32 crc32_table[] = {
0xB3667A2E, 0xC4614AB8, 0x5D681B02, 0x2A6F2B94, 0xB40BBE37, 0xC30C8EA1, 0x5A05DF1B, 0x2D02EF8D
};
#elif (defined(CRC32_USING_CONST_TABLE) && (CRC32_POLY == 0x82F63B78))
const u32 crc32_table[] = {
static const u32 crc32_table[] = {
0x00000000, 0xF26B8303, 0xE13B70F7, 0x1350F3F4, 0xC79A971F, 0x35F1141C, 0x26A1E7E8, 0xD4CA64EB,
0x8AD958CF, 0x78B2DBCC, 0x6BE22838, 0x9989AB3B, 0x4D43CFD0, 0xBF284CD3, 0xAC78BF27, 0x5E133C24,
0x105EC76F, 0xE235446C, 0xF165B798, 0x030E349B, 0xD7C45070, 0x25AFD373, 0x36FF2087, 0xC494A384,
Expand Down
4 changes: 2 additions & 2 deletions src/crc8.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#ifdef CRCLIB_USING_CRC8

#if (defined(CRC8_USING_CONST_TABLE) && (CRC8_POLY == 0x8C))
const u8 crc8_table[] = {
static const u8 crc8_table[] = {
0x00, 0x5E, 0xBC, 0xE2, 0x61, 0x3F, 0xDD, 0x83,
0xC2, 0x9C, 0x7E, 0x20, 0xA3, 0xFD, 0x1F, 0x41,
0x9D, 0xC3, 0x21, 0x7F, 0xFC, 0xA2, 0x40, 0x1E,
Expand Down Expand Up @@ -46,7 +46,7 @@ const u8 crc8_table[] = {
0xB6, 0xE8, 0x0A, 0x54, 0xD7, 0x89, 0x6B, 0x35
};
#elif (defined(CRC8_USING_CONST_TABLE) && (CRC8_POLY == 0xD9))
const u8 crc8_table[] = {
static const u8 crc8_table[] = {
0x00, 0xD0, 0x13, 0xC3, 0x26, 0xF6, 0x35, 0xE5,
0x4C, 0x9C, 0x5F, 0x8F, 0x6A, 0xBA, 0x79, 0xA9,
0x98, 0x48, 0x8B, 0x5B, 0xBE, 0x6E, 0xAD, 0x7D,
Expand Down

0 comments on commit 636e25a

Please sign in to comment.