Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resolved signed/unsigned warnings #31

Merged
merged 1 commit into from
Nov 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions UnitTests/IntegrationTests_DoasFit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ TEST_CASE("DoasFit - IntegrationTest with good scan - scan file 1", "[DoasFit][I
// Change the settings to use HP500 filtering and make sure to filter the references
// (but keep the unit in molec/cm2 as this makes it possible to have the same values in the assertions here as in the test above).
so2FitWindow.fitType = FIT_TYPE::FIT_HP_DIV;
for (int refIdx = 0; refIdx < so2FitWindow.nRef; ++refIdx)
for (size_t refIdx = 0; refIdx < so2FitWindow.nRef; ++refIdx)
{
HighPassFilter(*so2FitWindow.ref[refIdx].m_data, CrossSectionUnit::cm2_molecule);
}
Expand Down Expand Up @@ -119,7 +119,7 @@ TEST_CASE("DoasFit - IntegrationTest with good scan - scan file 1", "[DoasFit][I
// Change the settings to use HP500 filtering and make sure to filter the references
// (but keep the unit in molec/cm2 as this makes it possible to have the same values in the assertions here as in the test above).
so2FitWindow.fitType = FIT_TYPE::FIT_HP_SUB;
for (int refIdx = 0; refIdx < so2FitWindow.nRef; ++refIdx)
for (size_t refIdx = 0; refIdx < so2FitWindow.nRef; ++refIdx)
{
HighPassFilter(*so2FitWindow.ref[refIdx].m_data, novac::CrossSectionUnit::cm2_molecule);
}
Expand Down
4 changes: 2 additions & 2 deletions UnitTests/IntegrationTests_EvaluationBase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ TEST_CASE("Evaluate Avaspec spectrum number eight in scan", "[Evaluate][Evaluati
// Assert
REQUIRE(returnCode == 0);

REQUIRE(window.nRef == int(sut.m_result.m_referenceResult.size()));
REQUIRE(window.nRef == sut.m_result.m_referenceResult.size());

REQUIRE(sut.m_result.m_delta == Approx(0.0752).margin(0.001));
REQUIRE(sut.m_result.m_chiSquare == Approx(0.0119).margin(0.001));
Expand Down Expand Up @@ -145,7 +145,7 @@ TEST_CASE("Evaluate Avaspec spectrum number 21 in scan", "[Evaluate][EvaluationB
// Assert
REQUIRE(returnCode == 0);

REQUIRE(window.nRef == int(sut.m_result.m_referenceResult.size()));
REQUIRE(window.nRef == sut.m_result.m_referenceResult.size());

REQUIRE(sut.m_result.m_delta == Approx(0.0429).margin(0.001));
REQUIRE(sut.m_result.m_chiSquare == Approx(0.0066).margin(0.001));
Expand Down
4 changes: 2 additions & 2 deletions UnitTests/IntegrationTests_RatioEvaluation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,11 +80,11 @@ TEST_CASE("RatioEvaluation - IntegrationTest with good scan - scan file 1", "[Ra
// (but keep the unit in molec/cm2 as this makes it possible to have the same values in the assertions here as in the test above).
so2FitWindow.fitType = FIT_TYPE::FIT_HP_DIV;
broFitWindow.fitType = FIT_TYPE::FIT_HP_DIV;
for (int refIdx = 0; refIdx < so2FitWindow.nRef; ++refIdx)
for (size_t refIdx = 0; refIdx < so2FitWindow.nRef; ++refIdx)
{
HighPassFilter(*so2FitWindow.ref[refIdx].m_data, novac::CrossSectionUnit::cm2_molecule);
}
for (int refIdx = 0; refIdx < broFitWindow.nRef; ++refIdx)
for (size_t refIdx = 0; refIdx < broFitWindow.nRef; ++refIdx)
{
HighPassFilter(*broFitWindow.ref[refIdx].m_data, novac::CrossSectionUnit::cm2_molecule);
}
Expand Down
4 changes: 2 additions & 2 deletions src/Evaluation/RatioEvaluation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -88,11 +88,11 @@ void AddRingSpectraAsReferences(CFitWindow& localSO2FitWindow, const std::vector

int FindReferenceIndex(const CFitWindow& window, const std::string& nameToFind)
{
for (int ii = 0; ii < window.nRef; ++ii)
for (size_t ii = 0; ii < window.nRef; ++ii)
{
if (EqualsIgnoringCase(window.ref[ii].m_specieName, nameToFind))
{
return ii;
return static_cast<int>(ii);
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/Evaluation/ScanEvaluationBase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,7 @@ CEvaluationBase* ScanEvaluationBase::FindOptimumShiftAndSqueezeFromFraunhoferRef
CFitWindow improvedFitWindow = fitWindow;

// The fit is good enough to use the values
for (int it = 0; it < improvedFitWindow.nRef; ++it)
for (size_t it = 0; it < improvedFitWindow.nRef; ++it)
{
improvedFitWindow.ref[it].m_shiftOption = SHIFT_TYPE::SHIFT_FIX;
improvedFitWindow.ref[it].m_squeezeOption = SHIFT_TYPE::SHIFT_FIX;
Expand Down
2 changes: 1 addition & 1 deletion src/File/FitWindowFileHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ bool CFitWindowFileHandler::WriteFitWindow(const novac::CFitWindow& window, cons

fprintf(f, "%s<nRef>%zd</nRef>\n", indent.c_str(), window.nRef);

for (int i = 0; i < window.nRef; ++i)
for (size_t i = 0; i < window.nRef; ++i)
{
fprintf(f, "%s<ref name=\"%s\">\n", indent.c_str(), window.ref[i].m_specieName.c_str());
fprintf(f, "%s\t<path>%s</path>\n", indent.c_str(), window.ref[i].m_path.c_str());
Expand Down
4 changes: 2 additions & 2 deletions src/Flux/Flux.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ double CalculateFluxConicalScanner(const double* scanAngle, const double* column
}

// Now make the actual flux-calculation
for (int i = 0; i < nDataPoints - 2; ++i)
for (size_t i = 0; i < nDataPoints - 2; ++i)
{
if (std::abs(std::abs(alpha[i]) - HALF_PI) < 1e-2 || std::abs(std::abs(alpha[i + 1]) - HALF_PI) < 1e-2)
{
Expand Down Expand Up @@ -192,7 +192,7 @@ double CalculateFluxHeidelbergScanner(const double* scanAngle1, const double* sc

// Now make the actual flux-calculation
/*TODO: flux calculations for Heidelberg instrument differ from Gothenborg instrument because local and global coordinate system do not differ!!!! Define another loop for Heidelberg?*/
for (int i = 0; i < nDataPoints - 2; ++i)
for (size_t i = 0; i < nDataPoints - 2; ++i)
{
if (std::abs(std::abs(elev[i]) - HALF_PI) < 1e-2 || std::abs(std::abs(elev[i + 1]) - HALF_PI) < 1e-2)
continue;// This algorithm does not work very well for scanangles around +-90 degrees
Expand Down
4 changes: 2 additions & 2 deletions src/Flux/PlumeInScanProperty.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,7 @@ bool CalculatePlumeCompleteness(

// Calculate the average of the 'nDataPointsToAverage' left-most values
double avgLeft = 0.0;
int nAverage = 0;
size_t nAverage = 0;
for (size_t k = 0; k < numPoints; ++k)
{
if (!badEvaluation[k])
Expand Down Expand Up @@ -485,7 +485,7 @@ bool CalculatePlumeCompleteness(

// Find the maximum offsetCorrectedColumn value
double maxColumn = 0.0;
for (int k = 0; k < numPoints; ++k)
for (size_t k = 0; k < numPoints; ++k)
{
if (!badEvaluation[k])
{
Expand Down
Loading