Skip to content

Commit

Permalink
Remove compile warnings with gcc-11+ / clang-16+ (#2119)
Browse files Browse the repository at this point in the history
Co-authored-by: Florian OMNES <[email protected]>
  • Loading branch information
payetvin and flomnes authored May 28, 2024
1 parent 85a86f7 commit 3e89b2e
Show file tree
Hide file tree
Showing 68 changed files with 1,367 additions and 1,448 deletions.
11 changes: 4 additions & 7 deletions src/libs/antares/study/include/antares/study/fwd.h
Original file line number Diff line number Diff line change
Expand Up @@ -365,13 +365,10 @@ enum SeedIndex
seedMax,
};

enum
{
//! A default seed for random number generators
antaresSeedDefaultValue = 5489,
//! Increment for RNG (generators) with a different seed
antaresSeedIncrement = 1000000, // arbitrary value
};
//! A default seed for random number generators
constexpr unsigned antaresSeedDefaultValue = 5489;
//! Increment for RNG (generators) with a different seed
constexpr unsigned antaresSeedIncrement = 1000000; // arbitrary value

/*!
** \brief Convert a seed into a string
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,29 +61,28 @@ struct VCardOverallCost
//! The VCard to look for for calculating spatial aggregates
typedef VCardOverallCost VCardForSpatialAggregate;

enum
{
//! Data Level
categoryDataLevel = Category::DataLevel::area,
//! File level (provided by the type of the results)
categoryFileLevel = ResultsType::categoryFile & (Category::FileLevel::id | Category::FileLevel::va),
//! Precision (views)
precision = Category::all,
//! Indentation (GUI)
nodeDepthForGUI = +0,
//! Decimal precision
decimal = 0,
//! Number of columns used by the variable (One ResultsType per column)
columnCount = 1,
//! The Spatial aggregation
spatialAggregate = Category::spatialAggregateSum,
spatialAggregateMode = Category::spatialAggregateEachYear,
spatialAggregatePostProcessing = 0,
//! Intermediate values
hasIntermediateValues = 1,
//! Can this variable be non applicable (0 : no, 1 : yes)
isPossiblyNonApplicable = 0,
};
//! Data Level
static constexpr uint8_t categoryDataLevel = Category::DataLevel::area;
//! File level (provided by the type of the results)
static constexpr uint8_t categoryFileLevel = ResultsType::categoryFile
& (Category::FileLevel::id
| Category::FileLevel::va);
//! Precision (views)
static constexpr uint8_t precision = Category::all;
//! Indentation (GUI)
static constexpr uint8_t nodeDepthForGUI = +0;
//! Decimal precision
static constexpr uint8_t decimal = 0;
//! Number of columns used by the variable (One ResultsType per column)
static constexpr int columnCount = 1;
//! The Spatial aggregation
static constexpr uint8_t spatialAggregate = Category::spatialAggregateSum;
static constexpr uint8_t spatialAggregateMode = Category::spatialAggregateEachYear;
static constexpr uint8_t spatialAggregatePostProcessing = 0;
//! Intermediate values
static constexpr uint8_t hasIntermediateValues = 1;
//! Can this variable be non applicable (0 : no, 1 : yes)
static constexpr uint8_t isPossiblyNonApplicable = 0;

typedef IntermediateValues IntermediateValuesBaseType;
typedef IntermediateValues* IntermediateValuesType;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,29 +62,28 @@ struct VCardSpilledEnergy
//! The VCard to look for for calculating spatial aggregates
typedef VCardSpilledEnergy VCardForSpatialAggregate;

enum
{
//! Data Level
categoryDataLevel = Category::DataLevel::area,
//! File level (provided by the type of the results)
categoryFileLevel = ResultsType::categoryFile & (Category::FileLevel::id | Category::FileLevel::va),
//! Precision (views)
precision = Category::all,
//! Indentation (GUI)
nodeDepthForGUI = +0,
//! Decimal precision
decimal = 0,
//! Number of columns used by the variable (One ResultsType per column)
columnCount = 1,
//! The Spatial aggregation
spatialAggregate = Category::spatialAggregateSum,
spatialAggregateMode = Category::spatialAggregateEachYear,
spatialAggregatePostProcessing = 0,
//! Intermediate values
hasIntermediateValues = 1,
//! Can this variable be non applicable (0 : no, 1 : yes)
isPossiblyNonApplicable = 0,
};
//! Data Level
static constexpr uint8_t categoryDataLevel = Category::DataLevel::area;
//! File level (provided by the type of the results)
static constexpr uint8_t categoryFileLevel = ResultsType::categoryFile
& (Category::FileLevel::id
| Category::FileLevel::va);
//! Precision (views)
static constexpr uint8_t precision = Category::all;
//! Indentation (GUI)
static constexpr uint8_t nodeDepthForGUI = +0;
//! Decimal precision
static constexpr uint8_t decimal = 0;
//! Number of columns used by the variable (One ResultsType per column)
static constexpr int columnCount = 1;
//! The Spatial aggregation
static constexpr uint8_t spatialAggregate = Category::spatialAggregateSum;
static constexpr uint8_t spatialAggregateMode = Category::spatialAggregateEachYear;
static constexpr uint8_t spatialAggregatePostProcessing = 0;
//! Intermediate values
static constexpr uint8_t hasIntermediateValues = 1;
//! Can this variable be non applicable (0 : no, 1 : yes)
static constexpr uint8_t isPossiblyNonApplicable = 0;

typedef IntermediateValues IntermediateValuesBaseType;
typedef IntermediateValues* IntermediateValuesType;
Expand Down
28 changes: 13 additions & 15 deletions src/solver/variable/include/antares/solver/variable/area.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,21 +52,19 @@ struct VCardAllAreas
//! The expecte results
typedef Results<> ResultsType;

enum
{
//! Data Level
categoryDataLevel = Category::DataLevel::area,
//! File level (provided by the type of the results)
categoryFileLevel = ResultsType::categoryFile & Category::FileLevel::de,
//! Indentation (GUI)
nodeDepthForGUI = +1,
//! Number of columns used by the variable (One ResultsType per column)
columnCount = 0,
//! The Spatial aggregation
spatialAggregate = Category::noSpatialAggregate,
//! Intermediate values
hasIntermediateValues = 0,
};
//! Data Level
static constexpr uint8_t categoryDataLevel = Category::DataLevel::area;
//! File level (provided by the type of the results)
static constexpr uint8_t categoryFileLevel = ResultsType::categoryFile
& Category::FileLevel::de;
//! Indentation (GUI)
static constexpr uint8_t nodeDepthForGUI = +1;
//! Number of columns used by the variable (One ResultsType per column)
static constexpr int columnCount = 0;
//! The Spatial aggregation
static constexpr uint8_t spatialAggregate = Category::noSpatialAggregate;
//! Intermediate values
static constexpr uint8_t hasIntermediateValues = 0;

}; // class VCard

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,21 +51,19 @@ struct VCardAllBindingConstraints
//! The expecte results
typedef Results<> ResultsType;

enum
{
//! Data Level
categoryDataLevel = Category::DataLevel::bindingConstraint,
//! File level (provided by the type of the results)
categoryFileLevel = ResultsType::categoryFile & Category::FileLevel::bc,
//! Indentation (GUI)
nodeDepthForGUI = +1,
//! Number of columns used by the variable (One ResultsType per column)
columnCount = 0,
//! The Spatial aggregation
spatialAggregate = Category::noSpatialAggregate,
//! Intermediate values
hasIntermediateValues = 0,
};
//! Data Level
static constexpr uint8_t categoryDataLevel = Category::DataLevel::bindingConstraint;
//! File level (provided by the type of the results)
static constexpr uint8_t categoryFileLevel = ResultsType::categoryFile
& Category::FileLevel::bc;
//! Indentation (GUI)
static constexpr uint8_t nodeDepthForGUI = +1;
//! Number of columns used by the variable (One ResultsType per column)
static constexpr int columnCount = 0;
//! The Spatial aggregation
static constexpr uint8_t spatialAggregate = Category::noSpatialAggregate;
//! Intermediate values
static constexpr uint8_t hasIntermediateValues = 0;

}; // class VCardAllBindingConstraints

Expand Down
66 changes: 33 additions & 33 deletions src/solver/variable/include/antares/solver/variable/categories.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,39 +33,39 @@ namespace Category
{
namespace DataLevel
{
//! Data that belong to a single area
constexpr uint8_t area = 1;
//! Data that belong to a thermal dispatchable cluster
constexpr uint8_t thermalAggregate = 2;
//! Data that belong to a link
constexpr uint8_t link = 4;
//! Data that belong to a set
constexpr uint8_t setOfAreas = 8;
// Data belonging to a binding constraint
constexpr uint8_t bindingConstraint = 16;
//! The maximum available level
constexpr uint8_t maxDataLevel = 16;
}
//! Data that belong to a single area
constexpr uint8_t area = 1;
//! Data that belong to a thermal dispatchable cluster
constexpr uint8_t thermalAggregate = 2;
//! Data that belong to a link
constexpr uint8_t link = 4;
//! Data that belong to a set
constexpr uint8_t setOfAreas = 8;
// Data belonging to a binding constraint
constexpr uint8_t bindingConstraint = 16;
//! The maximum available level
constexpr uint8_t maxDataLevel = 16;
} // namespace DataLevel

namespace FileLevel
{
//! Values of physical variables
constexpr uint8_t va = 1;
//! Reference numbers
constexpr uint8_t id = 2;
//! Detailed values regarding thermal generation
constexpr uint8_t de = 4;
//! Detailed values regarding RES generation
constexpr uint8_t de_res = 8;
//! Detailed values regarding binding constraints
constexpr uint8_t bc = 16;
//! Detailed values regarding short term storage
constexpr uint8_t de_sts = 32;
//! The maximum available value
constexpr uint8_t maxFileLevel = 32;
//! All file level
constexpr uint8_t allFile = va | id | de | de_res | bc | de_sts;
};
//! Values of physical variables
constexpr uint8_t va = 1;
//! Reference numbers
constexpr uint8_t id = 2;
//! Detailed values regarding thermal generation
constexpr uint8_t de = 4;
//! Detailed values regarding RES generation
constexpr uint8_t de_res = 8;
//! Detailed values regarding binding constraints
constexpr uint8_t bc = 16;
//! Detailed values regarding short term storage
constexpr uint8_t de_sts = 32;
//! The maximum available value
constexpr uint8_t maxFileLevel = 32;
//! All file level
constexpr uint8_t allFile = va | id | de | de_res | bc | de_sts;
}; // namespace FileLevel

enum Precision
{
Expand Down Expand Up @@ -165,7 +165,7 @@ inline void DataLevelToStream(StreamT& out, int dataLevel)
{
switch (dataLevel)
{
using namespace DataLevel;
using namespace DataLevel;
case area:
out += "area";
break;
Expand All @@ -188,7 +188,7 @@ inline void FileLevelToStreamShort(StreamT& out, int fileLevel)
{
switch (fileLevel)
{
using namespace FileLevel;
using namespace FileLevel;
case va:
out += "va";
break;
Expand Down Expand Up @@ -217,7 +217,7 @@ inline void FileLevelToStream(StreamT& out, int fileLevel)
{
switch (fileLevel)
{
using namespace FileLevel;
using namespace FileLevel;
case va:
out += "values";
break;
Expand Down
45 changes: 22 additions & 23 deletions src/solver/variable/include/antares/solver/variable/commons/hydro.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,29 +63,28 @@ struct VCardTimeSeriesValuesHydro
//! The VCard to look for for calculating spatial aggregates
typedef VCardTimeSeriesValuesHydro VCardForSpatialAggregate;

enum
{
//! Data Level
categoryDataLevel = Category::DataLevel::area,
//! File level (provided by the type of the results)
categoryFileLevel = ResultsType::categoryFile & (Category::FileLevel::id | Category::FileLevel::va),
//! Precision (views)
precision = Category::all,
//! Indentation (GUI)
nodeDepthForGUI = +0,
//! Decimal precision
decimal = 0,
//! Number of columns used by the variable (One ResultsType per column)
columnCount = 1,
//! The Spatial aggregation
spatialAggregate = Category::spatialAggregateSum,
spatialAggregateMode = Category::spatialAggregateEachYear,
spatialAggregatePostProcessing = 0,
//! Intermediate values
hasIntermediateValues = 1,
//! Can this variable be non applicable (0 : no, 1 : yes)
isPossiblyNonApplicable = 0,
};
//! Data Level
static constexpr uint8_t categoryDataLevel = Category::DataLevel::area;
//! File level (provided by the type of the results)
static constexpr uint8_t categoryFileLevel = ResultsType::categoryFile
& (Category::FileLevel::id
| Category::FileLevel::va);
//! Precision (views)
static constexpr uint8_t precision = Category::all;
//! Indentation (GUI)
static constexpr uint8_t nodeDepthForGUI = +0;
//! Decimal precision
static constexpr uint8_t decimal = 0;
//! Number of columns used by the variable (One ResultsType per column)
static constexpr int columnCount = 1;
//! The Spatial aggregation
static constexpr uint8_t spatialAggregate = Category::spatialAggregateSum;
static constexpr uint8_t spatialAggregateMode = Category::spatialAggregateEachYear;
static constexpr uint8_t spatialAggregatePostProcessing = 0;
//! Intermediate values
static constexpr uint8_t hasIntermediateValues = 1;
//! Can this variable be non applicable (0 : no, 1 : yes)
static constexpr uint8_t isPossiblyNonApplicable = 0;

typedef IntermediateValues IntermediateValuesBaseType;
typedef IntermediateValues* IntermediateValuesType;
Expand Down
45 changes: 22 additions & 23 deletions src/solver/variable/include/antares/solver/variable/commons/join.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,27 +58,26 @@ struct VCardJoin
>>>>>
ResultsType;

enum
{
//! Data Level
categoryDataLevel = Category::DataLevel::area,
//! File level (provided by the type of the results)
categoryFileLevel = ResultsType::categoryFile & (Category::FileLevel::id | Category::FileLevel::va),
//! Precision (views)
precision = Category::all,
//! Indentation (GUI)
nodeDepthForGUI = +0,
//! Decimal precision
decimal = 0,
//! Number of columns used by the variable (One ResultsType per column)
columnCount = 0,
//! The Spatial aggregation
spatialAggregate = Category::noSpatialAggregate,
spatialAggregateMode = Category::spatialAggregateEachYear,
spatialAggregatePostProcessing = 0,
//! Intermediate values
hasIntermediateValues = 0,
};
//! Data Level
static constexpr uint8_t categoryDataLevel = Category::DataLevel::area;
//! File level (provided by the type of the results)
static constexpr uint8_t categoryFileLevel = ResultsType::categoryFile
& (Category::FileLevel::id
| Category::FileLevel::va);
//! Precision (views)
static constexpr uint8_t precision = Category::all;
//! Indentation (GUI)
static constexpr uint8_t nodeDepthForGUI = +0;
//! Decimal precision
static constexpr uint8_t decimal = 0;
//! Number of columns used by the variable (One ResultsType per column)
static constexpr int columnCount = 0;
//! The Spatial aggregation
static constexpr uint8_t spatialAggregate = Category::noSpatialAggregate;
static constexpr uint8_t spatialAggregateMode = Category::spatialAggregateEachYear;
static constexpr uint8_t spatialAggregatePostProcessing = 0;
//! Intermediate values
static constexpr uint8_t hasIntermediateValues = 0;

}; // class VCard

Expand Down Expand Up @@ -119,8 +118,8 @@ class Join: public Variable::IVariable<Join<LeftT, RightT, BindConstT>, Yuni::De
enum
{
count = LeftType::template Statistics < CDataLevel,
CFile > ::count + RightType::template Statistics < CDataLevel,
CFile > ::count + BindConstType::template Statistics < CDataLevel,
CFile > ::count + (int)RightType::template Statistics < CDataLevel,
CFile > ::count + (int)BindConstType::template Statistics < CDataLevel,
CFile > ::count,
};
};
Expand Down
Loading

0 comments on commit 3e89b2e

Please sign in to comment.