summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to '3rdParty/Boost/src/boost/function/function_base.hpp')
-rw-r--r--3rdParty/Boost/src/boost/function/function_base.hpp24
1 files changed, 15 insertions, 9 deletions
diff --git a/3rdParty/Boost/src/boost/function/function_base.hpp b/3rdParty/Boost/src/boost/function/function_base.hpp
index fe9bbbe..78b7dd1 100644
--- a/3rdParty/Boost/src/boost/function/function_base.hpp
+++ b/3rdParty/Boost/src/boost/function/function_base.hpp
@@ -203,11 +203,11 @@ namespace boost {
{
switch (op) {
case clone_functor_tag:
- out_buffer.obj_ref.obj_ptr = in_buffer.obj_ref.obj_ptr;
+ out_buffer.obj_ref = in_buffer.obj_ref;
return;
case move_functor_tag:
- out_buffer.obj_ref.obj_ptr = in_buffer.obj_ref.obj_ptr;
+ out_buffer.obj_ref = in_buffer.obj_ref;
in_buffer.obj_ref.obj_ptr = 0;
return;
@@ -315,14 +315,18 @@ namespace boost {
if (op == clone_functor_tag || op == move_functor_tag) {
const functor_type* in_functor =
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) {
- 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) {
// 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) {
const detail::sp_typeinfo& check_type
= *out_buffer.type.type;
@@ -369,8 +373,10 @@ namespace boost {
// Clone the functor
// GCC 2.95.3 gets the CV qualifiers wrong here, so we
// 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*)(in_buffer.obj_ptr);
+ static_cast<const functor_type*>(in_buffer.obj_ptr);
functor_type* new_f = new functor_type(*f);
out_buffer.obj_ptr = new_f;
} else if (op == move_functor_tag) {
@@ -474,7 +480,7 @@ namespace boost {
// GCC 2.95.3 gets the CV qualifiers wrong here, so we
// can't do the static_cast that we should do.
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_pointer_type copy = wrapper_allocator.allocate(1);
wrapper_allocator.construct(copy, *f);
@@ -671,7 +677,7 @@ public:
detail::function::check_functor_type_tag);
// GCC 2.95.3 gets the CV qualifiers wrong here, so we
// 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>
@@ -715,7 +721,7 @@ public:
public: // should be protected, but GCC 2.95.3 will fail to allow access
detail::function::vtable_base* get_vtable() const {
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 {