Fix std::min type ambiguity

This commit is contained in:
Alejandro Martinez
2024-01-13 16:17:24 -03:00
parent c14891aba0
commit 153e83fa1d
3 changed files with 3 additions and 3 deletions

View File

@@ -210,7 +210,7 @@ RideMapWindow::showPosition(double mins)
long secs = mins * 60;
int idx = secs / 5;
idx = std::max(idx, 0);
idx = std::min(idx, positionItems.length() - 1);
idx = std::min(idx, (int)positionItems.length() - 1);
PositionItem positionItem = positionItems.at(idx);
view->page()->runJavaScript(QString("setPosMarker(%1, %2);").arg(positionItem.lat).arg(positionItem.lng));
}

View File

@@ -58,7 +58,7 @@ MeasuresCsvImport::getMeasures(MeasuresGroup *measuresGroup, QString &error, QDa
emit downloadStarted(100);
int fieldCount = std::min(measuresGroup->getFieldSymbols().count(), MAX_MEASURES);
int fieldCount = std::min((int)measuresGroup->getFieldSymbols().count(), MAX_MEASURES);
// get all lines considering both LF and CR endings
QStringList lines = QString(file.readAll()).split(QRegularExpression("[\n\r]"));

View File

@@ -64,7 +64,7 @@ class VDOT : public RideMetric {
// search for max VDOT from 4 min to 4 hr
vdot = 0.0;
int iMax = std::min(rfc.meanMaxArray(RideFile::kph).size(), 14400);
int iMax = std::min((int)rfc.meanMaxArray(RideFile::kph).size(), 14400);
for (int i = 240; i < iMax; i++) {
double vel = rfc.meanMaxArray(RideFile::kph)[i]*1000.0/60.0;
vdot = std::max(vdot, VDOTCalculator::vdot(i / 60.0, vel));