diff --git a/include/internal/catch_commandline.hpp b/include/internal/catch_commandline.hpp index baed9c81..c7c33845 100644 --- a/include/internal/catch_commandline.hpp +++ b/include/internal/catch_commandline.hpp @@ -26,14 +26,14 @@ namespace Catch { inline void addWarning( ConfigData& config, std::string const& _warning ) { if( _warning == "NoAssertions" ) - config.warnings = (WarnAbout::What)( config.warnings | WarnAbout::NoAssertions ); + config.warnings = static_cast( config.warnings | WarnAbout::NoAssertions ); else throw std::runtime_error( "Unrecognised warning: '" + _warning + "'" ); } inline void setVerbosity( ConfigData& config, int level ) { // !TBD: accept strings? - config.verbosity = (Verbosity::Level)level; + config.verbosity = static_cast( level ); } inline void setShowDurations( ConfigData& config, bool _showDurations ) { config.showDurations = _showDurations diff --git a/include/internal/catch_test_case_info.hpp b/include/internal/catch_test_case_info.hpp index b277ef1e..e3fa1f7d 100644 --- a/include/internal/catch_test_case_info.hpp +++ b/include/internal/catch_test_case_info.hpp @@ -108,7 +108,7 @@ namespace Catch { for( std::set::const_iterator it = _tags.begin(), itEnd = _tags.end(); it != itEnd; ++it ) { oss << "[" << *it << "]"; std::string lcaseTag = toLower( *it ); - properties = (SpecialProperties)( properties | parseSpecialTag( lcaseTag ) ); + properties = static_cast( properties | parseSpecialTag( lcaseTag ) ); lcaseTags.insert( lcaseTag ); } tagsAsString = oss.str(); diff --git a/include/internal/catch_test_spec.hpp b/include/internal/catch_test_spec.hpp index 2edf5443..b5f70635 100644 --- a/include/internal/catch_test_spec.hpp +++ b/include/internal/catch_test_spec.hpp @@ -41,7 +41,7 @@ namespace Catch { } if( endsWith( m_name, "*" ) ) { m_name = m_name.substr( 0, m_name.size()-1 ); - m_wildcard = (WildcardPosition)( m_wildcard | WildcardAtEnd ); + m_wildcard = static_cast( m_wildcard | WildcardAtEnd ); } } virtual ~NamePattern(); diff --git a/include/internal/catch_timer.hpp b/include/internal/catch_timer.hpp index 6f716b1e..b60fa2b5 100644 --- a/include/internal/catch_timer.hpp +++ b/include/internal/catch_timer.hpp @@ -38,7 +38,7 @@ namespace Catch { uint64_t getCurrentTicks() { timeval t; gettimeofday(&t,NULL); - return (uint64_t)t.tv_sec * 1000000ull + (uint64_t)t.tv_usec; + return static_cast( t.tv_sec ) * 1000000ull + static_cast( t.tv_usec ); } #endif } @@ -47,10 +47,10 @@ namespace Catch { m_ticks = getCurrentTicks(); } unsigned int Timer::getElapsedNanoseconds() const { - return (unsigned int)(getCurrentTicks() - m_ticks); + return static_cast(getCurrentTicks() - m_ticks); } unsigned int Timer::getElapsedMilliseconds() const { - return (unsigned int)((getCurrentTicks() - m_ticks)/1000); + return static_cast((getCurrentTicks() - m_ticks)/1000); } double Timer::getElapsedSeconds() const { return (getCurrentTicks() - m_ticks)/1000000.0; diff --git a/include/reporters/catch_reporter_console.hpp b/include/reporters/catch_reporter_console.hpp index b2309701..f9373598 100644 --- a/include/reporters/catch_reporter_console.hpp +++ b/include/reporters/catch_reporter_console.hpp @@ -324,7 +324,7 @@ namespace Catch { } void printTotals( Totals const& totals ) { - int cols = 1+(int)log10( (float)std::max( totals.testCases.total(), totals.assertions.total() ) ); + int cols = 1+static_cast( log10( static_cast( (std::max)( totals.testCases.total(), totals.assertions.total() ) ) ) ); if( totals.testCases.total() == 0 ) { stream << Colour( Colour::Warning ) << "No tests ran\n"; }