diff --git a/src/IP.h b/src/IP.h index 4364676518..27473821bd 100644 --- a/src/IP.h +++ b/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(4)); return ((const u_char*)ip6) + ip6_hdrs->TotalLength(); } diff --git a/src/IPAddr.h b/src/IPAddr.h index 64e489ac62..b5c6501922 100644 --- a/src/IPAddr.h +++ b/src/IPAddr.h @@ -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(4)]; *p = htonl(*p); } } diff --git a/src/util.h b/src/util.h index 314f99bf37..147f4627f4 100644 --- a/src/util.h +++ b/src/util.h @@ -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;