From a2d2fb4c949a37eea2cbbe5a62d35cfc338b7952 Mon Sep 17 00:00:00 2001 From: Christian Godenschwager <christian.godenschwager@fau.de> Date: Wed, 16 Aug 2017 15:11:16 +0200 Subject: [PATCH] Fixed conversion warnings in VS2017 --- src/core/logging/Initialization.cpp | 7 ++++--- tests/geometry/VoxelFileTest.cpp | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/core/logging/Initialization.cpp b/src/core/logging/Initialization.cpp index b0a50017a..420cbbb1e 100644 --- a/src/core/logging/Initialization.cpp +++ b/src/core/logging/Initialization.cpp @@ -23,6 +23,7 @@ #include "Logging.h" #include <boost/algorithm/string.hpp> + #include <algorithm> #include <sstream> #include <string> @@ -139,7 +140,7 @@ void configureLogging( const Config::BlockHandle & loggingBlock ) if( loggingBlock.isDefined( "logLevel" ) ) { std::string type = loggingBlock.getParameter< std::string >( "logLevel" ); - std::transform( type.begin(), type.end(), type.begin(), ::tolower ); //convert to lower case + boost::algorithm::to_lower( type ); if( type.compare("warning") == 0 ){ logging::Logging::instance()->setLogLevel( logging::Logging::WARNING ); @@ -158,7 +159,7 @@ void configureLogging( const Config::BlockHandle & loggingBlock ) if( loggingBlock.isDefined( "streamLogLevel" ) ) { std::string type = loggingBlock.getParameter< std::string >( "streamLogLevel" ); - std::transform( type.begin(), type.end(), type.begin(), ::tolower ); //convert to lower case + boost::algorithm::to_lower( type ); if( type.compare("warning") == 0 ){ logging::Logging::instance()->setStreamLogLevel( logging::Logging::WARNING ); @@ -177,7 +178,7 @@ void configureLogging( const Config::BlockHandle & loggingBlock ) if( loggingBlock.isDefined( "fileLogLevel" ) ) { std::string type = loggingBlock.getParameter< std::string >( "fileLogLevel" ); - std::transform( type.begin(), type.end(), type.begin(), ::tolower ); //convert to lower case + boost::algorithm::to_lower( type ); if( type.compare("warning") == 0 ){ logging::Logging::instance()->setFileLogLevel( logging::Logging::WARNING ); diff --git a/tests/geometry/VoxelFileTest.cpp b/tests/geometry/VoxelFileTest.cpp index f75f7277f..3918b08de 100644 --- a/tests/geometry/VoxelFileTest.cpp +++ b/tests/geometry/VoxelFileTest.cpp @@ -243,7 +243,7 @@ void runTests(const std::string & filename, size_t xSize, size_t ySize, size_t z WALBERLA_CHECK_EQUAL( ySize, geometryFile.ySize() ); WALBERLA_CHECK_EQUAL( zSize, geometryFile.zSize() ); - numDefaultConstructedElements = std::count( data.begin(), data.end(), 7 ); + numDefaultConstructedElements = std::count( data.begin(), data.end(), numeric_cast<T>(7) ); WALBERLA_CHECK_EQUAL( numCells, numDefaultConstructedElements ); data.clear(); -- GitLab