]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
Add explicit uint32_t and int32_t setter, GCC thinks it is needed
authorOtto <otto.moerbeek@open-xchange.com>
Tue, 6 Jul 2021 14:44:08 +0000 (16:44 +0200)
committerOtto <otto.moerbeek@open-xchange.com>
Wed, 13 Oct 2021 12:33:17 +0000 (14:33 +0200)
pdns/recursordist/rec-eventtrace.cc
pdns/recursordist/rec-eventtrace.hh
pdns/recursordist/rec-protozero.cc

index 31ad2299f2ae1c4817062f3a036ba9e7ce534920..35330cf1032209d8439645c33e1fd485b1d86050 100644 (file)
@@ -40,6 +40,4 @@ const std::unordered_map<RecEventTrace::EventType, std::string> RecEventTrace::s
   NameEntry(LuaPreOutQuery),
   NameEntry(LuaPostResolve),
   NameEntry(LuaNoData),
-  NameEntry(LuaNXDomain)
-};
-
+  NameEntry(LuaNXDomain)};
index 73a1cb4b7c33fc992205b15914052ed6b8b8483c..62cc6b612a333b2cc370c84903aed18be59ad7c1 100644 (file)
@@ -39,7 +39,7 @@ public:
     // Don't forget to add a new entry to the table in the .cc file!
     RecRecv = 1,
     DistPipe = 2,
-    PCacheCheck = 3 ,
+    PCacheCheck = 3,
     SyncRes = 4,
     AnswerSent = 5,
     LuaGetTag = 100,
@@ -75,7 +75,7 @@ public:
   {
     old.d_status = Invalid;
   }
-  
+
   RecEventTrace& operator=(const RecEventTrace& old) = delete;
   RecEventTrace& operator=(RecEventTrace&& old)
   {
@@ -165,6 +165,17 @@ public:
     add(e, Value_t(std::nullopt), true);
   }
 
+  // We store uint32 in an int64_t
+  void add(EventType e, uint32_t v, bool start)
+  {
+    add(e, static_cast<int64_t>(v), start);
+  }
+  // We store int32 in an int64_t
+  void add(EventType e, int32_t v, bool start)
+  {
+    add(e, static_cast<int64_t>(v), start);
+  }
+
   template <class T>
   void add(EventType e, T v, bool start)
   {
@@ -209,7 +220,7 @@ public:
   {
     return d_events;
   }
-  
+
 private:
   std::vector<Entry> d_events;
   uint64_t d_base;
index 7ade38f9acd19a9d1299de83bcc3a09b6da1ad43..7a153ea74ca3556947320f732d9660086ae7ca5c 100644 (file)
@@ -137,4 +137,3 @@ void pdns::ProtoZero::RecMessage::addEvents(const RecEventTrace& trace)
     }
   }
 }
-