clangtidy corrections part 2

This commit is contained in:
2023-10-12 00:44:27 +02:00
parent 23d854a826
commit a43e2db92b
41 changed files with 2274 additions and 2485 deletions
+22 -20
View File
@@ -12,8 +12,8 @@
#include "calibrateCompass.h"
CalibrateCompass::CalibrateCompass(QMC5883LCompass *compass)
: compass{compass}
{
this->compass = compass;
this->state = State::Ready;
this->clearData();
this->activateOnlyChilds();
@@ -29,9 +29,9 @@ void CalibrateCompass::runAsChild()
bool changed = false;
this->compass->read();
int xAxis = this->compass->getX();
int yAxis = this->compass->getY();
int zAxis = this->compass->getZ();
const int xAxis = this->compass->getX();
const int yAxis = this->compass->getY();
const int zAxis = this->compass->getZ();
if (xAxis < this->data.data[0][0])
{
@@ -70,7 +70,9 @@ void CalibrateCompass::runAsChild()
}
if (changed)
{
this->lastChange = millis();
}
if (millis() - this->lastChange > this->maxTimeWithoutChange)
{
@@ -182,23 +184,23 @@ void CalibrateCompass::checkDataValidity()
sum += this->data.data[i][0];
sum += this->data.data[i][1];
}
this->dataValid = sum;
this->dataValid = static_cast<bool>(sum);
}
std::ostream &operator<<(std::ostream &os, const CalibrateCompass &caliComp)
std::ostream &operator<<(std::ostream &stream, const CalibrateCompass &caliComp)
{
os << "(";
os << caliComp.data.data[0][0];
os << ", ";
os << caliComp.data.data[0][1];
os << ", ";
os << caliComp.data.data[1][0];
os << ", ";
os << caliComp.data.data[1][1];
os << ", ";
os << caliComp.data.data[2][0];
os << ", ";
os << caliComp.data.data[2][1];
os << ")";
return os;
stream << "(";
stream << caliComp.data.data[0][0];
stream << ", ";
stream << caliComp.data.data[0][1];
stream << ", ";
stream << caliComp.data.data[1][0];
stream << ", ";
stream << caliComp.data.data[1][1];
stream << ", ";
stream << caliComp.data.data[2][0];
stream << ", ";
stream << caliComp.data.data[2][1];
stream << ")";
return stream;
}