浏览代码

Use static variables for crc8fast

master
Arun Prakash Jana 7 年前
父节点
当前提交
02a2551a17
找不到此签名对应的密钥 GPG 密钥 ID: A75979F35C080412
共有 1 个文件被更改,包括 3 次插入5 次删除
  1. +3
    -5
      nnn.c

+ 3
- 5
nnn.c 查看文件

@@ -354,13 +354,11 @@ crc8init()
static uchar
crc8fast(uchar const message[], size_t n)
{
uchar data;
uchar remainder = 0;
size_t byte;

static uchar data, remainder;
static size_t byte;

/* Divide the message by the polynomial, a byte at a time */
for (byte = 0; byte < n; ++byte) {
for (remainder = byte = 0; byte < n; ++byte) {
data = message[byte] ^ (remainder >> (WIDTH - 8));
remainder = crc8table[data] ^ (remainder << 8);
}


正在加载...
取消
保存