Modernize [[maybe_unused]] attribute

pull/1557/head
Jason Rhinelander 3 years ago
parent 4b5387a078
commit 89b582bf60

@ -17,7 +17,7 @@ namespace llarp
uint64_t relayOrder,
const Key_t& addr,
AbstractContext* ctx,
__attribute__((unused)) const Key_t& askpeer)
[[maybe_unused]] const Key_t& askpeer)
: ServiceAddressLookup(TXOwner{ctx->OurKey(), txid}, addr, ctx, relayOrder, nullptr)
, localPath(pathid)
{}

@ -19,7 +19,7 @@ namespace llarp
uint64_t relayOrder,
const Key_t& addr,
AbstractContext* ctx,
__attribute__((unused)) const Key_t& askpeer);
[[maybe_unused]] const Key_t& askpeer);
void
SendReply() override;

@ -63,7 +63,7 @@ namespace llarp
bool
RelayedGotIntroMessage::HandleMessage(
llarp_dht_context* ctx,
__attribute__((unused)) std::vector<std::unique_ptr<IMessage>>& replies) const
[[maybe_unused]] std::vector<std::unique_ptr<IMessage>>& replies) const
{
// TODO: implement me better?
auto pathset = ctx->impl->GetRouter()->pathContext().GetLocalPathSet(pathID);

@ -82,7 +82,7 @@ namespace llarp
bool
GotRouterMessage::HandleMessage(
llarp_dht_context* ctx,
__attribute__((unused)) std::vector<std::unique_ptr<IMessage>>& replies) const
[[maybe_unused]] std::vector<std::unique_ptr<IMessage>>& replies) const
{
auto& dht = *ctx->impl;
if (relayed)

@ -189,7 +189,7 @@ namespace llarp
/// return true if we should publish a new hidden service descriptor
virtual bool
ShouldPublishDescriptors(__attribute__((unused)) llarp_time_t now) const
ShouldPublishDescriptors([[maybe_unused]] llarp_time_t now) const
{
return false;
}

@ -279,8 +279,8 @@ namespace llarp
bool
TransitHop::HandlePathConfirmMessage(
__attribute__((unused)) const llarp::routing::PathConfirmMessage& msg,
__attribute__((unused)) AbstractRouter* r)
[[maybe_unused]] const llarp::routing::PathConfirmMessage& msg,
[[maybe_unused]] AbstractRouter* r)
{
llarp::LogWarn("unwarranted path confirm message on ", info);
return false;
@ -288,8 +288,8 @@ namespace llarp
bool
TransitHop::HandleDataDiscardMessage(
__attribute__((unused)) const llarp::routing::DataDiscardMessage& msg,
__attribute__((unused)) AbstractRouter* r)
[[maybe_unused]] const llarp::routing::DataDiscardMessage& msg,
[[maybe_unused]] AbstractRouter* r)
{
llarp::LogWarn("unwarranted path data discard message on ", info);
return false;

Loading…
Cancel
Save