boostorg / lockfree

Boost.Lockfree
125 stars 86 forks source link

Fix two VS2010 warnings caused by implicit widening followed by narrowing #13

Closed cdglove closed 9 years ago

cdglove commented 9 years ago

This change fixes the following warnings triggered by lockfree;

boost/lockfree/detail/freelist.hpp(299) : warning C4365: 'initializing' : conversion from 'int' to 'boost::lockfree::detail::tagged_index::tag_t', signed/unsigned mismatch boost/lockfree/detail/tagged_ptr_ptrcompression.hpp(59) : warning C4242: '=' : conversion from 'int' to 'boost::lockfree::detail::tagged_ptr::tag_t', possible loss of data boost/lockfree/detail/tagged_ptr_ptrcompression.hpp(59) : warning C4365: '=' : conversion from 'int' to 'boost::lockfree::detail::tagged_ptr::tag_t', signed/unsigned mismatch boost/lockfree/detail/tagged_ptr_ptrcompression.hpp(135) : warning C4365: 'initializing' : conversion from 'int' to 'boost::lockfree::detail::tagged_ptr::tag_t', signed/unsigned mismatch boost/lockfree/detail/tagged_ptr_ptrcompression.hpp(59) : warning C4242: '=' : conversion from 'int' to 'boost::lockfree::detail::tagged_ptr::tag_t', possible loss of data boost/lockfree/detail/tagged_ptr_ptrcompression.hpp(59) : warning C4365: '=' : conversion from 'int' to 'boost::lockfree::detail::tagged_ptr::tag_t', signed/unsigned mismatch

This can be reproduced with the following minimal test;

// Compile with cl.exe /Wall /I%BOOST_ROOT% /EHsc /DBOOST_ALL_NO_LIB

include

int main() { boost::lockfree::stack s(32); return 0; }

cdglove commented 9 years ago

Apologies for having to recreate the pull request. Somehow I messed up my depot state and had to recreate it.