mirror of
https://github.com/zeek/zeek.git
synced 2025-10-01 22:28:20 +00:00
src/3rdparty: Fix clang-tidy bugprone-casting-through-void warning
This commit is contained in:
parent
b2746226d5
commit
3046be57da
1 changed files with 3 additions and 3 deletions
6
src/3rdparty/in_cksum.cc
vendored
6
src/3rdparty/in_cksum.cc
vendored
|
@ -64,7 +64,7 @@ uint16_t in_cksum(const struct checksum_block *vec, int veclen)
|
|||
for (; veclen != 0; vec++, veclen--) {
|
||||
if (vec->len == 0)
|
||||
continue;
|
||||
w = (const uint16_t *)(const void *)vec->block;
|
||||
w = reinterpret_cast<const uint16_t *>(vec->block);
|
||||
if (mlen == -1) {
|
||||
/*
|
||||
* The first byte of this chunk is the continuation
|
||||
|
@ -76,7 +76,7 @@ uint16_t in_cksum(const struct checksum_block *vec, int veclen)
|
|||
*/
|
||||
s_util.c[1] = *(const uint8_t *)w;
|
||||
sum += s_util.s;
|
||||
w = (const uint16_t *)(const void *)((const uint8_t *)w + 1);
|
||||
w = reinterpret_cast<const uint16_t *>((const uint8_t *)w + 1);
|
||||
mlen = vec->len - 1;
|
||||
} else
|
||||
mlen = vec->len;
|
||||
|
@ -87,7 +87,7 @@ uint16_t in_cksum(const struct checksum_block *vec, int veclen)
|
|||
REDUCE;
|
||||
sum <<= 8;
|
||||
s_util.c[0] = *(const uint8_t *)w;
|
||||
w = (const uint16_t *)(const void *)((const uint8_t *)w + 1);
|
||||
w = reinterpret_cast<const uint16_t *>((const uint8_t *)w + 1);
|
||||
mlen--;
|
||||
byte_swapped = 1;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue