diff options
author | Michele Campus <fci1908@gmail.com> | 2017-05-18 16:52:57 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-05-18 16:52:57 +0200 |
commit | 185cd4fb30b32a66e766d939bf08dc68c11c8c4f (patch) | |
tree | a0b2ec713982deafea08dc2f0868e6170e363c6a | |
parent | b579408711d9866e3bec3fece08cfb49061a99a5 (diff) | |
parent | 73b3ee51d19379cc7714a3a22b2f6ca0ecb9aa8b (diff) |
Merge pull request #383 from pavlosantoniou/dev
Remove unused variable and clarify operator precedence in ndpi_util.c
-rw-r--r-- | example/ndpi_util.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/example/ndpi_util.c b/example/ndpi_util.c index 53486229f..d6836176a 100644 --- a/example/ndpi_util.c +++ b/example/ndpi_util.c @@ -887,7 +887,7 @@ static uint32_t crc32_for_byte(uint32_t r) { int j; for(j = 0; j < 8; ++j) - r = (r & 1? 0: (uint32_t)0xEDB88320L) ^ r >> 1; + r = ((r & 1) ? 0 : ((uint32_t)0xEDB88320L) ^ r >> 1); return r ^ (uint32_t)0xFF000000L; } @@ -912,7 +912,7 @@ static void init_tables(uint32_t* table, uint32_t* wtable) { void ethernet_crc32(const void* data, size_t n_bytes, uint32_t* crc) { static uint32_t table[0x100], wtable[0x100*sizeof(accum_t)]; size_t n_accum = n_bytes/sizeof(accum_t); - size_t i, k, j; + size_t i, j; if(!*table) init_tables(table, wtable); |