From 03481750724aa75f662f29ee5a4c428a2b64383f Mon Sep 17 00:00:00 2001 From: payetvin <113102157+payetvin@users.noreply.github.com> Date: Thu, 27 Jun 2024 00:16:20 +0200 Subject: [PATCH] Remove some compile warnings (#2199) --- src/libs/antares/study/area/area.cpp | 3 +-- .../study/include/antares/study/parameters.h | 3 +-- .../antares/study/parts/hydro/container.h | 2 +- src/libs/antares/study/load.cpp | 2 +- src/libs/antares/study/parameters.cpp | 3 +-- src/libs/antares/study/parts/hydro/container.cpp | 2 +- .../study/parts/hydro/finalLevelValidator.cpp | 16 ++++++++-------- .../study/parameters/parameters-tests.cpp | 4 ++-- 8 files changed, 16 insertions(+), 19 deletions(-) diff --git a/src/libs/antares/study/area/area.cpp b/src/libs/antares/study/area/area.cpp index da99f973ae..929e8653c2 100644 --- a/src/libs/antares/study/area/area.cpp +++ b/src/libs/antares/study/area/area.cpp @@ -46,8 +46,7 @@ void Area::internalInitialize() Area::Area(): reserves(fhrMax, HOURS_PER_YEAR), - miscGen(fhhMax, HOURS_PER_YEAR), - hydro(*this) + miscGen(fhhMax, HOURS_PER_YEAR) { internalInitialize(); } diff --git a/src/libs/antares/study/include/antares/study/parameters.h b/src/libs/antares/study/include/antares/study/parameters.h index 791e20f865..73ba5b5f77 100644 --- a/src/libs/antares/study/include/antares/study/parameters.h +++ b/src/libs/antares/study/include/antares/study/parameters.h @@ -76,8 +76,7 @@ class Parameters final ** \return True if the settings have been loaded, false if at least one error has occured */ bool loadFromFile(const AnyString& filename, - const StudyVersion& version, - const StudyLoadOptions& options); + const StudyVersion& version); /*! ** \brief Prepare all settings for a simulation diff --git a/src/libs/antares/study/include/antares/study/parts/hydro/container.h b/src/libs/antares/study/include/antares/study/parts/hydro/container.h index e09970b79c..6748c830e7 100644 --- a/src/libs/antares/study/include/antares/study/parts/hydro/container.h +++ b/src/libs/antares/study/include/antares/study/parts/hydro/container.h @@ -81,7 +81,7 @@ class PartHydro /*! ** \brief Default Constructor */ - PartHydro(const Data::Area& area); + PartHydro(); //! Destructor ~PartHydro(); diff --git a/src/libs/antares/study/load.cpp b/src/libs/antares/study/load.cpp index 4175bc2305..749d0d81ff 100644 --- a/src/libs/antares/study/load.cpp +++ b/src/libs/antares/study/load.cpp @@ -83,7 +83,7 @@ bool Study::internalLoadIni(const String& path, const StudyLoadOptions& options) } // Load the general data buffer.clear() << folderSettings << SEP << "generaldata.ini"; - bool errorWhileLoading = !parameters.loadFromFile(buffer, header.version, options); + bool errorWhileLoading = !parameters.loadFromFile(buffer, header.version); parameters.validateOptions(options); diff --git a/src/libs/antares/study/parameters.cpp b/src/libs/antares/study/parameters.cpp index 7337b9c8b0..dbfb7f81e2 100644 --- a/src/libs/antares/study/parameters.cpp +++ b/src/libs/antares/study/parameters.cpp @@ -1958,8 +1958,7 @@ void Parameters::saveToINI(IniFile& ini) const } bool Parameters::loadFromFile(const AnyString& filename, - const StudyVersion& version, - const StudyLoadOptions& options) + const StudyVersion& version) { // Loading the INI file IniFile ini; diff --git a/src/libs/antares/study/parts/hydro/container.cpp b/src/libs/antares/study/parts/hydro/container.cpp index c9dc476de5..e09ae5a8fb 100644 --- a/src/libs/antares/study/parts/hydro/container.cpp +++ b/src/libs/antares/study/parts/hydro/container.cpp @@ -32,7 +32,7 @@ using namespace Yuni; namespace Antares::Data { -PartHydro::PartHydro(const Data::Area& area) : +PartHydro::PartHydro() : interDailyBreakdown(0.), intraDailyModulation(2.), intermonthlyBreakdown(0), diff --git a/src/libs/antares/study/parts/hydro/finalLevelValidator.cpp b/src/libs/antares/study/parts/hydro/finalLevelValidator.cpp index 2229f75f97..c3ea96ca08 100644 --- a/src/libs/antares/study/parts/hydro/finalLevelValidator.cpp +++ b/src/libs/antares/study/parts/hydro/finalLevelValidator.cpp @@ -37,15 +37,15 @@ FinalLevelValidator::FinalLevelValidator(PartHydro& hydro, double finalLevel, const unsigned int year, const unsigned int lastSimulationDay, - const unsigned int firstMonthOfSimulation) - : hydro_(hydro), - areaName_(areaName), - areaIndex_(areaIndex), - initialLevel_(initialLevel), - finalLevel_(finalLevel), + const unsigned int firstMonthOfSimulation) : year_(year), lastSimulationDay_(lastSimulationDay), - firstMonthOfSimulation_(firstMonthOfSimulation) + firstMonthOfSimulation_(firstMonthOfSimulation), + hydro_(hydro), + areaIndex_(areaIndex), + areaName_(areaName), + initialLevel_(initialLevel), + finalLevel_(finalLevel) { } @@ -96,7 +96,7 @@ bool FinalLevelValidator::checkForInfeasibility() bool FinalLevelValidator::hydroAllocationStartMatchesSimulation() const { - int initReservoirLvlMonth = hydro_.initializeReservoirLevelDate; // month [0-11] + unsigned initReservoirLvlMonth = hydro_.initializeReservoirLevelDate; // month [0-11] if (lastSimulationDay_ == DAYS_PER_YEAR && initReservoirLvlMonth == firstMonthOfSimulation_) return true; diff --git a/src/tests/src/libs/antares/study/parameters/parameters-tests.cpp b/src/tests/src/libs/antares/study/parameters/parameters-tests.cpp index 07c8e7fa1d..5e0da57a10 100644 --- a/src/tests/src/libs/antares/study/parameters/parameters-tests.cpp +++ b/src/tests/src/libs/antares/study/parameters/parameters-tests.cpp @@ -69,7 +69,7 @@ BOOST_FIXTURE_TEST_CASE(loadValid, Fixture) options.optOptions.ortoolsSolver = "xpress"; writeValidFile(); - p.loadFromFile(path.string(), version, options); + p.loadFromFile(path.string(), version); p.validateOptions(options); p.fixBadValues(); @@ -94,7 +94,7 @@ BOOST_FIXTURE_TEST_CASE(fixBadValue, Fixture) BOOST_FIXTURE_TEST_CASE(invalidValues, Fixture) { writeInvalidFile(); - BOOST_CHECK(p.loadFromFile(path.string(), version, options)); + BOOST_CHECK(p.loadFromFile(path.string(), version)); p.validateOptions(options); p.fixBadValues();