chore: Enable clang-tidy v21 new checks (#7031)

This commit is contained in:
Alex Kremer
2026-04-29 16:17:35 +01:00
committed by GitHub
parent 46b997b774
commit f7275b7ad9
259 changed files with 2193 additions and 1888 deletions

View File

@@ -4025,7 +4025,7 @@ private:
ChainStateTrack b_;
};
enum SmState {
enum class SmState {
st_initial,
st_claim_id_created,
st_attesting,
@@ -4034,8 +4034,6 @@ private:
st_closed,
};
enum Act_Flags { af_a2b = 1 << 0 };
// --------------------------------------------------
template <class T>
class SmBase
@@ -4169,7 +4167,7 @@ private:
st.spend(dstDoor(), reward, num_attestors);
st.transfer(dstDoor(), cr.to, cr.amt);
st.env.env_.memoize(cr.to);
sm_state = st_completed;
sm_state = SmState::st_completed;
};
counters.create_callbacks[cr.claim_id - 1] = std::move(complete_cb);
@@ -4180,12 +4178,12 @@ private:
{
switch (sm_state)
{
case st_initial:
case SmState::st_initial:
cr.claim_id = issue_account_create();
sm_state = st_attesting;
sm_state = SmState::st_attesting;
break;
case st_attesting:
case SmState::st_attesting:
attest(time, rnd);
break;
@@ -4193,14 +4191,14 @@ private:
assert(0);
break;
case st_completed:
case SmState::st_completed:
break; // will get this once
}
return sm_state;
}
private:
SmState sm_state{st_initial};
SmState sm_state{SmState::st_initial};
AccountCreate cr;
};
@@ -4329,35 +4327,36 @@ private:
{
switch (sm_state)
{
case st_initial:
case SmState::st_initial:
xfer.claim_id = create_claim_id();
sm_state = st_claim_id_created;
sm_state = SmState::st_claim_id_created;
break;
case st_claim_id_created:
case SmState::st_claim_id_created:
commit();
sm_state = st_attesting;
sm_state = SmState::st_attesting;
break;
case st_attesting:
case SmState::st_attesting:
if (attest(time, rnd))
{
sm_state = xfer.with_claim == WithClaim::yes ? st_attested : st_completed;
sm_state = xfer.with_claim == WithClaim::yes ? SmState::st_attested
: SmState::st_completed;
}
else
{
sm_state = st_attesting;
sm_state = SmState::st_attesting;
}
break;
case st_attested:
case SmState::st_attested:
assert(xfer.with_claim == WithClaim::yes);
claim();
sm_state = st_completed;
sm_state = SmState::st_completed;
break;
default:
case st_completed:
case SmState::st_completed:
assert(0); // should have been removed
break;
}
@@ -4366,7 +4365,7 @@ private:
private:
Transfer xfer;
SmState sm_state{st_initial};
SmState sm_state{SmState::st_initial};
};
// --------------------------------------------------
@@ -4413,7 +4412,7 @@ public:
return sm.advance(time, rnd);
};
auto& [t, sm] = *it;
if (t <= time && std::visit(vis, sm) == st_completed)
if (t <= time && std::visit(vis, sm) == SmState::st_completed)
{
it = sm_.erase(it);
}