From 119f040e89e698c2d557465a224853ab68e4690b Mon Sep 17 00:00:00 2001 From: Franz Detro Date: Tue, 4 Sep 2012 15:19:47 +0200 Subject: [PATCH] fix warnings in some more boost libraries --- boost/circular_buffer/base.hpp | 2 +- boost/circular_buffer/space_optimized.hpp | 4 ++-- boost/detail/utf8_codecvt_facet.hpp | 2 ++ boost/lambda/detail/ret.hpp | 2 +- boost/multi_index/detail/index_matcher.hpp | 8 ++++---- boost/multi_index/ordered_index.hpp | 20 ++++++++++---------- boost/optional/optional.hpp | 4 ++-- boost/parameter/aux_/tagged_argument.hpp | 4 ++-- boost/regex/v4/basic_regex_parser.hpp | 2 +- boost/serialization/smart_cast.hpp | 2 +- boost/token_functions.hpp | 2 +- boost/xpressive/match_results.hpp | 2 +- boost/xpressive/traits/cpp_regex_traits.hpp | 6 +++--- 13 files changed, 31 insertions(+), 29 deletions(-) diff --git a/boost/circular_buffer/base.hpp b/boost/circular_buffer/base.hpp index 3b9886a..4893cb2 100644 --- a/boost/circular_buffer/base.hpp +++ b/boost/circular_buffer/base.hpp @@ -2316,7 +2316,7 @@ private: } //! Specialized method for swapping the allocator. - void swap_allocator(circular_buffer& cb, const true_type&) { + void swap_allocator(circular_buffer&, const true_type&) { // Swap is not needed because allocators have no state. } diff --git a/boost/circular_buffer/space_optimized.hpp b/boost/circular_buffer/space_optimized.hpp index 9c76afe..5350676 100644 --- a/boost/circular_buffer/space_optimized.hpp +++ b/boost/circular_buffer/space_optimized.hpp @@ -1300,7 +1300,7 @@ private: //! Specialized method for determining the initial capacity. template - static size_type init_capacity(const capacity_type& capacity_ctrl, IntegralType n, IntegralType item, + static size_type init_capacity(const capacity_type& capacity_ctrl, IntegralType n, IntegralType, const true_type&) { return init_capacity(capacity_ctrl, static_cast(n)); } @@ -1320,7 +1320,7 @@ private: //! Specialized method for determining the initial capacity. template - static size_type init_capacity(const capacity_type& capacity_ctrl, InputIterator first, InputIterator last, + static size_type init_capacity(const capacity_type& capacity_ctrl, InputIterator, InputIterator, const std::input_iterator_tag&) { return capacity_ctrl.capacity(); } diff --git a/boost/detail/utf8_codecvt_facet.hpp b/boost/detail/utf8_codecvt_facet.hpp index b777ff9..592e70c 100644 --- a/boost/detail/utf8_codecvt_facet.hpp +++ b/boost/detail/utf8_codecvt_facet.hpp @@ -179,6 +179,8 @@ protected: ) const; #endif + using std::codecvt::do_length; + // Largest possible value do_length(state,from,from_end,1) could return. virtual int do_max_length() const throw () { return 6; // largest UTF-8 encoding of a UCS-4 character diff --git a/boost/lambda/detail/ret.hpp b/boost/lambda/detail/ret.hpp index fbd8b3a..c02e7be 100644 --- a/boost/lambda/detail/ret.hpp +++ b/boost/lambda/detail/ret.hpp @@ -284,7 +284,7 @@ inline const lambda_functor< lambda_functor_base > -make_void(const Arg1& a1) { +make_void(const Arg1& /*a1*/) { return lambda_functor_base(); } diff --git a/boost/multi_index/detail/index_matcher.hpp b/boost/multi_index/detail/index_matcher.hpp index 5828137..1c03144 100644 --- a/boost/multi_index/detail/index_matcher.hpp +++ b/boost/multi_index/detail/index_matcher.hpp @@ -132,17 +132,17 @@ protected: entries(),entries()+size_, entry(node),entry::less_by_node()); /* localize entry */ ent->ordered=false; - std::size_t n=ent->pos; /* get its position */ + std::size_t np=ent->pos; /* get its position */ entry dummy(0); - dummy.pile_top=n; + dummy.pile_top=np; entry* pile_ent= /* find the first available pile */ std::lower_bound( /* to stack the entry */ entries(),entries()+num_piles, dummy,entry::less_by_pile_top()); - pile_ent->pile_top=n; /* stack the entry */ + pile_ent->pile_top=np; /* stack the entry */ pile_ent->pile_top_entry=ent; /* if not the first pile, link entry to top of the preceding pile */ @@ -164,7 +164,7 @@ protected: */ entry* ent=entries()[num_piles-1].pile_top_entry; - for(std::size_t n=num_piles;n--;){ + for(std::size_t np=num_piles;np--;){ ent->ordered=true; ent=ent->previous; } diff --git a/boost/multi_index/ordered_index.hpp b/boost/multi_index/ordered_index.hpp index 20475e0..23308fb 100644 --- a/boost/multi_index/ordered_index.hpp +++ b/boost/multi_index/ordered_index.hpp @@ -438,9 +438,9 @@ public: template iterator find( - const CompatibleKey& x,const CompatibleCompare& comp)const + const CompatibleKey& x,const CompatibleCompare& comp_)const { - return make_iterator(ordered_index_find(root(),header(),key,x,comp)); + return make_iterator(ordered_index_find(root(),header(),key,x,comp_)); } template @@ -450,9 +450,9 @@ public: } template - size_type count(const CompatibleKey& x,const CompatibleCompare& comp)const + size_type count(const CompatibleKey& x,const CompatibleCompare& comp_)const { - std::pair p=equal_range(x,comp); + std::pair p=equal_range(x,comp_); size_type n=std::distance(p.first,p.second); return n; } @@ -466,10 +466,10 @@ public: template iterator lower_bound( - const CompatibleKey& x,const CompatibleCompare& comp)const + const CompatibleKey& x,const CompatibleCompare& comp_)const { return make_iterator( - ordered_index_lower_bound(root(),header(),key,x,comp)); + ordered_index_lower_bound(root(),header(),key,x,comp_)); } template @@ -481,10 +481,10 @@ public: template iterator upper_bound( - const CompatibleKey& x,const CompatibleCompare& comp)const + const CompatibleKey& x,const CompatibleCompare& comp_)const { return make_iterator( - ordered_index_upper_bound(root(),header(),key,x,comp)); + ordered_index_upper_bound(root(),header(),key,x,comp_)); } template @@ -499,10 +499,10 @@ public: template std::pair equal_range( - const CompatibleKey& x,const CompatibleCompare& comp)const + const CompatibleKey& x,const CompatibleCompare& comp_)const { std::pair p= - ordered_index_equal_range(root(),header(),key,x,comp); + ordered_index_equal_range(root(),header(),key,x,comp_); return std::pair( make_iterator(p.first),make_iterator(p.second)); } diff --git a/boost/optional/optional.hpp b/boost/optional/optional.hpp index ec9006e..e3d4245 100644 --- a/boost/optional/optional.hpp +++ b/boost/optional/optional.hpp @@ -890,12 +890,12 @@ bool operator >= ( optional const& x, none_t y ) template inline -bool operator == ( none_t x, optional const& y ) +bool operator == ( none_t, optional const& y ) { return equal_pointees(optional() ,y); } template inline -bool operator < ( none_t x, optional const& y ) +bool operator < ( none_t, optional const& y ) { return less_pointees(optional() ,y); } template diff --git a/boost/parameter/aux_/tagged_argument.hpp b/boost/parameter/aux_/tagged_argument.hpp index 6248be2..54b63ab 100644 --- a/boost/parameter/aux_/tagged_argument.hpp +++ b/boost/parameter/aux_/tagged_argument.hpp @@ -120,13 +120,13 @@ struct tagged_argument : tagged_argument_base } # else template - reference operator[](default_ const& x) const + reference operator[](default_ const&) const { return value; } template - reference operator[](lazy_default const& x) const + reference operator[](lazy_default const&) const { return value; } diff --git a/boost/regex/v4/basic_regex_parser.hpp b/boost/regex/v4/basic_regex_parser.hpp index 72dc4ee..5dfb81e 100644 --- a/boost/regex/v4/basic_regex_parser.hpp +++ b/boost/regex/v4/basic_regex_parser.hpp @@ -1107,7 +1107,7 @@ bool basic_regex_parser::parse_repeat_range(bool isbasic) } // get the value if any: v = this->m_traits.toi(m_position, m_end, 10); - max = (v >= 0) ? v : (std::numeric_limits::max)(); + max = (v >= 0) ? (std::size_t)v : (std::numeric_limits::max)(); } else { diff --git a/boost/serialization/smart_cast.hpp b/boost/serialization/smart_cast.hpp index c240a55..61bd3ed 100644 --- a/boost/serialization/smart_cast.hpp +++ b/boost/serialization/smart_cast.hpp @@ -249,7 +249,7 @@ namespace smart_cast_impl { // cast on a system which doesn't support partial template // specialization template - static T cast(U u){ + static T cast(U){ BOOST_STATIC_ASSERT(sizeof(T)==0); return * static_cast(NULL); } diff --git a/boost/token_functions.hpp b/boost/token_functions.hpp index 4d1a1df..1f24efa 100644 --- a/boost/token_functions.hpp +++ b/boost/token_functions.hpp @@ -309,7 +309,7 @@ namespace boost{ template <> struct assign_or_plus_equal { template - static void assign(Iterator b, Iterator e, Token &t) { } + static void assign(Iterator, Iterator, Token &) { } template static void plus_equal(Token &t, const Value &v) { t += v; diff --git a/boost/xpressive/match_results.hpp b/boost/xpressive/match_results.hpp index 6e9516d..ae1cd40 100644 --- a/boost/xpressive/match_results.hpp +++ b/boost/xpressive/match_results.hpp @@ -934,7 +934,7 @@ private: ( OutputIterator out , Expr const &format - , regex_constants::match_flag_type flags + , regex_constants::match_flag_type , mpl::size_t<4> ) const { diff --git a/boost/xpressive/traits/cpp_regex_traits.hpp b/boost/xpressive/traits/cpp_regex_traits.hpp index 74a904c..751ec13 100644 --- a/boost/xpressive/traits/cpp_regex_traits.hpp +++ b/boost/xpressive/traits/cpp_regex_traits.hpp @@ -467,7 +467,7 @@ struct cpp_regex_traits /// /// \attention Not currently used template - string_type transform(FwdIter begin, FwdIter end) const + string_type transform(FwdIter, FwdIter) const { //string_type str(begin, end); //return this->transform(str.data(), str.data() + str.size()); @@ -483,7 +483,7 @@ struct cpp_regex_traits /// /// \attention Not currently used template - string_type transform_primary(FwdIter begin, FwdIter end) const + string_type transform_primary(FwdIter, FwdIter ) const { BOOST_ASSERT(false); // TODO implement me return string_type(); @@ -495,7 +495,7 @@ struct cpp_regex_traits /// /// \attention Not currently used template - string_type lookup_collatename(FwdIter begin, FwdIter end) const + string_type lookup_collatename(FwdIter, FwdIter) const { BOOST_ASSERT(false); // TODO implement me return string_type(); -- 1.7.11.1