Ticket #5995: old-style-cast.patch
File old-style-cast.patch, 12.7 KB (added by , 11 years ago) |
---|
-
boost/circular_buffer/debug.hpp
130 130 void invalidate_iterators(const Iterator& it) { 131 131 const debug_iterator_base* previous = 0; 132 132 for (const debug_iterator_base* p = m_iterators; p != 0; p = p->next()) { 133 if (( (Iterator*)p)->m_it == it.m_it) {133 if ((static_cast<const Iterator*>(p))->m_it == it.m_it) { 134 134 p->invalidate(); 135 135 remove(p, previous); 136 136 continue; … … 144 144 void invalidate_iterators_except(const Iterator& it) { 145 145 const debug_iterator_base* previous = 0; 146 146 for (const debug_iterator_base* p = m_iterators; p != 0; p = p->next()) { 147 if (( (Iterator*)p)->m_it != it.m_it) {147 if ((static_cast<Iterator*>(p))->m_it != it.m_it) { 148 148 p->invalidate(); 149 149 remove(p, previous); 150 150 continue; -
boost/function/function_template.hpp
625 625 assign_to(const reference_wrapper<FunctionObj>& f, 626 626 function_buffer& functor, function_obj_ref_tag) const 627 627 { 628 functor.obj_ref.obj_ptr = (void *)(f.get_pointer());628 functor.obj_ref.obj_ptr = static_cast<void *>(f.get_pointer()); 629 629 functor.obj_ref.is_const_qualified = is_const<FunctionObj>::value; 630 630 functor.obj_ref.is_volatile_qualified = is_volatile<FunctionObj>::value; 631 631 return true; -
boost/ptr_container/ptr_sequence_adapter.hpp
427 427 BOOST_DEDUCED_TYPENAME PtrSeqAdapter::iterator last, 428 428 PtrSeqAdapter& from ) // strong 429 429 { 430 BOOST_ASSERT( (void*)&from != (void*)this);430 BOOST_ASSERT( static_cast<void*>(&from) != static_cast<void*>(this) ); 431 431 if( from.empty() ) 432 432 return; 433 433 this->base(). … … 440 440 BOOST_DEDUCED_TYPENAME PtrSeqAdapter::iterator object, 441 441 PtrSeqAdapter& from ) // strong 442 442 { 443 BOOST_ASSERT( (void*)&from != (void*)this);443 BOOST_ASSERT( static_cast<void*>(&from) != static_cast<void*>(this) ); 444 444 if( from.empty() ) 445 445 return; 446 446 this->base().insert( before.base(), *object.base() ); // strong … … 462 462 template< class PtrSeqAdapter > 463 463 void transfer( iterator before, PtrSeqAdapter& from ) // strong 464 464 { 465 BOOST_ASSERT( (void*)&from != (void*)this);465 BOOST_ASSERT( static_cast<void*>(&from) != static_cast<void*>(this) ); 466 466 if( from.empty() ) 467 467 return; 468 468 this->base(). -
boost/unordered/detail/buckets.hpp
583 583 584 584 void construct(bool which, H const& hf, P const& eq) 585 585 { 586 new( (void*) &funcs_[which]) function_pair(hf, eq);586 new(static_cast<void*> (&funcs_[which])) function_pair(hf, eq); 587 587 } 588 588 589 589 void construct(bool which, function_pair const& f) 590 590 { 591 new( (void*) &funcs_[which]) function_pair(f);591 new(static_cast<void*> (&funcs_[which])) function_pair(f); 592 592 } 593 593 594 594 void destroy(bool which) 595 595 { 596 boost::unordered::detail::destroy( (function_pair*)(&funcs_[which]));596 boost::unordered::detail::destroy(reinterpret_cast<function_pair*>(&funcs_[which])); 597 597 } 598 598 599 599 public: -
boost/unordered/detail/allocator_helpers.hpp
444 444 boost::unordered::detail::has_construct<Alloc, T>::value>::type 445 445 construct(Alloc&, T* p, T const& x) 446 446 { 447 new ( (void*) p) T(x);447 new (static_cast<void*>(p)) T(x); 448 448 } 449 449 450 450 template <typename T> -
boost/unordered/detail/emplace_args.hpp
178 178 template<typename T> \ 179 179 void construct_from_tuple(T* ptr, namespace_::tuple<>) \ 180 180 { \ 181 new ( (void*) ptr) T();\181 new (static_cast<void*> (ptr)) T(); \ 182 182 } \ 183 183 \ 184 184 BOOST_PP_REPEAT_FROM_TO(1, n, \ … … 189 189 void construct_from_tuple(T* ptr, \ 190 190 namespace_::tuple<BOOST_PP_ENUM_PARAMS_Z(z, n, A)> const& x) \ 191 191 { \ 192 new ( (void*) ptr) T(\192 new (static_cast<void*> (ptr)) T( \ 193 193 BOOST_PP_ENUM_##z(n, BOOST_UNORDERED_GET_TUPLE_ARG, namespace_) \ 194 194 ); \ 195 195 } … … 332 332 BOOST_PP_ENUM_PARAMS_Z(z, num_params, A) \ 333 333 > const& args) \ 334 334 { \ 335 new( (void*) address) T(\335 new(static_cast<void*> (address)) T( \ 336 336 BOOST_PP_ENUM_##z(num_params, BOOST_UNORDERED_CALL_FORWARD, \ 337 337 args.a)); \ 338 338 } … … 408 408 template <typename T, typename A0> 409 409 inline void construct_impl2(T* address, BOOST_FWD_REF(A0) a0) 410 410 { 411 new( (void*) address) T(411 new(static_cast<void*> (address)) T( 412 412 boost::forward<A0>(a0) 413 413 ); 414 414 } -
boost/unordered/detail/table.hpp
285 285 } 286 286 287 287 value_type& value() { 288 return * (ValueType*) this;288 return *value_ptr(); 289 289 } 290 290 291 291 value_type* value_ptr() { 292 return (ValueType*) this;292 return reinterpret_cast<ValueType*> (this); 293 293 } 294 294 295 295 private: -
boost/mpl/assert.hpp
219 219 std::size_t \ 220 220 , BOOST_PP_CAT(mpl_assertion_in_line_,BOOST_MPL_AUX_PP_COUNTER()) = sizeof( \ 221 221 boost::mpl::assertion_failed<false>( \ 222 boost::mpl::assert_arg( (void (*) pred)0, 1 ) \222 boost::mpl::assert_arg( static_cast<void (*) pred>(0), 1 ) \ 223 223 ) \ 224 224 ) \ 225 225 ) \ … … 243 243 std::size_t \ 244 244 , BOOST_PP_CAT(mpl_assertion_in_line_,BOOST_MPL_AUX_PP_COUNTER()) = sizeof( \ 245 245 boost::mpl::assertion_failed<false>( \ 246 boost::mpl::assert_not_arg( (void (*) pred)0, 1 ) \246 boost::mpl::assert_not_arg( static_cast<void (*) pred>(0), 1 ) \ 247 247 ) \ 248 248 ) \ 249 249 ) \ … … 262 262 std::size_t \ 263 263 , BOOST_PP_CAT(mpl_assertion_in_line_,counter) = sizeof( \ 264 264 boost::mpl::assertion_failed<BOOST_PP_CAT(mpl_assert_rel_value,counter)>( \ 265 (boost::mpl::failed ************ ( boost::mpl::assert_relation< \265 static_cast<boost::mpl::failed ************ ( boost::mpl::assert_relation< \ 266 266 boost::mpl::assert_::relations( sizeof( \ 267 267 boost::mpl::assert_::arg rel boost::mpl::assert_::arg \ 268 268 ) ) \ 269 269 , x \ 270 270 , y \ 271 >::************) ) 0) \271 >::************)> (0) ) \ 272 272 ) \ 273 273 ) \ 274 274 /**/ -
boost/functional/hash/detail/hash_float.hpp
66 66 case FP_ZERO: 67 67 return 0; 68 68 case FP_INFINITE: 69 return (std::size_t)(v > 0 ? -1 : -2);69 return static_cast<std::size_t>(v > 0 ? -1 : -2); 70 70 case FP_NAN: 71 return (std::size_t)(-3);71 return static_cast<std::size_t>(-3); 72 72 case FP_NORMAL: 73 73 case FP_SUBNORMAL: 74 74 return float_hash_impl(v); -
boost/functional/hash/hash.hpp
113 113 // Hopefully, this loop can be unrolled. 114 114 for(unsigned int i = length * size_t_bits; i > 0; i -= size_t_bits) 115 115 { 116 seed ^= (std::size_t)(positive >> i) + (seed<<6) + (seed>>2);116 seed ^= static_cast<std::size_t> (positive >> i) + (seed<<6) + (seed>>2); 117 117 } 118 seed ^= (std::size_t) val+ (seed<<6) + (seed>>2);118 seed ^= static_cast<std::size_t> (val) + (seed<<6) + (seed>>2); 119 119 120 120 return seed; 121 121 } … … 133 133 // Hopefully, this loop can be unrolled. 134 134 for(unsigned int i = length * size_t_bits; i > 0; i -= size_t_bits) 135 135 { 136 seed ^= (std::size_t)(val >> i) + (seed<<6) + (seed>>2);136 seed ^= static_cast<std::size_t> (val >> i) + (seed<<6) + (seed>>2); 137 137 } 138 seed ^= (std::size_t) val+ (seed<<6) + (seed>>2);138 seed ^= static_cast<std::size_t> (val) + (seed<<6) + (seed>>2); 139 139 140 140 return seed; 141 141 } -
boost/concept/detail/general.hpp
27 27 template <class Model> 28 28 struct requirement 29 29 { 30 static void failed() { ( (Model*)0)->~Model(); }30 static void failed() { (static_cast<Model*>(0))->~Model(); } 31 31 }; 32 32 33 33 struct failed {}; … … 35 35 template <class Model> 36 36 struct requirement<failed ************ Model::************> 37 37 { 38 static void failed() { ( (Model*)0)->~Model(); }38 static void failed() { (static_cast<Model*>(0))->~Model(); } 39 39 }; 40 40 41 41 # ifdef BOOST_OLD_CONCEPT_SUPPORT … … 43 43 template <class Model> 44 44 struct constraint 45 45 { 46 static void failed() { ( (Model*)0)->constraints(); }46 static void failed() { (static_cast<Model*>(0))->constraints(); } 47 47 }; 48 48 49 49 template <class Model> -
boost/concept/detail/has_constraints.hpp
41 41 { 42 42 BOOST_STATIC_CONSTANT( 43 43 bool 44 , value = sizeof( detail::has_constraints_( (Model*)0) ) == sizeof(detail::yes) );44 , value = sizeof( detail::has_constraints_(static_cast<Model*>(0)) ) == sizeof(detail::yes) ); 45 45 typedef mpl::bool_<value> type; 46 46 }; 47 47 -
boost/concept/usage.hpp
19 19 template <class Model> 20 20 struct usage_requirements 21 21 { 22 ~usage_requirements() { ( (Model*)0)->~Model(); }22 ~usage_requirements() { (static_cast<Model*>(0))->~Model(); } 23 23 }; 24 24 25 25 # if BOOST_WORKAROUND(__GNUC__, <= 3)