From 8760088d44cd98c11b916840f6b69ccf761e2eb2 Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Mon, 30 Sep 2013 00:16:55 +0000 Subject: [PATCH 1/5] Function: Remove obsolete MSVC version checks. [SVN r86018] --- include/boost/function/function_base.hpp | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/include/boost/function/function_base.hpp b/include/boost/function/function_base.hpp index 78b7dd1..d4438ce 100644 --- a/include/boost/function/function_base.hpp +++ b/include/boost/function/function_base.hpp @@ -66,11 +66,11 @@ # define BOOST_FUNCTION_COMPARE_TYPE_ID(X,Y) ((X)==(Y)) #endif -#if defined(BOOST_MSVC) && BOOST_MSVC <= 1300 || defined(__ICL) && __ICL <= 600 || defined(__MWERKS__) && __MWERKS__ < 0x2406 && !defined(BOOST_STRICT_CONFIG) +#if defined(__ICL) && __ICL <= 600 || defined(__MWERKS__) && __MWERKS__ < 0x2406 && !defined(BOOST_STRICT_CONFIG) # define BOOST_FUNCTION_TARGET_FIX(x) x #else # define BOOST_FUNCTION_TARGET_FIX(x) -#endif // not MSVC +#endif // __ICL etc #if !BOOST_WORKAROUND(__BORLANDC__, < 0x5A0) # define BOOST_FUNCTION_ENABLE_IF_NOT_INTEGRAL(Functor,Type) \ @@ -661,11 +661,7 @@ public: } template -#if defined(BOOST_MSVC) && BOOST_WORKAROUND(BOOST_MSVC, < 1300) - const Functor* target( Functor * = 0 ) const -#else const Functor* target() const -#endif { if (!vtable) return 0; @@ -683,11 +679,7 @@ public: template bool contains(const F& f) const { -#if defined(BOOST_MSVC) && BOOST_WORKAROUND(BOOST_MSVC, < 1300) - if (const F* fp = this->target( (F*)0 )) -#else if (const F* fp = this->template target()) -#endif { return function_equal(*fp, f); } else { From 8d5a27fb857aa23a07a0a8b3bb9af72aa209bb93 Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Tue, 1 Oct 2013 08:46:26 +0000 Subject: [PATCH 2/5] Function: Remove obsolete GCC version check. [SVN r86111] --- include/boost/function/function_base.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/boost/function/function_base.hpp b/include/boost/function/function_base.hpp index d4438ce..f3663d7 100644 --- a/include/boost/function/function_base.hpp +++ b/include/boost/function/function_base.hpp @@ -56,7 +56,7 @@ // need to use std::type_info::name to compare instead of operator==. #if defined( BOOST_NO_TYPEID ) # define BOOST_FUNCTION_COMPARE_TYPE_ID(X,Y) ((X)==(Y)) -#elif (defined(__GNUC__) && __GNUC__ >= 3) \ +#elif defined(__GNUC__) \ || defined(_AIX) \ || ( defined(__sgi) && defined(__host_mips)) # include From ea19e9e7452334e10045cea4d42c8611d4bb4cf9 Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Fri, 11 Oct 2013 23:22:36 +0000 Subject: [PATCH 3/5] Remove remaining occurances of BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION These evaded scripting. [SVN r86249] --- include/boost/function/function_fwd.hpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/include/boost/function/function_fwd.hpp b/include/boost/function/function_fwd.hpp index fb318c9..e79b504 100644 --- a/include/boost/function/function_fwd.hpp +++ b/include/boost/function/function_fwd.hpp @@ -19,8 +19,7 @@ namespace boost { namespace python { namespace objects { }}} #endif -#if defined (BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) \ - || defined(BOOST_BCB_PARTIAL_SPECIALIZATION_BUG) \ +#if defined(BOOST_BCB_PARTIAL_SPECIALIZATION_BUG) \ || !(defined(BOOST_STRICT_CONFIG) || !defined(__SUNPRO_CC) || __SUNPRO_CC > 0x540) # define BOOST_FUNCTION_NO_FUNCTION_TYPE_SYNTAX #endif From 250655ad6d710359e1a7bdce81cdcc47bb70be51 Mon Sep 17 00:00:00 2001 From: Marshall Clow Date: Fri, 31 Jan 2014 19:42:29 -0800 Subject: [PATCH 4/5] Add 'std:' qualification to size_t. Fixes Bug #6184 --- include/boost/function/function_template.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/boost/function/function_template.hpp b/include/boost/function/function_template.hpp index 73ed72e..1ec13d0 100644 --- a/include/boost/function/function_template.hpp +++ b/include/boost/function/function_template.hpp @@ -938,7 +938,7 @@ namespace boost { if (boost::has_trivial_copy_constructor::value && boost::has_trivial_destructor::value && detail::function::function_allows_small_object_optimization::value) - value |= static_cast(0x01); + value |= static_cast(0x01); vtable = reinterpret_cast(value); } else vtable = 0; From 9f06e35e8d8e886b87e7f3ddf846e59a2c282613 Mon Sep 17 00:00:00 2001 From: Marshall Clow Date: Fri, 31 Jan 2014 19:50:02 -0800 Subject: [PATCH 5/5] Add coverity comments to silence Coverity warnings --- include/boost/function/function_template.hpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/boost/function/function_template.hpp b/include/boost/function/function_template.hpp index 1ec13d0..72b7fab 100644 --- a/include/boost/function/function_template.hpp +++ b/include/boost/function/function_template.hpp @@ -935,6 +935,7 @@ namespace boost { if (stored_vtable.assign_to(f, functor)) { std::size_t value = reinterpret_cast(&stored_vtable.base); + // coverity[pointless_expression]: suppress coverity warnings on apparant if(const). if (boost::has_trivial_copy_constructor::value && boost::has_trivial_destructor::value && detail::function::function_allows_small_object_optimization::value) @@ -969,6 +970,7 @@ namespace boost { if (stored_vtable.assign_to_a(f, functor, a)) { std::size_t value = reinterpret_cast(&stored_vtable.base); + // coverity[pointless_expression]: suppress coverity warnings on apparant if(const). if (boost::has_trivial_copy_constructor::value && boost::has_trivial_destructor::value && detail::function::function_allows_small_object_optimization::value)