fix Warning

This commit is contained in:
berrux-dev committed 2026-10-03 09:20:13 +02:00
1 parent 593c221d23
commit 8345470273
316 files changed
+1246 -929

No files matched your search

@@ -7,6 +7,7 @@
*/
#include "handler_oc_situation_data.h"
#include <utility>
#include <LtsCoordTrans/lts_coord_trans.h>
#include <LtsUtilsCore/qbytearray_byteaccess.h>
@@ -183,7 +184,7 @@ void HandlerOcSituationData::setRequestOcSituationData(OcSituation::SituationCen
if (m_centerEquipmentId > 0)
{
ParticipantManagement::Participant centerParticipant;
for (const auto &participant : qAsConst(m_allParticipants))
for (const auto &participant : std::as_const(m_allParticipants))
{
if (participant.equipmentNumber.is_set() && participant.equipmentNumber.get() == m_centerEquipmentId)
{
@@ -433,7 +434,7 @@ void HandlerOcSituationData::onAesItemViewChanged(const AreaEffectSimulation::Ae
void HandlerOcSituationData::onDusMineStateChanged(const AreaEffectSimulation::DusMineState &/*data*/, DataModification /*modType*/)
{
auto copy = m_dynamicParticpantData;
for (const ParticipantManagement::DynamicParticipantData &dynPartData : qAsConst(copy))
for (const ParticipantManagement::DynamicParticipantData &dynPartData : std::as_const(copy))
{
if (!m_participantWithMaybeMissingPartyId.contains(dynPartData.participantId))
continue;
@@ -528,7 +529,7 @@ void HandlerOcSituationData::fetchParticipantsInRange()
QSet<int> curParticipants;
const QHash<int, ParticipantManagement::Participant> oldParticipants = m_participants;
for (const auto &position : qAsConst(m_allParticipantPositions))
for (const auto &position : std::as_const(m_allParticipantPositions))
{
if (!LtsUtils::isPositionTimeOutdated(m_partitionTime, position.sampleTime)) // only if position is not outdated
{
@@ -562,7 +563,7 @@ void HandlerOcSituationData::fetchParticipantsInRange()
DEBUG_LOG(m_logger) << "Participant in range equipment number: " << participant.equipmentNumber.get()
<< " pos: " << relPartPos.x() << "/" << relPartPos.y()
<< " distance: " << std::sqrt(distanceSqr) << " distanceSqr: " << distanceSqr;
curParticipantsInRange.insertMulti(distanceSqr, participant.id);
curParticipantsInRange.insert(distanceSqr, participant.id);
}
}
m_participantOverloaded = quint32(curParticipantsInRange.count()) > Settings::maxParticipantsInSituation();
@@ -645,7 +646,7 @@ QVector<QPair<int, float>> HandlerOcSituationData::createPrioQueue() const
QVector<QPair<int, float>> participantsPrioQueue;
participantsPrioQueue.reserve(m_participantsToSend.size());
for (auto participantId : qAsConst(m_participantsToSend))
for (auto participantId : std::as_const(m_participantsToSend))
{
// ignore (currently) outdated players
if (m_outdatedParticipants.contains(participantId))
@@ -691,7 +692,7 @@ QByteArray HandlerOcSituationData::createDataStream(int maxSize,
// first: participants that are not in range any more
DEBUG_LOG(m_logger) << "m_newlyOutdatedParticipants: " << m_newlyOutdatedParticipants.size();
QSet<int> copyOfOutdated = m_newlyOutdatedParticipants;
for (const auto participantId : qAsConst(m_newlyOutdatedParticipants))
for (const auto participantId : std::as_const(m_newlyOutdatedParticipants))
{
addParticipantId(ret, participantId, OcSituation::ModificationFlag::eNone);
copyOfOutdated.remove(participantId);
@@ -909,6 +910,7 @@ void HandlerOcSituationData::addVBG(QByteArray &buf, const ParticipantManagement
case ProjectDataManagement::StateChangeOriginator::StateChangeOriginator_MedicalTimeout:
// not yet used
break;
default: break;
}
LtsUtils::set1Byte(injuryPartyId, buf);