From 209a907accbb2b19e5b59deb4dde0dc25e95b37f Mon Sep 17 00:00:00 2001 From: Otto Moerbeek Date: Tue, 23 Apr 2024 15:02:04 +0200 Subject: [PATCH] Formatting fixes --- pdns/iputils.cc | 6 +++--- pdns/iputils.hh | 14 ++++++++------ 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/pdns/iputils.cc b/pdns/iputils.cc index 10b1dd7ac9..9c02c8431f 100644 --- a/pdns/iputils.cc +++ b/pdns/iputils.cc @@ -239,7 +239,7 @@ bool setReusePort(int sockfd) bool HarvestTimestamp(struct msghdr* msgh, struct timeval* timeval) { - // NOLINTBEGIN(cppcoreguidelines-pro-type-cstyle-cast, cppcoreguidelines-pro-bounds-pointer-arithmetic, cppcoreguidelines-pro-type-const-cast, cppcoreguidelines-pro-type-reinterpret-cast) + // NOLINTBEGIN(cppcoreguidelines-pro-type-cstyle-cast, cppcoreguidelines-pro-bounds-pointer-arithmetic, cppcoreguidelines-pro-type-const-cast, cppcoreguidelines-pro-type-reinterpret-cast) #ifdef SO_TIMESTAMP struct cmsghdr* cmsg{}; for (cmsg = CMSG_FIRSTHDR(msgh); cmsg != nullptr; cmsg = CMSG_NXTHDR(msgh, cmsg)) { @@ -284,7 +284,7 @@ bool HarvestDestinationAddress(const struct msghdr* msgh, ComboAddress* destinat } } return false; - // NOLINTEND(cppcoreguidelines-pro-type-cstyle-cast, cppcoreguidelines-pro-bounds-pointer-arithmetic, cppcoreguidelines-pro-type-const-cast, cppcoreguidelines-pro-type-reinterpret-cast) + // NOLINTEND(cppcoreguidelines-pro-type-cstyle-cast, cppcoreguidelines-pro-bounds-pointer-arithmetic, cppcoreguidelines-pro-type-const-cast, cppcoreguidelines-pro-type-reinterpret-cast) } bool IsAnyAddress(const ComboAddress& addr) @@ -356,7 +356,7 @@ void ComboAddress::truncate(unsigned int bits) noexcept if (bits >= 128) { return; } - start = reinterpret_cast(&sin6.sin6_addr.s6_addr); // NOLINT(cppcoreguidelines-pro-type-reinterpret-cast) + start = reinterpret_cast(&sin6.sin6_addr.s6_addr); // NOLINT(cppcoreguidelines-pro-type-reinterpret-cast) len = 16; } diff --git a/pdns/iputils.hh b/pdns/iputils.hh index 6c53406beb..b13f825eab 100644 --- a/pdns/iputils.hh +++ b/pdns/iputils.hh @@ -85,7 +85,9 @@ union ComboAddress { - struct sockaddr_in sin4{}; + struct sockaddr_in sin4 + { + }; struct sockaddr_in6 sin6; bool operator==(const ComboAddress& rhs) const @@ -304,7 +306,7 @@ union ComboAddress { std::array host{}; if (sin4.sin_family != 0) { - // NOLINTNEXTLINE(cppcoreguidelines-pro-type-reinterpret-cast) + // NOLINTNEXTLINE(cppcoreguidelines-pro-type-reinterpret-cast) int retval = getnameinfo(reinterpret_cast(this), getSocklen(), host.data(), host.size(), nullptr, 0, NI_NUMERICHOST); if (retval == 0) { return host.data(); @@ -325,7 +327,7 @@ union ComboAddress } } else if (sin4.sin_family == AF_INET6) { - const auto *ret = inet_ntop(sin4.sin_family, &sin6.sin6_addr, host.data(), host.size()); + const auto* ret = inet_ntop(sin4.sin_family, &sin6.sin6_addr, host.data(), host.size()); if (ret != nullptr) { return host.data(); } @@ -771,7 +773,7 @@ public: return false; } } - if (isIPv6()) { + if (isIPv6()) { if (bit >= 128 || bit < (128 - d_bits)) { return false; } @@ -1065,8 +1067,8 @@ public: { public: using value_type = node_type; - using reference = node_type &; - using pointer = node_type *; + using reference = node_type&; + using pointer = node_type*; using iterator_category = std::forward_iterator_tag; using difference_type = size_type; -- 2.47.2