[libsigcplusplus] tests: Make some casts explicit.



commit dc6ac67425f2c3ba5b9ee0d897d614bedcb41a66
Author: Murray Cumming <murrayc murrayc com>
Date:   Fri Apr 21 14:52:16 2017 +0200

    tests: Make some casts explicit.
    
    Noticed by clang-tidy.

 tests/test_bind.cc                 |    2 +-
 tests/test_compose.cc              |    2 +-
 tests/test_tuple_transform_each.cc |    2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/tests/test_bind.cc b/tests/test_bind.cc
index ca86379..7d4a354 100644
--- a/tests/test_bind.cc
+++ b/tests/test_bind.cc
@@ -18,7 +18,7 @@ struct foo
   int operator()(int i)
   {
     result_stream << "foo(int " << i << ") ";
-    return i > 0;
+    return static_cast<int>(i > 0);
   }
 
   int operator()(int i, int j)
diff --git a/tests/test_compose.cc b/tests/test_compose.cc
index 2669be9..f7f12e5 100644
--- a/tests/test_compose.cc
+++ b/tests/test_compose.cc
@@ -61,7 +61,7 @@ struct get
   double operator()()
   {
     result_stream << "get() ";
-    return true;
+    return static_cast<double>(true);
   }
 
   double operator()(int i)
diff --git a/tests/test_tuple_transform_each.cc b/tests/test_tuple_transform_each.cc
index 247cbd7..373ee77 100644
--- a/tests/test_tuple_transform_each.cc
+++ b/tests/test_tuple_transform_each.cc
@@ -253,7 +253,7 @@ template <>
 class transform_as_constexpr_to_something<int>
 {
 public:
-  constexpr static char transform(int from) { return 'a' + from; }
+  constexpr static char transform(int from) { return 'a' + static_cast<char>(from); }
 };
 
 // A double will be converted to an int:


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]