]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
Formatting fixes
authorOtto Moerbeek <otto.moerbeek@open-xchange.com>
Tue, 23 Apr 2024 13:02:04 +0000 (15:02 +0200)
committerOtto Moerbeek <otto.moerbeek@open-xchange.com>
Mon, 6 May 2024 09:29:41 +0000 (11:29 +0200)
pdns/iputils.cc
pdns/iputils.hh

index 10b1dd7ac90d18d3f737cebac9f581450330ddc0..9c02c8431fa4b06c1b67197d7da6c14934f1bdd5 100644 (file)
@@ -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<uint8_t*>(&sin6.sin6_addr.s6_addr); // NOLINT(cppcoreguidelines-pro-type-reinterpret-cast)
+    start = reinterpret_cast<uint8_t*>(&sin6.sin6_addr.s6_addr); // NOLINT(cppcoreguidelines-pro-type-reinterpret-cast)
     len = 16;
   }
 
index 6c53406bebe333876f2ec0317db313a86e574734..b13f825eabbe8f9034f926875dedb4b77cf61adb 100644 (file)
@@ -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<char, 1024> host{};
     if (sin4.sin_family != 0) {
-    // NOLINTNEXTLINE(cppcoreguidelines-pro-type-reinterpret-cast)
+      // NOLINTNEXTLINE(cppcoreguidelines-pro-type-reinterpret-cast)
       int retval = getnameinfo(reinterpret_cast<const struct sockaddr*>(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 autoret = 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;