From: Miod Vallat Date: Wed, 12 Nov 2025 07:50:15 +0000 (+0100) Subject: Appease clang-tidy X-Git-Tag: rec-5.4.0-alpha1~106^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bdf90a1c392e565d2f71e453c520c3992bd22f19;p=thirdparty%2Fpdns.git Appease clang-tidy Signed-off-by: Miod Vallat --- diff --git a/pdns/auth-main.cc b/pdns/auth-main.cc index 2ec03dea01..517a0e311e 100644 --- a/pdns/auth-main.cc +++ b/pdns/auth-main.cc @@ -569,9 +569,10 @@ static void qthread(unsigned int num) AtomicCounter& numreceived6 = *S.getPointer("udp6-queries"); AtomicCounter& overloadDrops = *S.getPointer("overload-drops"); - int diff, start; + int diff{}; + int start{}; bool logDNSQueries = ::arg().mustDo("log-dns-queries"); - shared_ptr NS; + shared_ptr NS; // NOLINT(readability-identifier-length) std::string buffer; ComboAddress accountremote; @@ -633,8 +634,9 @@ static void qthread(unsigned int num) S.ringAccount("remotes", question.getInnerRemote()); if (logDNSQueries) { g_log << Logger::Notice << "Remote " << question.getRemoteString() << " wants '" << question.qdomain << "|" << question.qtype << "', do = " << question.d_dnssecOk << ", bufsize = " << question.getMaxReplyLen(); - if (question.d_ednsRawPacketSizeLimit > 0 && question.getMaxReplyLen() != (unsigned int)question.d_ednsRawPacketSizeLimit) + if (question.d_ednsRawPacketSizeLimit > 0 && question.getMaxReplyLen() != (unsigned int)question.d_ednsRawPacketSizeLimit) { g_log << " (" << question.d_ednsRawPacketSizeLimit << ")"; + } } if (PC.enabled() && (question.d.opcode != Opcode::Notify && question.d.opcode != Opcode::Update) && question.couldBeCached()) { @@ -653,7 +655,7 @@ static void qthread(unsigned int num) cached.d_inner_remote = question.d_inner_remote; cached.setSocket(question.getSocket()); // inlined cached.d_anyLocal = question.d_anyLocal; - cached.setMaxReplyLen(question.getMaxReplyLen()); + cached.setMaxReplyLen(question.getMaxReplyLen()); // NOLINT(bugprone-narrowing-conversions,cppcoreguidelines-narrowing-conversions) get returns unsigned, set takes signed... cached.d.rd = question.d.rd; // copy in recursion desired bit cached.d.id = question.d.id; cached.commitD(); // commit d to the packet inlined diff --git a/pdns/misc.hh b/pdns/misc.hh index b5deb14fa0..33ee88bd81 100644 --- a/pdns/misc.hh +++ b/pdns/misc.hh @@ -858,7 +858,7 @@ struct FDWrapper int reset() { int ret = 0; - if (d_fd >= 0) { + if (d_fd >= 0) { // NOLINT(clang-analyzer-core.UndefinedBinaryOperatorResult): obvious false positive ret = close(d_fd); } d_fd = -1;