From: Otto Moerbeek Date: Tue, 29 Oct 2024 11:06:30 +0000 (+0100) Subject: Tidy X-Git-Tag: rec-5.2.0-alpha1~9^2~4 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=81ffd09ea00f315df7b55f3f31aaca2cea9ae781;p=thirdparty%2Fpdns.git Tidy --- diff --git a/pdns/recursordist/mtasker.hh b/pdns/recursordist/mtasker.hh index 0547e14411..f52848c549 100644 --- a/pdns/recursordist/mtasker.hh +++ b/pdns/recursordist/mtasker.hh @@ -186,7 +186,7 @@ private: { Error = -1, TimeOut = 0, - Answer + Answer = 1, } d_waitstatus; std::shared_ptr getUContext(); @@ -301,8 +301,9 @@ int MTasker::waitEvent(EventKey& key, EventVal* val, un *val = std::move(d_waitval); } d_tid = waiter.tid; - if ((char*)&waiter < d_threads[d_tid].highestStackSeen) { - d_threads[d_tid].highestStackSeen = (char*)&waiter; + // NOLINTNEXTLINE(cppcoreguidelines-pro-type-reinterpret-cast) + if (auto* waiterAddress = reinterpret_cast(&waiter); waiterAddress < d_threads[d_tid].highestStackSeen) { + d_threads[d_tid].highestStackSeen = waiterAddress; } assert(!d_used); key = std::move(d_eventkey); @@ -333,10 +334,9 @@ void MTasker::yield() template int MTasker::sendEvent(const EventKey& key, const EventVal* val) { - typename waiters_t::iterator waiter = d_waiters.find(key); + auto waiter = d_waiters.find(key); if (waiter == d_waiters.end()) { - // cerr<<"Event sent nobody was waiting for! " <::schedule(const struct timeval& now) return true; } if (!d_waiters.empty()) { - typedef typename waiters_t::template index::type waiters_by_ttd_index_t; - // waiters_by_ttd_index_t& ttdindex=d_waiters.template get(); - waiters_by_ttd_index_t& ttdindex = boost::multi_index::get(d_waiters); + auto& ttdindex = boost::multi_index::get(d_waiters); - for (typename waiters_by_ttd_index_t::iterator i = ttdindex.begin(); i != ttdindex.end();) { + for (auto i = ttdindex.begin(); i != ttdindex.end();) { if (i->ttd.tv_sec && i->ttd < now) { d_waitstatus = TimeOut; d_eventkey = std::move(i->key); // pass waitEvent the exact key it was woken for diff --git a/pdns/recursordist/mtasker_context.hh b/pdns/recursordist/mtasker_context.hh index dbc5683f29..645dd8d8b2 100644 --- a/pdns/recursordist/mtasker_context.hh +++ b/pdns/recursordist/mtasker_context.hh @@ -30,6 +30,8 @@ struct pdns_ucontext_t pdns_ucontext_t(); pdns_ucontext_t(pdns_ucontext_t const&) = delete; pdns_ucontext_t& operator=(pdns_ucontext_t const&) = delete; + pdns_ucontext_t(pdns_ucontext_t &&) = delete; + pdns_ucontext_t& operator=(pdns_ucontext_t &&) = delete; ~pdns_ucontext_t(); void* uc_mcontext;