From 09d91845f2320774718db5e9f561850713de1495 Mon Sep 17 00:00:00 2001 From: Otto Date: Tue, 6 Jul 2021 16:44:08 +0200 Subject: [PATCH] Add explicit uint32_t and int32_t setter, GCC thinks it is needed --- pdns/recursordist/rec-eventtrace.cc | 4 +--- pdns/recursordist/rec-eventtrace.hh | 17 ++++++++++++++--- pdns/recursordist/rec-protozero.cc | 1 - 3 files changed, 15 insertions(+), 7 deletions(-) diff --git a/pdns/recursordist/rec-eventtrace.cc b/pdns/recursordist/rec-eventtrace.cc index 31ad2299f2..35330cf103 100644 --- a/pdns/recursordist/rec-eventtrace.cc +++ b/pdns/recursordist/rec-eventtrace.cc @@ -40,6 +40,4 @@ const std::unordered_map RecEventTrace::s NameEntry(LuaPreOutQuery), NameEntry(LuaPostResolve), NameEntry(LuaNoData), - NameEntry(LuaNXDomain) -}; - + NameEntry(LuaNXDomain)}; diff --git a/pdns/recursordist/rec-eventtrace.hh b/pdns/recursordist/rec-eventtrace.hh index 73a1cb4b7c..62cc6b612a 100644 --- a/pdns/recursordist/rec-eventtrace.hh +++ b/pdns/recursordist/rec-eventtrace.hh @@ -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(v), start); + } + // We store int32 in an int64_t + void add(EventType e, int32_t v, bool start) + { + add(e, static_cast(v), start); + } + template void add(EventType e, T v, bool start) { @@ -209,7 +220,7 @@ public: { return d_events; } - + private: std::vector d_events; uint64_t d_base; diff --git a/pdns/recursordist/rec-protozero.cc b/pdns/recursordist/rec-protozero.cc index 7ade38f9ac..7a153ea74c 100644 --- a/pdns/recursordist/rec-protozero.cc +++ b/pdns/recursordist/rec-protozero.cc @@ -137,4 +137,3 @@ void pdns::ProtoZero::RecMessage::addEvents(const RecEventTrace& trace) } } } - -- 2.47.2