diff options
Diffstat (limited to 'boost/atomic/detail/ops_gcc_sparc.hpp')
-rw-r--r-- | boost/atomic/detail/ops_gcc_sparc.hpp | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/boost/atomic/detail/ops_gcc_sparc.hpp b/boost/atomic/detail/ops_gcc_sparc.hpp index 9191c13255..19b9b1fa87 100644 --- a/boost/atomic/detail/ops_gcc_sparc.hpp +++ b/boost/atomic/detail/ops_gcc_sparc.hpp @@ -35,13 +35,14 @@ namespace detail { struct gcc_sparc_cas_base { + static BOOST_CONSTEXPR_OR_CONST bool full_cas_based = true; static BOOST_CONSTEXPR_OR_CONST bool is_always_lock_free = true; static BOOST_FORCEINLINE void fence_before(memory_order order) BOOST_NOEXCEPT { if (order == memory_order_seq_cst) __asm__ __volatile__ ("membar #Sync" ::: "memory"); - else if ((order & memory_order_release) != 0) + else if ((static_cast< unsigned int >(order) & static_cast< unsigned int >(memory_order_release)) != 0u) __asm__ __volatile__ ("membar #StoreStore | #LoadStore" ::: "memory"); } @@ -49,7 +50,7 @@ struct gcc_sparc_cas_base { if (order == memory_order_seq_cst) __asm__ __volatile__ ("membar #Sync" ::: "memory"); - else if ((order & (memory_order_consume | memory_order_acquire)) != 0) + else if ((static_cast< unsigned int >(order) & (static_cast< unsigned int >(memory_order_consume) | static_cast< unsigned int >(memory_order_acquire))) != 0u) __asm__ __volatile__ ("membar #StoreStore | #LoadStore" ::: "memory"); } @@ -64,8 +65,8 @@ template< bool Signed > struct gcc_sparc_cas32 : public gcc_sparc_cas_base { - typedef typename make_storage_type< 4u, Signed >::type storage_type; - typedef typename make_storage_type< 4u, Signed >::aligned aligned_storage_type; + typedef typename make_storage_type< 4u >::type storage_type; + typedef typename make_storage_type< 4u >::aligned aligned_storage_type; static BOOST_CONSTEXPR_OR_CONST std::size_t storage_size = 4u; static BOOST_CONSTEXPR_OR_CONST bool is_signed = Signed; @@ -148,8 +149,8 @@ template< bool Signed > struct gcc_sparc_cas64 : public gcc_sparc_cas_base { - typedef typename make_storage_type< 8u, Signed >::type storage_type; - typedef typename make_storage_type< 8u, Signed >::aligned aligned_storage_type; + typedef typename make_storage_type< 8u >::type storage_type; + typedef typename make_storage_type< 8u >::aligned aligned_storage_type; static BOOST_CONSTEXPR_OR_CONST std::size_t storage_size = 8u; static BOOST_CONSTEXPR_OR_CONST bool is_signed = Signed; |