[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lmi-commits] [lmi] master 3779336 1/3: Fix tn_range_test compilation wi
From: |
Greg Chicares |
Subject: |
[lmi-commits] [lmi] master 3779336 1/3: Fix tn_range_test compilation with gcc6 |
Date: |
Fri, 18 Aug 2017 20:45:01 -0400 (EDT) |
branch: master
commit 377933616a2fca2844bffdfa7a1ff0b5ada5e974
Author: Vadim Zeitlin <address@hidden>
Commit: Gregory W. Chicares <address@hidden>
Fix tn_range_test compilation with gcc6
Avoid comparing booleans with 1 or -1, this results in errors like the
following:
error: comparison of constant '1' with boolean expression is
always false [-Werror=bool-compare]
---
tn_range_test.cpp | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/tn_range_test.cpp b/tn_range_test.cpp
index e545c11..56f2125 100644
--- a/tn_range_test.cpp
+++ b/tn_range_test.cpp
@@ -137,7 +137,7 @@ void tn_range_test::test_auxiliary_functions(char const*
file, int line)
T const minT = std::numeric_limits<T>::lowest();
INVOKE_BOOST_TEST(!is_strictly_between_extrema(maxT), file, line);
- if(1 < maxT)
+ if(T(1) < maxT)
{
INVOKE_BOOST_TEST( is_strictly_between_extrema<T>(1), file, line);
}
@@ -152,8 +152,8 @@ void tn_range_test::test_auxiliary_functions(char const*
file, int line)
if(minT < 0)
{
- INVOKE_BOOST_TEST_EQUAL(-1, signum(T(-1)), file, line);
- INVOKE_BOOST_TEST_EQUAL(-1, signum(minT), file, line);
+ INVOKE_BOOST_TEST_EQUAL(T(-1), signum(T(-1)), file, line);
+ INVOKE_BOOST_TEST_EQUAL(T(-1), signum(minT), file, line);
INVOKE_BOOST_TEST_EQUAL(true , is_exact_integer(T(-1)), file, line);
}