]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
A few type fixes, mostly cosmetical 14025/head
authorOtto Moerbeek <otto.moerbeek@open-xchange.com>
Wed, 3 Apr 2024 12:25:15 +0000 (14:25 +0200)
committerOtto Moerbeek <otto.moerbeek@open-xchange.com>
Wed, 3 Apr 2024 12:25:15 +0000 (14:25 +0200)
pdns/stat_t.hh

index b084e761ec47c543f92c0ac9b1ea1f5ff70e6503..96c7433514de3bca2e5748c9e954379ece5c0c76 100644 (file)
@@ -62,11 +62,11 @@ namespace pdns {
     base_t operator--() {
       return --(ref());
     }
-    base_t operator+=(const stat_t_trait& arg) {
-      return ref() += arg.ref();
+    base_t operator+=(base_t arg) {
+      return ref() += arg;
     }
-    base_t operator-=(const stat_t_trait& arg) {
-      return ref() -= arg.ref();
+    base_t operator-=(base_t arg) {
+      return ref() -= arg;
     }
     base_t load() const {
       return ref().load();
@@ -85,7 +85,7 @@ namespace pdns {
     const atomic_t& ref() const {
       return *reinterpret_cast<const atomic_t *>(&counter); // NOLINT(cppcoreguidelines-pro-type-reinterpret-cast)
     }
-    typename std::aligned_storage_t<sizeof(base_t), CPU_LEVEL1_DCACHE_LINESIZE> counter;
+    typename std::aligned_storage_t<sizeof(atomic_t), CPU_LEVEL1_DCACHE_LINESIZE> counter;
   };
 
   using stat_t = stat_t_trait<uint64_t>;