Skip to content

Commit

Permalink
Remove some Compiler Warnings to prepare for Pedantic Mode (#99)
Browse files Browse the repository at this point in the history
* Remove modernize-use-trailing-return-type warning in main
* Remove modernize-use-equals-default warning in TestBound
* Remove modernize-use-trailing-return-type warning in TestMappingBinaryHeap
* Add const in TestPowerGrid
* Formatting issues with const in Color.hpp
  • Loading branch information
franziska-wegner committed Jan 6, 2024
1 parent e48b3be commit 48126bc
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions include/IO/Appearance/Color.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -279,15 +279,15 @@ class Color {
~Color(){}


bool operator== ( const Color& rhs ) {
bool operator== ( Color const & rhs ) {
return Red() == rhs.Red() && Green() == rhs.Green() && Blue() == rhs.Blue();
}

bool operator!= ( const Color& rhs ) {
bool operator!= ( Color const & rhs ) {
return !operator==(rhs);
}

friend std::ostream& operator<<(std::ostream& os, const Name color ) {
friend std::ostream& operator<<(std::ostream& os, Name const color ) {
switch ( color ) {
case Name::KITgreen: os << "KITgreen"; break;
case Name::KITgreen70: os << "KITgreen70"; break;
Expand Down
2 changes: 1 addition & 1 deletion src/Runnables/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ void setNetworkSetting(egoa::PowerGrid<TGraph> & network, const QString & networ
else if ( networkSetting == "EXACT" ) { network.MakeExact(); }
}

int main(int argc, char *argv[]) {
auto main(int argc, char * argv []) -> int {

// Command line parsing
auto application = std::unique_ptr<QCoreApplication>(std::make_unique<QCoreApplication>(argc, argv));
Expand Down
2 changes: 1 addition & 1 deletion tests/DataStructures/Container/TestMappingBinaryHeap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ using ::testing::MatchesRegex;

namespace egoa::test {

std::string buildAssertionString(std::string function, std::string message) {
auto buildAssertionString(std::string const & function, std::string const & message) -> std::string {
return buildAssertionString("MappingBinaryHeap.hpp", "MappingBinaryHeap", function, message);
}

Expand Down
4 changes: 2 additions & 2 deletions tests/DataStructures/Graphs/TestPowerGrid.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3223,12 +3223,12 @@ TEST_F ( TestPowerGridAcm2018MtsfFigure4a
TEST_F ( TestPowerGridAcm2018MtsfFigure4a
, AddLoadAtUsingVertexId )
{
auto vertexId = static_cast<Types::vertexId>(2);
auto const vertexId = static_cast<Types::vertexId>(2);
EXPECT_EQ ( 1, network_.NumberOfLoads() );
EXPECT_FALSE ( network_.HasLoadAt ( vertexId ) );
// Add load at vertex 2
TLoadProperties loadProperties;
Types::loadId loadId = network_.AddLoadAt ( vertexId, loadProperties );
Types::loadId const loadId = network_.AddLoadAt ( vertexId, loadProperties );
// Check
EXPECT_TRUE ( network_.HasLoadAt ( vertexId ) );
EXPECT_TRUE ( network_.HasLoad ( loadId ) );
Expand Down
4 changes: 2 additions & 2 deletions tests/DataStructures/TestBound.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ using ::testing::Le;

namespace egoa::test {

TestBound::TestBound () {}
TestBound::TestBound () = default;

TestBound::~TestBound () {}
TestBound::~TestBound () = default;

void TestBound::SetUp () {}

Expand Down

0 comments on commit 48126bc

Please sign in to comment.