mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 06:38: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--) {
|
for (; veclen != 0; vec++, veclen--) {
|
||||||
if (vec->len == 0)
|
if (vec->len == 0)
|
||||||
continue;
|
continue;
|
||||||
w = (const uint16_t *)(const void *)vec->block;
|
w = reinterpret_cast<const uint16_t *>(vec->block);
|
||||||
if (mlen == -1) {
|
if (mlen == -1) {
|
||||||
/*
|
/*
|
||||||
* The first byte of this chunk is the continuation
|
* 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;
|
s_util.c[1] = *(const uint8_t *)w;
|
||||||
sum += s_util.s;
|
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;
|
mlen = vec->len - 1;
|
||||||
} else
|
} else
|
||||||
mlen = vec->len;
|
mlen = vec->len;
|
||||||
|
@ -87,7 +87,7 @@ uint16_t in_cksum(const struct checksum_block *vec, int veclen)
|
||||||
REDUCE;
|
REDUCE;
|
||||||
sum <<= 8;
|
sum <<= 8;
|
||||||
s_util.c[0] = *(const uint8_t *)w;
|
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--;
|
mlen--;
|
||||||
byte_swapped = 1;
|
byte_swapped = 1;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue