diff --git a/src/network/core/address.cpp b/src/network/core/address.cpp index ebb27f58ca..55b252c682 100644 --- a/src/network/core/address.cpp +++ b/src/network/core/address.cpp @@ -312,7 +312,7 @@ static SOCKET ListenLoopProc(addrinfo *runp) int on = 1; if (runp->ai_family == AF_INET6 && - setsockopt(sock, IPPROTO_IPV6, IPV6_V6ONLY, (const char*)&on, sizeof(on)) == -1) { + setsockopt(sock, IPPROTO_IPV6, IPV6_V6ONLY, reinterpret_cast(&on), sizeof(on)) == -1) { Debug(net, 3, "Could not disable IPv4 over IPv6: {}", NetworkError::GetLast().AsString()); } diff --git a/src/network/core/os_abstraction.cpp b/src/network/core/os_abstraction.cpp index 923fedba6e..045bfb913f 100644 --- a/src/network/core/os_abstraction.cpp +++ b/src/network/core/os_abstraction.cpp @@ -155,8 +155,8 @@ bool SetNoDelay([[maybe_unused]] SOCKET d) return true; #else int flags = 1; - /* The (const char*) cast is needed for windows */ - return setsockopt(d, IPPROTO_TCP, TCP_NODELAY, (const char *)&flags, sizeof(flags)) == 0; + /* The (const char *) cast is needed for windows */ + return setsockopt(d, IPPROTO_TCP, TCP_NODELAY, reinterpret_cast(&flags), sizeof(flags)) == 0; #endif } diff --git a/src/os/unix/unix.cpp b/src/os/unix/unix.cpp index 369bc3c211..8ccdb30a30 100644 --- a/src/os/unix/unix.cpp +++ b/src/os/unix/unix.cpp @@ -122,7 +122,7 @@ static std::string convert_tofrom_fs(iconv_t convd, std::string_view name) * e.g. SUSv2, pass a const pointer, whereas the newer ones, e.g. * IEEE 1003.1 (2004), pass a non-const pointer. */ #ifdef HAVE_NON_CONST_ICONV - char *inbuf = const_cast(name.data()); + char *inbuf = const_cast(name.data()); #else const char *inbuf = name.data(); #endif diff --git a/src/strings.cpp b/src/strings.cpp index 2b9346d930..0c7f4228c9 100644 --- a/src/strings.cpp +++ b/src/strings.cpp @@ -273,7 +273,7 @@ struct LanguagePackDeleter { void operator()(LanguagePack *langpack) { /* LanguagePack is in fact reinterpreted char[], we need to reinterpret it back to free it properly. */ - delete[] reinterpret_cast(langpack); + delete[] reinterpret_cast(langpack); } };