Refactor: replace qAsConst with std::as_const across TetraIF; reduce compiler deprecation warnings
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
1 parent
dfdc6e299d
commit
3904b43cf8
10 files changed
+15
-15
No files matched your search
@@ -483,7 +483,7 @@ static CoPrtCnvRadioTelegram *convertToRadioInternal(T *a_telegram)
|
|||||||
radioTelegram->setPayloadData((uint8_t) 0);
|
radioTelegram->setPayloadData((uint8_t) 0);
|
||||||
|
|
||||||
radioTelegram->setPayloadData(tele.mhPoints.size(), 1);
|
radioTelegram->setPayloadData(tele.mhPoints.size(), 1);
|
||||||
for(auto pos : qAsConst(tele.mhPoints))
|
for(auto pos : std::as_const(tele.mhPoints))
|
||||||
{
|
{
|
||||||
radioTelegram->setPayloadData(pos.offsetY, 3);
|
radioTelegram->setPayloadData(pos.offsetY, 3);
|
||||||
radioTelegram->setPayloadData(pos.offsetX, 3);
|
radioTelegram->setPayloadData(pos.offsetX, 3);
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ LogViewField::LogViewField(const QString& a_name, const E_FieldKind a_kind, cons
|
|||||||
|
|
||||||
LogViewField::~LogViewField()
|
LogViewField::~LogViewField()
|
||||||
{
|
{
|
||||||
for (LogViewField *f : qAsConst(m_Child))
|
for (LogViewField *f : std::as_const(m_Child))
|
||||||
delete f;
|
delete f;
|
||||||
if (m_bDeleteXdr)
|
if (m_bDeleteXdr)
|
||||||
delete m_XdrElement;
|
delete m_XdrElement;
|
||||||
|
|||||||
@@ -232,7 +232,7 @@ void LogViewTelegramDialog::fillTelegram(LogViewTelegram *a_telegram)
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
for (const auto ptr : qAsConst(m_EditInfoList))
|
for (const auto ptr : std::as_const(m_EditInfoList))
|
||||||
{
|
{
|
||||||
if (!ptr->isValid())
|
if (!ptr->isValid())
|
||||||
{
|
{
|
||||||
@@ -245,7 +245,7 @@ void LogViewTelegramDialog::fillTelegram(LogViewTelegram *a_telegram)
|
|||||||
|
|
||||||
a_telegram->resetOffset();
|
a_telegram->resetOffset();
|
||||||
a_telegram->clearJsonData();
|
a_telegram->clearJsonData();
|
||||||
for (auto ptr : qAsConst(m_EditInfoList))
|
for (auto ptr : std::as_const(m_EditInfoList))
|
||||||
{
|
{
|
||||||
if (!ptr->saveContent(a_telegram))
|
if (!ptr->saveContent(a_telegram))
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -231,7 +231,7 @@ int LogViewTetraTelegramsParser::parseStruct(const QVector<QStringRef> &lines, i
|
|||||||
if (mi.isEnum && !mi.type.contains(QLatin1String("::")))
|
if (mi.isEnum && !mi.type.contains(QLatin1String("::")))
|
||||||
{
|
{
|
||||||
|
|
||||||
for (const auto &ei : qAsConst(m_enums))
|
for (const auto &ei : std::as_const(m_enums))
|
||||||
{
|
{
|
||||||
if (ei.type == mi.type)
|
if (ei.type == mi.type)
|
||||||
{
|
{
|
||||||
@@ -334,7 +334,7 @@ int LogViewTetraTelegramsParser::parseEnum(const QVector<QStringRef> &lines, int
|
|||||||
}
|
}
|
||||||
|
|
||||||
DEBUG_LOG(m_logger) << "Found Enum: " << ei.type;
|
DEBUG_LOG(m_logger) << "Found Enum: " << ei.type;
|
||||||
for (const EnumValue &ev : qAsConst(ei.values))
|
for (const EnumValue &ev : std::as_const(ei.values))
|
||||||
DEBUG_LOG(m_logger) << "Member[" << i << "]: " << ev.key << " = " << ev.value;
|
DEBUG_LOG(m_logger) << "Member[" << i << "]: " << ev.key << " = " << ev.value;
|
||||||
|
|
||||||
if (ei.type == QLatin1String("TelegramId"))
|
if (ei.type == QLatin1String("TelegramId"))
|
||||||
@@ -391,7 +391,7 @@ int LogViewTetraTelegramsParser::parseConstraint(const QVector<QStringRef> &line
|
|||||||
if (enumKey.endsWith(QLatin1Char(';')))
|
if (enumKey.endsWith(QLatin1Char(';')))
|
||||||
enumKey.chop(1);
|
enumKey.chop(1);
|
||||||
bool bFound = false;
|
bool bFound = false;
|
||||||
for (const auto &v : qAsConst(m_telegramIdEnum.values))
|
for (const auto &v : std::as_const(m_telegramIdEnum.values))
|
||||||
{
|
{
|
||||||
if (v.key == enumKey)
|
if (v.key == enumKey)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -551,7 +551,7 @@ void LogViewXdrParser::parseUnion(const QString& a_line)
|
|||||||
|
|
||||||
if (!isNextWord(";")) return;
|
if (!isNextWord(";")) return;
|
||||||
|
|
||||||
for (const QString &constExpr : qAsConst(constExprList))
|
for (const QString &constExpr : std::as_const(constExprList))
|
||||||
{
|
{
|
||||||
bool error;
|
bool error;
|
||||||
int32_t telegramId = static_cast<int>(telegramIdType->getChildValue(constExpr, &error));
|
int32_t telegramId = static_cast<int>(telegramIdType->getChildValue(constExpr, &error));
|
||||||
|
|||||||
@@ -357,7 +357,7 @@ void TetraIF::onSendData()
|
|||||||
static char s_randomChar = 0;
|
static char s_randomChar = 0;
|
||||||
for (int i = 0; i < telegramsToSendNow; ++i)
|
for (int i = 0; i < telegramsToSendNow; ++i)
|
||||||
{
|
{
|
||||||
for (unsigned short dest_issi : qAsConst(m_issiList))
|
for (unsigned short dest_issi : std::as_const(m_issiList))
|
||||||
{
|
{
|
||||||
|
|
||||||
m_data[0] = s_randomChar++;
|
m_data[0] = s_randomChar++;
|
||||||
@@ -406,7 +406,7 @@ void TetraIF::parseISSIs(const QStringList &issiList)
|
|||||||
QString TetraIF::getIssisAsString() const
|
QString TetraIF::getIssisAsString() const
|
||||||
{
|
{
|
||||||
QString ret;
|
QString ret;
|
||||||
for (unsigned short issi : qAsConst(m_issiList))
|
for (unsigned short issi : std::as_const(m_issiList))
|
||||||
ret += QString::number(issi) + QLatin1String(", ");
|
ret += QString::number(issi) + QLatin1String(", ");
|
||||||
return ret.left(ret.size() - 2);
|
return ret.left(ret.size() - 2);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -326,7 +326,7 @@ int MainWindow::auswerten()
|
|||||||
int fehlcount = 0;
|
int fehlcount = 0;
|
||||||
QVector<uint> numList;
|
QVector<uint> numList;
|
||||||
int i = 0;
|
int i = 0;
|
||||||
for (const QString &issi : qAsConst(issis))
|
for (const QString &issi : std::as_const(issis))
|
||||||
{
|
{
|
||||||
|
|
||||||
numList.clear();
|
numList.clear();
|
||||||
|
|||||||
@@ -542,7 +542,7 @@ std::shared_ptr<N_CoPrtCnv::CoPrtCnvRadioTelegram> PrtCnvBroadcastMgr::createAcc
|
|||||||
auto tele(std::make_shared<N_CoPrtCnv::CoPrtCnvRadioTelegram>(GEF_REAKTIVIERUNG_DUS_MINE, 5 + 2 + sizeof(uint16_t) * idsToSendNow, 0));
|
auto tele(std::make_shared<N_CoPrtCnv::CoPrtCnvRadioTelegram>(GEF_REAKTIVIERUNG_DUS_MINE, 5 + 2 + sizeof(uint16_t) * idsToSendNow, 0));
|
||||||
tele->setPayload2Byte(curBcIndex);
|
tele->setPayload2Byte(curBcIndex);
|
||||||
tele->setPayload2Byte(idsToSendNow);
|
tele->setPayload2Byte(idsToSendNow);
|
||||||
for (int dusMineId : qAsConst(m_activatedDusMines))
|
for (int dusMineId : std::as_const(m_activatedDusMines))
|
||||||
tele->setPayload2Byte(dusMineId);
|
tele->setPayload2Byte(dusMineId);
|
||||||
|
|
||||||
return tele;
|
return tele;
|
||||||
@@ -1131,7 +1131,7 @@ void PrtCnvBroadcastMgr::reactivateDusMine(const std::shared_ptr<N_CoPrtCnv::CoP
|
|||||||
if (0 == nbrOfMines)
|
if (0 == nbrOfMines)
|
||||||
{
|
{
|
||||||
|
|
||||||
for (int dusMineId : qAsConst(m_deactivatedBcIndex2DusMine))
|
for (int dusMineId : std::as_const(m_deactivatedBcIndex2DusMine))
|
||||||
{
|
{
|
||||||
removeDusMineDeactivationFromBroadcastMap(dusMineId);
|
removeDusMineDeactivationFromBroadcastMap(dusMineId);
|
||||||
addToActivatedDusMine(dusMineId);
|
addToActivatedDusMine(dusMineId);
|
||||||
|
|||||||
@@ -371,7 +371,7 @@ void PrtCnvSocketThread::readHostAdresses()
|
|||||||
continue;
|
continue;
|
||||||
m_hostAdresses.push_back(qMakePair(host, port));
|
m_hostAdresses.push_back(qMakePair(host, port));
|
||||||
}
|
}
|
||||||
for (const auto &p : qAsConst(m_hostAdresses)) {
|
for (const auto &p : std::as_const(m_hostAdresses)) {
|
||||||
INFO_LOG(m_logger) << "Read Host Adress " << p.first
|
INFO_LOG(m_logger) << "Read Host Adress " << p.first
|
||||||
<< ":" << p.second
|
<< ":" << p.second
|
||||||
<< " from settings";
|
<< " from settings";
|
||||||
|
|||||||
@@ -327,7 +327,7 @@ void TTWorker::sendTaktischerStatus(uint32_t eqId, uint32_t issi, TrainingAreaBa
|
|||||||
tele.tasVulnerabilityKindId = 459008;
|
tele.tasVulnerabilityKindId = 459008;
|
||||||
tele.vulnerabilityBits = 0;
|
tele.vulnerabilityBits = 0;
|
||||||
|
|
||||||
for (Player *p : qAsConst(m_playerList))
|
for (Player *p : std::as_const(m_playerList))
|
||||||
{
|
{
|
||||||
if (p->eqId == eqId)
|
if (p->eqId == eqId)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in new issue
Block a user