]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
rec: Get rid of warnings when compiling with Boost 1.74 9860/head
authorRemi Gacogne <remi.gacogne@powerdns.com>
Fri, 11 Dec 2020 16:01:00 +0000 (17:01 +0100)
committerRemi Gacogne <remi.gacogne@powerdns.com>
Mon, 14 Dec 2020 11:13:47 +0000 (12:13 +0100)
pdns/rec_channel_rec.cc
pdns/test-dnsname_cc.cc

index 543606418c69fd4de25d40b124ec6e5ff2f6eb99..bfefdd4434596b5bd6d136a1844f1fcf8ac36ef5 100644 (file)
@@ -3,7 +3,7 @@
 #endif
 #include "utility.hh"
 #include "rec_channel.hh"
-#include <boost/bind.hpp>
+
 #include <vector>
 #ifdef MALLOC_TRACE
 #include "malloctrace.hh"
@@ -1166,26 +1166,27 @@ void registerAllStats()
   addGetStat("noedns-outqueries", &g_stats.noEdnsOutQueries);
 
   addGetStat("uptime", calculateUptime);
-  addGetStat("real-memory-usage", boost::bind(getRealMemoryUsage, string()));
-  addGetStat("special-memory-usage", boost::bind(getSpecialMemoryUsage, string()));
-  addGetStat("fd-usage", boost::bind(getOpenFileDescriptors, string()));
+  addGetStat("real-memory-usage", []{ return getRealMemoryUsage(string()); });
+  addGetStat("special-memory-usage", []{ return getSpecialMemoryUsage(string()); });
+  addGetStat("fd-usage", []{ return getOpenFileDescriptors(string()); });
 
   //  addGetStat("query-rate", getQueryRate);
   addGetStat("user-msec", getUserTimeMsec);
   addGetStat("sys-msec", getSysTimeMsec);
 
 #ifdef __linux__
-  addGetStat("cpu-iowait", boost::bind(getCPUIOWait, string()));
-  addGetStat("cpu-steal", boost::bind(getCPUSteal, string()));
+  addGetStat("cpu-iowait", []{ return getCPUIOWait(string()); });
+  addGetStat("cpu-steal", []{ return getCPUSteal(string()); });
 #endif
 
-  for(unsigned int n=0; n < g_numThreads; ++n)
-    addGetStat("cpu-msec-thread-"+std::to_string(n), boost::bind(&doGetThreadCPUMsec, n));
+  for (unsigned int n = 0; n < g_numThreads; ++n) {
+    addGetStat("cpu-msec-thread-"+std::to_string(n), [n]{ return doGetThreadCPUMsec(n);});
+  }
 
 #ifdef MALLOC_TRACE
-  addGetStat("memory-allocs", boost::bind(&MallocTracer::getAllocs, g_mtracer, string()));
-  addGetStat("memory-alloc-flux", boost::bind(&MallocTracer::getAllocFlux, g_mtracer, string()));
-  addGetStat("memory-allocated", boost::bind(&MallocTracer::getTotAllocated, g_mtracer, string()));
+  addGetStat("memory-allocs", []{ return g_mtracer->getAllocs(string()); });
+  addGetStat("memory-alloc-flux", []{ return g_mtracer->getAllocFlux(string()); });
+  addGetStat("memory-allocated", []{ return g_mtracer->getTotAllocated(string()); });
 #endif
 
   addGetStat("dnssec-validations", &g_stats.dnssecValidations);
index c96baef50de5db886e3cba503b6f2afd7a624138..cc80a0fab8d9c3bb32eacbd45df3a05c9f12500c 100644 (file)
@@ -1,14 +1,16 @@
 #define BOOST_TEST_DYN_LINK
 #define BOOST_TEST_NO_MAIN
 #include <boost/test/unit_test.hpp>
-#include <boost/assign/std/map.hpp>
+
+#include <cmath>
 #include <numeric>
-#include <math.h>
+#include <unordered_set>
+
 #include "dnsname.hh"
 #include "misc.hh"
 #include "dnswriter.hh"
 #include "dnsrecords.hh"
-#include <unordered_set>
+
 using namespace boost;
 using std::string;