]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
dnsdist: remove implicit type conversion (fix: #11619 ) 11620/head
authorY7n05h <Y7n05h@protonmail.com>
Thu, 12 May 2022 02:44:22 +0000 (10:44 +0800)
committerY7n05h <Y7n05h@protonmail.com>
Thu, 12 May 2022 02:44:22 +0000 (10:44 +0800)
Signed-off-by: Y7n05h <Y7n05h@protonmail.com>
pdns/dnsdist-lua-inspection.cc
pdns/dnsdist-rings.cc

index 112172ce9b4e36676653f1857d1e81139e3121f3..a641b0fb8a50bd147cb928e1c59fddaa8ad87557 100644 (file)
@@ -72,10 +72,10 @@ static LuaArray<std::vector<boost::variant<string,double>>> getGenResponses(uint
 
   LuaArray<vector<boost::variant<string,double>>> ret;
   ret.reserve(std::min(rcounts.size(), static_cast<size_t>(top + 1U)));
-  uint64_t count = 1;
+  int count = 1;
   unsigned int rest = 0;
   for (const auto& rc : rcounts) {
-    if (count == top+1) {
+    if (count == static_cast<int>(top + 1)) {
       rest+=rc.first;
     }
     else {
index 6b044273a4c1cc9bb3479790470001534fc6046f..fabbd4d04352baf701deec8b1cb90c00842cd20d 100644 (file)
@@ -111,9 +111,9 @@ std::unordered_map<int, vector<boost::variant<string,double>>> Rings::getTopBand
               });
   std::unordered_map<int, vector<boost::variant<string,double>>> ret;
   uint64_t rest = 0;
-  unsigned int count = 1;
+  int count = 1;
   for(const auto& rc : rcounts) {
-    if(count==numentries+1) {
+    if (count == static_cast<int>(numentries + 1)) {
       rest+=rc.first;
     }
     else {