17
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-10-17 16:49:21 +02:00

refactor(sonar): use std::array for local fixed-size arrays (cpp:S5945)

Arrays that are class members or part of headers are left unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
jerrrrycho
2026-10-10 17:44:14 +02:00
parent 312ba58ffa
commit 43fcda05a0
12 changed files with 74 additions and 74 deletions

View File

@@ -145,7 +145,7 @@ void motiontelemetry::update()
rot *= -1;
}
float buffer[12] = { 0 };
std::array<float, 12> buffer{};
buffer[0] = static_cast<float>(Timer::GetTime());
buffer[1] = static_cast<float>(velocity);
buffer[2] = static_cast<float>(local_acc.y);
@@ -157,6 +157,6 @@ void motiontelemetry::update()
buffer[8] = static_cast<float>(yaw_vel);
buffer[9] = 1.0f;
if (send(sock, (char*)buffer, sizeof(buffer), 0) == -1)
if (send(sock, reinterpret_cast<char const *>(buffer.data()), sizeof(buffer), 0) == -1)
WriteLog("motiontelemetry: socket send failed");
}