Compare commits

...

5 Commits

Author SHA1 Message Date
0a5d7d1356 v2, v3, integration branch
[SVN r62649]
2010-06-09 11:34:33 +00:00
6902f6f943 Applied patch from #4073; fixes #4073
[SVN r62623]
2010-06-09 00:51:41 +00:00
c4f1ce7cb1 Applied patch from #3912; fixes #3912
[SVN r62622]
2010-06-09 00:49:45 +00:00
820ad024fe Applied patch from #3618; fixes #3618
[SVN r62621]
2010-06-09 00:47:51 +00:00
2e19728cdb Removed all but one old-style cast, breaking GCC 2.95.3; fixes #3410
[SVN r62614]
2010-06-08 23:55:25 +00:00
4 changed files with 24 additions and 17 deletions

View File

@ -23,8 +23,8 @@
// in anything that may be included by function_template.hpp doesn't break // in anything that may be included by function_template.hpp doesn't break
#include <boost/function/detail/prologue.hpp> #include <boost/function/detail/prologue.hpp>
// Visual Age C++ doesn't handle the file iteration well // Older Visual Age C++ version do not handle the file iteration well
#if BOOST_WORKAROUND(__IBMCPP__, >= 500) #if BOOST_WORKAROUND(__IBMCPP__, >= 500) && BOOST_WORKAROUND(__IBMCPP__, < 800)
# if BOOST_FUNCTION_MAX_ARGS >= 0 # if BOOST_FUNCTION_MAX_ARGS >= 0
# include <boost/function/function0.hpp> # include <boost/function/function0.hpp>
# endif # endif

View File

@ -315,14 +315,18 @@ namespace boost {
if (op == clone_functor_tag || op == move_functor_tag) { if (op == clone_functor_tag || op == move_functor_tag) {
const functor_type* in_functor = const functor_type* in_functor =
reinterpret_cast<const functor_type*>(&in_buffer.data); reinterpret_cast<const functor_type*>(&in_buffer.data);
new ((void*)&out_buffer.data) functor_type(*in_functor); new (reinterpret_cast<void*>(&out_buffer.data)) functor_type(*in_functor);
if (op == move_functor_tag) { if (op == move_functor_tag) {
reinterpret_cast<functor_type*>(&in_buffer.data)->~Functor(); functor_type* f = reinterpret_cast<functor_type*>(&in_buffer.data);
(void)f; // suppress warning about the value of f not being used (MSVC)
f->~Functor();
} }
} else if (op == destroy_functor_tag) { } else if (op == destroy_functor_tag) {
// Some compilers (Borland, vc6, ...) are unhappy with ~functor_type. // Some compilers (Borland, vc6, ...) are unhappy with ~functor_type.
reinterpret_cast<functor_type*>(&out_buffer.data)->~Functor(); functor_type* f = reinterpret_cast<functor_type*>(&out_buffer.data);
(void)f; // suppress warning about the value of f not being used (MSVC)
f->~Functor();
} else if (op == check_functor_type_tag) { } else if (op == check_functor_type_tag) {
const detail::sp_typeinfo& check_type const detail::sp_typeinfo& check_type
= *out_buffer.type.type; = *out_buffer.type.type;
@ -369,8 +373,10 @@ namespace boost {
// Clone the functor // Clone the functor
// GCC 2.95.3 gets the CV qualifiers wrong here, so we // GCC 2.95.3 gets the CV qualifiers wrong here, so we
// can't do the static_cast that we should do. // can't do the static_cast that we should do.
// jewillco: Changing this to static_cast because GCC 2.95.3 is
// obsolete.
const functor_type* f = const functor_type* f =
(const functor_type*)(in_buffer.obj_ptr); static_cast<const functor_type*>(in_buffer.obj_ptr);
functor_type* new_f = new functor_type(*f); functor_type* new_f = new functor_type(*f);
out_buffer.obj_ptr = new_f; out_buffer.obj_ptr = new_f;
} else if (op == move_functor_tag) { } else if (op == move_functor_tag) {
@ -474,7 +480,7 @@ namespace boost {
// GCC 2.95.3 gets the CV qualifiers wrong here, so we // GCC 2.95.3 gets the CV qualifiers wrong here, so we
// can't do the static_cast that we should do. // can't do the static_cast that we should do.
const functor_wrapper_type* f = const functor_wrapper_type* f =
(const functor_wrapper_type*)(in_buffer.obj_ptr); static_cast<const functor_wrapper_type*>(in_buffer.obj_ptr);
wrapper_allocator_type wrapper_allocator(static_cast<Allocator const &>(*f)); wrapper_allocator_type wrapper_allocator(static_cast<Allocator const &>(*f));
wrapper_allocator_pointer_type copy = wrapper_allocator.allocate(1); wrapper_allocator_pointer_type copy = wrapper_allocator.allocate(1);
wrapper_allocator.construct(copy, *f); wrapper_allocator.construct(copy, *f);
@ -671,7 +677,7 @@ public:
detail::function::check_functor_type_tag); detail::function::check_functor_type_tag);
// GCC 2.95.3 gets the CV qualifiers wrong here, so we // GCC 2.95.3 gets the CV qualifiers wrong here, so we
// can't do the static_cast that we should do. // can't do the static_cast that we should do.
return (const Functor*)(type_result.obj_ptr); return static_cast<const Functor*>(type_result.obj_ptr);
} }
template<typename F> template<typename F>
@ -715,7 +721,7 @@ public:
public: // should be protected, but GCC 2.95.3 will fail to allow access public: // should be protected, but GCC 2.95.3 will fail to allow access
detail::function::vtable_base* get_vtable() const { detail::function::vtable_base* get_vtable() const {
return reinterpret_cast<detail::function::vtable_base*>( return reinterpret_cast<detail::function::vtable_base*>(
reinterpret_cast<std::size_t>(vtable) & ~(std::size_t)0x01); reinterpret_cast<std::size_t>(vtable) & ~static_cast<std::size_t>(0x01));
} }
bool has_trivial_copy_and_destroy() const { bool has_trivial_copy_and_destroy() const {

View File

@ -514,7 +514,7 @@ namespace boost {
if (f) { if (f) {
// should be a reinterpret cast, but some compilers insist // should be a reinterpret cast, but some compilers insist
// on giving cv-qualifiers to free functions // on giving cv-qualifiers to free functions
functor.func_ptr = (void (*)())(f); functor.func_ptr = reinterpret_cast<void (*)()>(f);
return true; return true;
} else { } else {
return false; return false;
@ -536,7 +536,7 @@ namespace boost {
// objects, so we invoke through mem_fn() but we retain the // objects, so we invoke through mem_fn() but we retain the
// right target_type() values. // right target_type() values.
if (f) { if (f) {
this->assign_to(mem_fn(f), functor); this->assign_to(boost::mem_fn(f), functor);
return true; return true;
} else { } else {
return false; return false;
@ -549,7 +549,7 @@ namespace boost {
// objects, so we invoke through mem_fn() but we retain the // objects, so we invoke through mem_fn() but we retain the
// right target_type() values. // right target_type() values.
if (f) { if (f) {
this->assign_to_a(mem_fn(f), functor, a); this->assign_to_a(boost::mem_fn(f), functor, a);
return true; return true;
} else { } else {
return false; return false;
@ -563,7 +563,7 @@ namespace boost {
void void
assign_functor(FunctionObj f, function_buffer& functor, mpl::true_) assign_functor(FunctionObj f, function_buffer& functor, mpl::true_)
{ {
new ((void*)&functor.data) FunctionObj(f); new (reinterpret_cast<void*>(&functor.data)) FunctionObj(f);
} }
template<typename FunctionObj,typename Allocator> template<typename FunctionObj,typename Allocator>
void void
@ -625,7 +625,7 @@ namespace boost {
assign_to(const reference_wrapper<FunctionObj>& f, assign_to(const reference_wrapper<FunctionObj>& f,
function_buffer& functor, function_obj_ref_tag) function_buffer& functor, function_obj_ref_tag)
{ {
functor.obj_ref.obj_ptr = (void *)f.get_pointer(); functor.obj_ref.obj_ptr = (void *)(f.get_pointer());
functor.obj_ref.is_const_qualified = is_const<FunctionObj>::value; functor.obj_ref.is_const_qualified = is_const<FunctionObj>::value;
functor.obj_ref.is_volatile_qualified = is_volatile<FunctionObj>::value; functor.obj_ref.is_volatile_qualified = is_volatile<FunctionObj>::value;
return true; return true;
@ -677,7 +677,7 @@ namespace boost {
vtable_type* get_vtable() const { vtable_type* get_vtable() const {
return reinterpret_cast<vtable_type*>( return reinterpret_cast<vtable_type*>(
reinterpret_cast<std::size_t>(vtable) & ~(std::size_t)0x01); reinterpret_cast<std::size_t>(vtable) & ~static_cast<size_t>(0x01));
} }
struct clear_type {}; struct clear_type {};
@ -917,7 +917,7 @@ namespace boost {
if (boost::has_trivial_copy_constructor<Functor>::value && if (boost::has_trivial_copy_constructor<Functor>::value &&
boost::has_trivial_destructor<Functor>::value && boost::has_trivial_destructor<Functor>::value &&
detail::function::function_allows_small_object_optimization<Functor>::value) detail::function::function_allows_small_object_optimization<Functor>::value)
value |= (std::size_t)0x01; value |= static_cast<size_t>(0x01);
vtable = reinterpret_cast<detail::function::vtable_base *>(value); vtable = reinterpret_cast<detail::function::vtable_base *>(value);
} else } else
vtable = 0; vtable = 0;
@ -951,7 +951,7 @@ namespace boost {
if (boost::has_trivial_copy_constructor<Functor>::value && if (boost::has_trivial_copy_constructor<Functor>::value &&
boost::has_trivial_destructor<Functor>::value && boost::has_trivial_destructor<Functor>::value &&
detail::function::function_allows_small_object_optimization<Functor>::value) detail::function::function_allows_small_object_optimization<Functor>::value)
value |= (std::size_t)0x01; value |= static_cast<std::size_t>(0x01);
vtable = reinterpret_cast<detail::function::vtable_base *>(value); vtable = reinterpret_cast<detail::function::vtable_base *>(value);
} else } else
vtable = 0; vtable = 0;

View File

@ -8,6 +8,7 @@
# For more information, see http://www.boost.org/ # For more information, see http://www.boost.org/
project project
: requirements <toolset>msvc:<asynch-exceptions>on
: source-location $(BOOST_ROOT) : source-location $(BOOST_ROOT)
; ;