Skip to content

Commit

Permalink
Prevent (sign-)conversion warning
Browse files Browse the repository at this point in the history
See also gsl-lite PR 71, gsl-lite/gsl-lite#71
  • Loading branch information
martinmoene committed Apr 25, 2017
1 parent d347460 commit 352deb2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions include/lest/lest.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,7 @@ class approx
friend bool operator != ( approx const & lhs, double rhs ) { return !operator==( rhs, lhs ); }

friend bool operator <= ( double lhs, approx const & rhs ) { return lhs < rhs.magnitude_ || lhs == rhs; }
friend bool operator <= ( approx const & lhs, double rhs ) { return lhs.magnitude_ < rhs || lhs == rhs; }
friend bool operator <= ( approx const & lhs, double rhs ) { return lhs.magnitude_ < rhs || lhs == rhs; }
friend bool operator >= ( double lhs, approx const & rhs ) { return lhs > rhs.magnitude_ || lhs == rhs; }
friend bool operator >= ( approx const & lhs, double rhs ) { return lhs.magnitude_ > rhs || lhs == rhs; }

Expand Down Expand Up @@ -1090,7 +1090,7 @@ inline void shuffle( tests & specification, options option )

inline int stoi( text num )
{
return std::strtol( num.c_str(), NULL, 10 );
return static_cast<int>( lest::strtol( num.c_str(), NULL, 10 ) );
}

inline bool is_number( text arg )
Expand Down
6 changes: 3 additions & 3 deletions include/lest/lest_cpp03.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -453,7 +453,7 @@ class approx
friend bool operator != ( approx const & lhs, double rhs ) { return !operator==( rhs, lhs ); }

friend bool operator <= ( double lhs, approx const & rhs ) { return lhs < rhs.magnitude_ || lhs == rhs; }
friend bool operator <= ( approx const & lhs, double rhs ) { return lhs.magnitude_ < rhs || lhs == rhs; }
friend bool operator <= ( approx const & lhs, double rhs ) { return lhs.magnitude_ < rhs || lhs == rhs; }
friend bool operator >= ( double lhs, approx const & rhs ) { return lhs > rhs.magnitude_ || lhs == rhs; }
friend bool operator >= ( approx const & lhs, double rhs ) { return lhs.magnitude_ > rhs || lhs == rhs; }

Expand Down Expand Up @@ -1025,7 +1025,7 @@ inline void shuffle( tests & specification, options option )
#if lest_CPP11_OR_GREATER
std::shuffle( specification.begin(), specification.end(), std::mt19937( option.seed ) );
#else
lest::srand( option.seed );
lest::srand( static_cast<unsigned int>( option.seed ) );

rng generator;
std::random_shuffle( specification.begin(), specification.end(), generator );
Expand All @@ -1034,7 +1034,7 @@ inline void shuffle( tests & specification, options option )

inline int stoi( text num )
{
return lest::strtol( num.c_str(), NULL, 10 );
return static_cast<int>( lest::strtol( num.c_str(), NULL, 10 ) );
}

inline bool is_number( text arg )
Expand Down

0 comments on commit 352deb2

Please sign in to comment.