diff --git a/iocore/cache/P_CacheHosting.h b/iocore/cache/P_CacheHosting.h index 00c8cb0cdb0..62e46c1201d 100644 --- a/iocore/cache/P_CacheHosting.h +++ b/iocore/cache/P_CacheHosting.h @@ -153,10 +153,7 @@ struct CacheHostTableConfig; typedef int (CacheHostTableConfig::*CacheHostTabHandler)(int, void *); struct CacheHostTableConfig : public Continuation { CacheHostTable **ppt; - CacheHostTableConfig(CacheHostTable **appt) : Continuation(nullptr), ppt(appt) - { - SET_HANDLER((CacheHostTabHandler)&CacheHostTableConfig::mainEvent); - } + CacheHostTableConfig(CacheHostTable **appt) : Continuation(nullptr), ppt(appt) { SET_HANDLER(&CacheHostTableConfig::mainEvent); } int mainEvent(int event, Event *e) diff --git a/iocore/dns/DNS.cc b/iocore/dns/DNS.cc index 195fb12407b..f47c702af93 100644 --- a/iocore/dns/DNS.cc +++ b/iocore/dns/DNS.cc @@ -442,7 +442,7 @@ DNSEntry::init(DNSQueryData target, int qtype_arg, Continuation *acont, DNSProce } } - SET_HANDLER((DNSEntryHandler)&DNSEntry::mainEvent); + SET_HANDLER(&DNSEntry::mainEvent); } /** @@ -1240,7 +1240,7 @@ DNSEntry::delayEvent(int event, Event *e) { (void)event; if (dnsProcessor.handler) { - SET_HANDLER((DNSEntryHandler)&DNSEntry::mainEvent); + SET_HANDLER(&DNSEntry::mainEvent); return handleEvent(EVENT_IMMEDIATE, e); } e->schedule_in(DNS_DELAY_PERIOD); @@ -1261,7 +1261,7 @@ DNSEntry::mainEvent(int event, Event *e) } if (!dnsH) { Debug("dns", "handler not found, retrying..."); - SET_HANDLER((DNSEntryHandler)&DNSEntry::delayEvent); + SET_HANDLER(&DNSEntry::delayEvent); return handleEvent(event, e); } @@ -1995,7 +1995,7 @@ struct DNSRegressionContinuation : public Continuation { i(0), test(t) { - SET_HANDLER((DNSRegContHandler)&DNSRegressionContinuation::mainEvent); + SET_HANDLER(&DNSRegressionContinuation::mainEvent); } }; diff --git a/iocore/eventsystem/P_Freer.h b/iocore/eventsystem/P_Freer.h index deb916d4e8f..4e253054230 100644 --- a/iocore/eventsystem/P_Freer.h +++ b/iocore/eventsystem/P_Freer.h @@ -99,10 +99,7 @@ struct FreerContinuation : public Continuation { return EVENT_DONE; } - explicit FreerContinuation(void *ap) : Continuation(nullptr), p(ap) - { - SET_HANDLER((FreerContHandler)&FreerContinuation::dieEvent); - } + explicit FreerContinuation(void *ap) : Continuation(nullptr), p(ap) { SET_HANDLER(&FreerContinuation::dieEvent); } }; TS_INLINE void diff --git a/iocore/hostdb/HostDB.cc b/iocore/hostdb/HostDB.cc index 03c808511c4..73b159636e5 100644 --- a/iocore/hostdb/HostDB.cc +++ b/iocore/hostdb/HostDB.cc @@ -505,7 +505,7 @@ HostDBProcessor::start(int, size_t) hostdb_current_timestamp = ts_clock::now(); HostDBContinuation *b = hostDBContAllocator.alloc(); - SET_CONTINUATION_HANDLER(b, (HostDBContHandler)&HostDBContinuation::backgroundEvent); + SET_CONTINUATION_HANDLER(b, &HostDBContinuation::backgroundEvent); b->mutex = new_ProxyMutex(); b->updateHostFileConfig(); eventProcessor.schedule_every(b, HRTIME_SECONDS(1), ET_DNS); @@ -765,7 +765,7 @@ HostDBProcessor::getby(Continuation *cont, cb_process_result_pfn cb_process_resu copt.cont = cont; copt.host_res_style = (hash.db_mark == HOSTDB_MARK_SRV) ? HOST_RES_NONE : opt.host_res_style; c->init(hash, copt); - SET_CONTINUATION_HANDLER(c, (HostDBContHandler)&HostDBContinuation::probeEvent); + SET_CONTINUATION_HANDLER(c, &HostDBContinuation::probeEvent); thread->schedule_in(c, MUTEX_RETRY_DELAY); @@ -886,7 +886,7 @@ HostDBProcessor::iterate(Continuation *cont) copt.host_res_style = HOST_RES_NONE; c->init(HostDBHash(), copt); c->current_iterate_pos = 0; - SET_CONTINUATION_HANDLER(c, (HostDBContHandler)&HostDBContinuation::iterateEvent); + SET_CONTINUATION_HANDLER(c, &HostDBContinuation::iterateEvent); thread->schedule_in(c, HOST_DB_RETRY_PERIOD); @@ -986,7 +986,7 @@ HostDBContinuation::dnsPendingEvent(int event, Event *e) hostdb_cont_free(this); return EVENT_DONE; } else { - SET_HANDLER((HostDBContHandler)&HostDBContinuation::probeEvent); + SET_HANDLER(&HostDBContinuation::probeEvent); return probeEvent(EVENT_INTERVAL, nullptr); } } @@ -1168,7 +1168,7 @@ HostDBContinuation::dnsEvent(int event, HostEnt *e) // Check for IP family failover if (failed && check_for_retry(hash.db_mark, host_res_style)) { this->refresh_hash(); // family changed if we're doing a retry. - SET_CONTINUATION_HANDLER(this, (HostDBContHandler)&HostDBContinuation::probeEvent); + SET_CONTINUATION_HANDLER(this, &HostDBContinuation::probeEvent); thread->schedule_in(this, MUTEX_RETRY_DELAY); return EVENT_CONT; } @@ -1190,7 +1190,7 @@ HostDBContinuation::dnsEvent(int event, HostEnt *e) } if (need_to_reschedule) { - SET_HANDLER((HostDBContHandler)&HostDBContinuation::probeEvent); + SET_HANDLER(&HostDBContinuation::probeEvent); // Will reschedule on affinity thread or current thread timeout = eventProcessor.schedule_in(this, HOST_DB_RETRY_PERIOD); return EVENT_CONT; @@ -1434,7 +1434,7 @@ HostDBContinuation::do_dns() DNSProcessor::Options opt; opt.timeout = dns_lookup_timeout; opt.host_res_style = host_res_style_for(hash.db_mark); - SET_HANDLER((HostDBContHandler)&HostDBContinuation::dnsEvent); + SET_HANDLER(&HostDBContinuation::dnsEvent); if (is_byname()) { if (hash.dns_server) { opt.handler = hash.dns_server->x_dnsH; @@ -1449,7 +1449,7 @@ HostDBContinuation::do_dns() pending_action = dnsProcessor.gethostbyaddr(this, &hash.ip, opt); } } else { - SET_HANDLER((HostDBContHandler)&HostDBContinuation::dnsPendingEvent); + SET_HANDLER(&HostDBContinuation::dnsPendingEvent); } } @@ -1877,7 +1877,7 @@ struct HostDBTestReverse : public Continuation { HostDBTestReverse(RegressionTest *t, int atype, int *astatus) : Continuation(new_ProxyMutex()), test(t), type(atype), status(astatus) { - SET_HANDLER((HostDBTestReverseHandler)&HostDBTestReverse::mainEvent); + SET_HANDLER(&HostDBTestReverse::mainEvent); randu.seed(std::chrono::system_clock::now().time_since_epoch().count()); } }; diff --git a/iocore/hostdb/P_HostDBProcessor.h b/iocore/hostdb/P_HostDBProcessor.h index f110fbe26ab..ad1fd1a9706 100644 --- a/iocore/hostdb/P_HostDBProcessor.h +++ b/iocore/hostdb/P_HostDBProcessor.h @@ -314,7 +314,7 @@ struct HostDBContinuation : public Continuation { { ink_zero(hash_host_name_store); ink_zero(hash.hash); - SET_HANDLER((HostDBContHandler)&HostDBContinuation::probeEvent); + SET_HANDLER(&HostDBContinuation::probeEvent); } }; diff --git a/iocore/net/QUICNetVConnection.cc b/iocore/net/QUICNetVConnection.cc index 70d20ef930e..7f230527118 100644 --- a/iocore/net/QUICNetVConnection.cc +++ b/iocore/net/QUICNetVConnection.cc @@ -241,7 +241,7 @@ void QUICNetVConnection::init(QUICVersion version, QUICConnectionId peer_cid, QUICConnectionId original_cid, UDPConnection *udp_con, QUICPacketHandler *packet_handler, QUICResetTokenTable *rtable) { - SET_HANDLER((NetVConnHandler)&QUICNetVConnection::startEvent); + SET_HANDLER(&QUICNetVConnection::startEvent); this->_initial_version = version; this->_udp_con = udp_con; this->_packet_handler = packet_handler; @@ -266,7 +266,7 @@ QUICNetVConnection::init(QUICVersion version, QUICConnectionId peer_cid, QUICCon QUICConnectionId retry_cid, UDPConnection *udp_con, QUICPacketHandler *packet_handler, QUICResetTokenTable *rtable, QUICConnectionTable *ctable) { - SET_HANDLER((NetVConnHandler)&QUICNetVConnection::acceptEvent); + SET_HANDLER(&QUICNetVConnection::acceptEvent); this->_initial_version = version; this->_udp_con = udp_con; this->_packet_handler = packet_handler; @@ -365,7 +365,7 @@ QUICNetVConnection::acceptEvent(int event, Event *e) this->read.enabled = 1; // Handshake callback handler. - SET_HANDLER((NetVConnHandler)&QUICNetVConnection::state_pre_handshake); + SET_HANDLER(&QUICNetVConnection::state_pre_handshake); // Send this netvc to InactivityCop. nh->startCop(this); @@ -575,7 +575,7 @@ QUICNetVConnection::connectUp(EThread *t, int fd) this->thread = this_ethread(); ink_assert(nh->mutex->thread_holding == this->thread); - SET_HANDLER((NetVConnHandler)&QUICNetVConnection::state_pre_handshake); + SET_HANDLER(&QUICNetVConnection::state_pre_handshake); if ((res = nh->startIO(this)) < 0) { // FIXME: startIO only return 0 now! what should we do if it failed ? @@ -2137,7 +2137,7 @@ void QUICNetVConnection::_switch_to_handshake_state() { QUICConDebug("Enter state_handshake"); - SET_HANDLER((NetVConnHandler)&QUICNetVConnection::state_handshake); + SET_HANDLER(&QUICNetVConnection::state_handshake); } void @@ -2148,7 +2148,7 @@ QUICNetVConnection::_switch_to_established_state() QUICConDebug("Negotiated cipher suite: %s", this->_handshake_handler->negotiated_cipher_suite()); this->_record_tls_handshake_end_time(); - SET_HANDLER((NetVConnHandler)&QUICNetVConnection::state_connection_established); + SET_HANDLER(&QUICNetVConnection::state_connection_established); std::shared_ptr remote_tp = this->_handshake_handler->remote_transport_parameters(); std::shared_ptr local_tp = this->_handshake_handler->local_transport_parameters(); @@ -2200,7 +2200,7 @@ QUICNetVConnection::_switch_to_closing_state(QUICConnectionErrorUPtr error) ink_hrtime rto = this->_rtt_measure.current_pto_period(); QUICConDebug("Enter state_connection_closing"); - SET_HANDLER((NetVConnHandler)&QUICNetVConnection::state_connection_closing); + SET_HANDLER(&QUICNetVConnection::state_connection_closing); // This states SHOULD persist for three times the // current Retransmission Timeout (RTO) interval as defined in @@ -2228,7 +2228,7 @@ QUICNetVConnection::_switch_to_draining_state(QUICConnectionErrorUPtr error) ink_hrtime rto = this->_rtt_measure.current_pto_period(); QUICConDebug("Enter state_connection_draining"); - SET_HANDLER((NetVConnHandler)&QUICNetVConnection::state_connection_draining); + SET_HANDLER(&QUICNetVConnection::state_connection_draining); // This states SHOULD persist for three times the // current Retransmission Timeout (RTO) interval as defined in @@ -2246,7 +2246,7 @@ QUICNetVConnection::_switch_to_close_state() QUICConDebug("Switching state without handshake completion"); } QUICConDebug("Enter state_connection_closed"); - SET_HANDLER((NetVConnHandler)&QUICNetVConnection::state_connection_closed); + SET_HANDLER(&QUICNetVConnection::state_connection_closed); this->_schedule_closed_event(); } diff --git a/iocore/net/SSLNetVConnection.cc b/iocore/net/SSLNetVConnection.cc index 33918446f9b..c3a5771f6da 100644 --- a/iocore/net/SSLNetVConnection.cc +++ b/iocore/net/SSLNetVConnection.cc @@ -1013,7 +1013,7 @@ SSLNetVConnection::free(EThread *t) #endif clear(); - SET_CONTINUATION_HANDLER(this, (SSLNetVConnHandler)&SSLNetVConnection::startEvent); + SET_CONTINUATION_HANDLER(this, &SSLNetVConnection::startEvent); ink_assert(con.fd == NO_FD); ink_assert(t == this_ethread()); diff --git a/iocore/net/Socks.cc b/iocore/net/Socks.cc index dbc2a02835a..0ee6f96b937 100644 --- a/iocore/net/Socks.cc +++ b/iocore/net/Socks.cc @@ -195,7 +195,7 @@ SocksEntry::startEvent(int event, void *data) auth_handler = &socks5BasicAuthHandler; } - SET_HANDLER((SocksEntryHandler)&SocksEntry::mainEvent); + SET_HANDLER(&SocksEntry::mainEvent); mainEvent(NET_EVENT_OPEN, data); } else { if (timeout) { diff --git a/iocore/net/UnixNet.cc b/iocore/net/UnixNet.cc index 07a63ea98f8..7b78ed5562f 100644 --- a/iocore/net/UnixNet.cc +++ b/iocore/net/UnixNet.cc @@ -267,7 +267,7 @@ initialize_thread_for_net(EThread *thread) NetHandler::NetHandler() : Continuation(nullptr) { - SET_HANDLER((NetContHandler)&NetHandler::mainNetEvent); + SET_HANDLER(&NetHandler::mainNetEvent); } int diff --git a/iocore/net/UnixNetAccept.cc b/iocore/net/UnixNetAccept.cc index 2de7191c90f..0250d3af49e 100644 --- a/iocore/net/UnixNetAccept.cc +++ b/iocore/net/UnixNetAccept.cc @@ -102,7 +102,7 @@ net_accept(NetAccept *na, void *ep, bool blockable) vc->read.triggered = 1; } #endif - SET_CONTINUATION_HANDLER(vc, (NetVConnHandler)&UnixNetVConnection::acceptEvent); + SET_CONTINUATION_HANDLER(vc, &UnixNetVConnection::acceptEvent); EThread *t; NetHandler *h; @@ -193,7 +193,7 @@ NetAccept::init_accept(EThread *t) return; } - SET_HANDLER((NetAcceptHandler)&NetAccept::acceptEvent); + SET_HANDLER(&NetAccept::acceptEvent); period = -HRTIME_MSECONDS(net_accept_period); t->schedule_every(this, period); } @@ -212,9 +212,9 @@ NetAccept::accept_per_thread(int event, void *ep) } if (accept_fn == net_accept) { - SET_HANDLER((NetAcceptHandler)&NetAccept::acceptFastEvent); + SET_HANDLER(&NetAccept::acceptFastEvent); } else { - SET_HANDLER((NetAcceptHandler)&NetAccept::acceptEvent); + SET_HANDLER(&NetAccept::acceptEvent); } PollDescriptor *pd = get_PollDescriptor(this_ethread()); if (this->ep.start(pd, this, EVENTIO_READ) < 0) { @@ -240,7 +240,7 @@ NetAccept::init_accept_per_thread() } } - SET_HANDLER((NetAcceptHandler)&NetAccept::accept_per_thread); + SET_HANDLER(&NetAccept::accept_per_thread); n = eventProcessor.thread_group[opt.etype]._count; for (i = 0; i < n; i++) { @@ -365,7 +365,7 @@ NetAccept::do_blocking_accept(EThread *t) vc->read.triggered = 1; } #endif - SET_CONTINUATION_HANDLER(vc, (NetVConnHandler)&UnixNetVConnection::acceptEvent); + SET_CONTINUATION_HANDLER(vc, &UnixNetVConnection::acceptEvent); EThread *localt = eventProcessor.assign_thread(opt.etype); NetHandler *h = get_NetHandler(localt); @@ -518,7 +518,7 @@ NetAccept::acceptFastEvent(int event, void *ep) vc->read.triggered = 1; } #endif - SET_CONTINUATION_HANDLER(vc, (NetVConnHandler)&UnixNetVConnection::acceptEvent); + SET_CONTINUATION_HANDLER(vc, &UnixNetVConnection::acceptEvent); EThread *t = e->ethread; NetHandler *h = get_NetHandler(t); diff --git a/iocore/net/UnixNetVConnection.cc b/iocore/net/UnixNetVConnection.cc index 57d12cea2a5..f9b759239cb 100644 --- a/iocore/net/UnixNetVConnection.cc +++ b/iocore/net/UnixNetVConnection.cc @@ -829,7 +829,7 @@ UnixNetVConnection::reenable_re(VIO *vio) UnixNetVConnection::UnixNetVConnection() { - SET_HANDLER((NetVConnHandler)&UnixNetVConnection::startEvent); + SET_HANDLER(&UnixNetVConnection::startEvent); } // Private methods @@ -1027,7 +1027,7 @@ UnixNetVConnection::acceptEvent(int event, Event *e) SCOPED_MUTEX_LOCK(lock2, mutex, t); // Setup a timeout callback handler. - SET_HANDLER((NetVConnHandler)&UnixNetVConnection::mainEvent); + SET_HANDLER(&UnixNetVConnection::mainEvent); // Send this netvc to InactivityCop. nh->startCop(this); @@ -1298,7 +1298,7 @@ UnixNetVConnection::free(EThread *t) con.close(); clear(); - SET_CONTINUATION_HANDLER(this, (NetVConnHandler)&UnixNetVConnection::startEvent); + SET_CONTINUATION_HANDLER(this, &UnixNetVConnection::startEvent); ink_assert(con.fd == NO_FD); ink_assert(t == this_ethread()); diff --git a/iocore/net/UnixUDPNet.cc b/iocore/net/UnixUDPNet.cc index 04ea7899786..8b9be3a9f00 100644 --- a/iocore/net/UnixUDPNet.cc +++ b/iocore/net/UnixUDPNet.cc @@ -1035,14 +1035,14 @@ UDPNetHandler::UDPNetHandler() { nextCheck = Thread::get_hrtime_updated() + HRTIME_MSECONDS(1000); lastCheck = 0; - SET_HANDLER((UDPNetContHandler)&UDPNetHandler::startNetEvent); + SET_HANDLER(&UDPNetHandler::startNetEvent); } int UDPNetHandler::startNetEvent(int event, Event *e) { (void)event; - SET_HANDLER((UDPNetContHandler)&UDPNetHandler::mainNetEvent); + SET_HANDLER(&UDPNetHandler::mainNetEvent); trigger_event = e; e->schedule_every(-HRTIME_MSECONDS(UDP_NH_PERIOD)); return EVENT_CONT; diff --git a/proxy/CacheControl.cc b/proxy/CacheControl.cc index f1ed4e2429f..d2845e6b689 100644 --- a/proxy/CacheControl.cc +++ b/proxy/CacheControl.cc @@ -81,10 +81,7 @@ struct CC_FreerContinuation : public Continuation { delete this; return EVENT_DONE; } - CC_FreerContinuation(CC_table *ap) : Continuation(nullptr), p(ap) - { - SET_HANDLER((CC_FreerContHandler)&CC_FreerContinuation::freeEvent); - } + CC_FreerContinuation(CC_table *ap) : Continuation(nullptr), p(ap) { SET_HANDLER(&CC_FreerContinuation::freeEvent); } }; // struct CC_UpdateContinuation diff --git a/proxy/logging/Log.cc b/proxy/logging/Log.cc index 7c27f14a232..636d171e040 100644 --- a/proxy/logging/Log.cc +++ b/proxy/logging/Log.cc @@ -182,7 +182,7 @@ struct PeriodicWakeup : Continuation { PeriodicWakeup(int preproc_threads, int flush_threads) : Continuation(new_ProxyMutex()), m_preproc_threads(preproc_threads), m_flush_threads(flush_threads) { - SET_HANDLER((PeriodicWakeupHandler)&PeriodicWakeup::wakeup); + SET_HANDLER(&PeriodicWakeup::wakeup); } }; diff --git a/src/traffic_server/SocksProxy.cc b/src/traffic_server/SocksProxy.cc index 62799a04557..0ae9b574ab6 100644 --- a/src/traffic_server/SocksProxy.cc +++ b/src/traffic_server/SocksProxy.cc @@ -149,7 +149,7 @@ SocksProxy::init(NetVConnection *netVC) SCOPED_MUTEX_LOCK(lock, mutex, this_ethread()); - SET_HANDLER(static_cast(&SocksProxy::acceptEvent)); + SET_HANDLER(&SocksProxy::acceptEvent); handleEvent(NET_EVENT_ACCEPT, netVC); } @@ -178,7 +178,7 @@ SocksProxy::acceptEvent(int event, void *data) buf->reset(); - SET_HANDLER(static_cast(&SocksProxy::mainEvent)); + SET_HANDLER(&SocksProxy::mainEvent); vc_handler = &SocksProxy::state_read_client_request; timeout = this_ethread()->schedule_in(this, HRTIME_SECONDS(netProcessor.socks_conf_stuff->socks_timeout)); @@ -694,7 +694,7 @@ struct SocksAccepter : public Continuation { } // There is no state used we dont need a mutex - SocksAccepter() : Continuation(nullptr) { SET_HANDLER((SocksAccepterHandler)&SocksAccepter::mainEvent); } + SocksAccepter() : Continuation(nullptr) { SET_HANDLER(&SocksAccepter::mainEvent); } }; void