From 99326f50fbc4fec0f5a23afc6606dd9d654e8dab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ion=20Gazta=C3=B1aga?= Date: Tue, 18 Sep 2018 14:26:31 +0200 Subject: [PATCH] Fix clang 6.0 warnings in tests: unused members, suspicious return types --- example/doc_advanced_value_traits.cpp | 2 +- example/doc_any_hook.cpp | 3 +++ example/doc_derivation_value_traits.cpp | 2 +- example/doc_how_to_use.cpp | 3 +++ example/doc_list.cpp | 3 +++ example/doc_member_value_traits.cpp | 2 +- example/doc_offset_ptr.cpp | 2 +- example/doc_slist.cpp | 3 +++ test/virtual_base_test.cpp | 4 ++++ 9 files changed, 20 insertions(+), 4 deletions(-) diff --git a/example/doc_advanced_value_traits.cpp b/example/doc_advanced_value_traits.cpp index a295901..dc5f8d2 100644 --- a/example/doc_advanced_value_traits.cpp +++ b/example/doc_advanced_value_traits.cpp @@ -98,7 +98,7 @@ int main() //Test the objects inserted in our lists for(; it1 != itend1; ++it1, ++bit1, ++it2, ++bit2){ - if(&*bit1 != &*it1 || &*bit2 != &*it2) return false; + if(&*bit1 != &*it1 || &*bit2 != &*it2) return 1; } return 0; } diff --git a/example/doc_any_hook.cpp b/example/doc_any_hook.cpp index 03bd0d2..2526f70 100644 --- a/example/doc_any_hook.cpp +++ b/example/doc_any_hook.cpp @@ -26,6 +26,9 @@ class MyClass : public any_base_hook<> //Base hook MyClass(int i = 0) : int_(i) {} + //<- + int get_int() const { return int_; } + //-> }; int main() diff --git a/example/doc_derivation_value_traits.cpp b/example/doc_derivation_value_traits.cpp index e900657..c760bb8 100644 --- a/example/doc_derivation_value_traits.cpp +++ b/example/doc_derivation_value_traits.cpp @@ -87,7 +87,7 @@ int main() //Test the objects inserted in our lists for(; it1 != itend1; ++it1, ++bit1, ++it2, ++bit2){ - if(&*bit1 != &*it1 || &*bit2 != &*it2) return false; + if(&*bit1 != &*it1 || &*bit2 != &*it2) return 1; } return 0; } diff --git a/example/doc_how_to_use.cpp b/example/doc_how_to_use.cpp index 05d9887..22ea3fd 100644 --- a/example/doc_how_to_use.cpp +++ b/example/doc_how_to_use.cpp @@ -23,6 +23,9 @@ class MyClass : public list_base_hook<> list_member_hook<> member_hook_; MyClass(int i) : int_(i) {} + //<- + int get_int() const { return int_; } + //-> }; //Define a list that will store MyClass using the base hook diff --git a/example/doc_list.cpp b/example/doc_list.cpp index 7b6f390..ec5693a 100644 --- a/example/doc_list.cpp +++ b/example/doc_list.cpp @@ -26,6 +26,9 @@ class MyClass : public list_base_hook<> //This is a derivation hook MyClass(int i) : int_(i) {} + //<- + int get_int() const { return int_; } + //-> }; //Define a list that will store MyClass using the public base hook diff --git a/example/doc_member_value_traits.cpp b/example/doc_member_value_traits.cpp index 45d1f1d..37886dd 100644 --- a/example/doc_member_value_traits.cpp +++ b/example/doc_member_value_traits.cpp @@ -88,7 +88,7 @@ int main() //Test the objects inserted in our lists for(; it1 != itend1; ++it1, ++bit1, ++it2, ++bit2){ - if(&*bit1 != &*it1 || &*bit2 != &*it2) return false; + if(&*bit1 != &*it1 || &*bit2 != &*it2) return 1; } return 0; } diff --git a/example/doc_offset_ptr.cpp b/example/doc_offset_ptr.cpp index 2e1906f..f285ac7 100644 --- a/example/doc_offset_ptr.cpp +++ b/example/doc_offset_ptr.cpp @@ -100,7 +100,7 @@ int main() int checker = 0; for( intrusive_list_t::const_iterator it = plist->begin(), itend(plist->end()) ; it != itend; ++it, ++checker){ - if(it->get() != checker) return false; + if(it->get() != checker) return 1; } //Now delete the list and after that, the nodes diff --git a/example/doc_slist.cpp b/example/doc_slist.cpp index c513177..eda8f85 100644 --- a/example/doc_slist.cpp +++ b/example/doc_slist.cpp @@ -27,6 +27,9 @@ class MyClass : public slist_base_hook<> MyClass(int i) : int_(i) {} + //<- + int get_int() const { return int_; } + //-> }; //Define an slist that will store MyClass using the public base hook diff --git a/test/virtual_base_test.cpp b/test/virtual_base_test.cpp index b673c1a..70a59db 100644 --- a/test/virtual_base_test.cpp +++ b/test/virtual_base_test.cpp @@ -44,11 +44,15 @@ class MyClass , public virtual VirtualBase3 { int int_; + public: list_member_hook<> list_hook_; MyClass(int i = 0) : int_(i) {} + //<- + int get_int() const { return int_; } + //-> }; //Define a list that will store MyClass using the public base hook