Explorar el Código

Use static variables for crc8fast

master
Arun Prakash Jana hace 7 años
padre
commit
02a2551a17
No se encontró ninguna clave conocida en la base de datos para esta firma ID de clave GPG: A75979F35C080412
Se han modificado 1 ficheros con 3 adiciones y 5 borrados
  1. +3
    -5
      nnn.c

+ 3
- 5
nnn.c Ver fichero

@@ -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);
}


Cargando…
Cancelar
Guardar