mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 14:48:21 +00:00
Fix clang-tidy bugprone-implicit-widening-of-multiplication-result warnings in headers
This commit is contained in:
parent
3b7122aadb
commit
d327d6388c
3 changed files with 3 additions and 3 deletions
2
src/IP.h
2
src/IP.h
|
@ -355,7 +355,7 @@ public:
|
|||
*/
|
||||
const u_char* Payload() const {
|
||||
if ( ip4 )
|
||||
return ((const u_char*)ip4) + ip4->ip_hl * 4;
|
||||
return ((const u_char*)ip4) + (ip4->ip_hl * static_cast<std::ptrdiff_t>(4));
|
||||
|
||||
return ((const u_char*)ip6) + ip6_hdrs->TotalLength();
|
||||
}
|
||||
|
|
|
@ -432,7 +432,7 @@ inline IPAddr::IPAddr(Family family, const uint32_t* bytes, ByteOrder order) {
|
|||
|
||||
if ( order == Host ) {
|
||||
for ( unsigned int i = 0; i < 4; ++i ) {
|
||||
uint32_t* p = (uint32_t*)&in6.s6_addr[i * 4];
|
||||
uint32_t* p = (uint32_t*)&in6.s6_addr[i * static_cast<ptrdiff_t>(4)];
|
||||
*p = htonl(*p);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -425,7 +425,7 @@ constexpr size_t pad_size(size_t size) {
|
|||
if ( size == 0 )
|
||||
return 0; // glibc allocated 16 bytes anyway.
|
||||
|
||||
const int pad = 8;
|
||||
const size_t pad = 8;
|
||||
if ( size < 12 )
|
||||
return 2 * pad;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue