Skip to content

Commit

Permalink
lib/staging/slac: avoid warnings by using modern iterator
Browse files Browse the repository at this point in the history
Signed-off-by: Moritz Barsnick <[email protected]>
  • Loading branch information
barsnick committed Jun 17, 2024
1 parent 7af9470 commit 2e122a8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions lib/staging/slac/fsm/ev/src/states/others.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ void InitSlacState::enter() {
std::mt19937 rng(rnd_dev());
std::uniform_int_distribution<std::mt19937::result_type> dist256(0, 255);

for (auto i = 0; i < sizeof(run_id); ++i) {
run_id[i] = dist256(rng);
for (auto& id : this->run_id) {
id = dist256(rng);
}
}

Expand Down
4 changes: 2 additions & 2 deletions lib/staging/slac/fsm/ev/src/states/sounding.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,8 @@ bool SoundingState::do_sounding() {
std::mt19937 rng(rnd_dev());
std::uniform_int_distribution<std::mt19937::result_type> dist256(0, 255);

for (auto i = 0; i < sizeof(msg.random); ++i) {
msg.random[i] = dist256(rng);
for (auto& random : msg.random) {
random = dist256(rng);
}

ctx.send_slac_message(session_parameters.evse_mac, msg);
Expand Down

0 comments on commit 2e122a8

Please sign in to comment.