From: khizmax Date: Mon, 13 Oct 2014 06:28:52 +0000 (+0400) Subject: fix TsigasCycleQueue clang compatibility X-Git-Tag: v2.0.0~201 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=d94f0f223cfbe9f4dccdd9c0dbc6193321de8fea;p=libcds.git fix TsigasCycleQueue clang compatibility --- diff --git a/cds/intrusive/tsigas_cycle_queue.h b/cds/intrusive/tsigas_cycle_queue.h index d2fa48e3..71220e90 100644 --- a/cds/intrusive/tsigas_cycle_queue.h +++ b/cds/intrusive/tsigas_cycle_queue.h @@ -179,12 +179,12 @@ namespace cds { namespace intrusive { protected: //@cond - static CDS_CONSTEXPR value_type * const free0 = nullptr; - static CDS_CONSTEXPR value_type * const free1 = free0 + 1; + static CDS_CONSTEXPR intptr_t const free0 = 0; + static CDS_CONSTEXPR intptr_t const free1 = 1; static bool is_free( const value_type * p ) CDS_NOEXCEPT { - return p == free0 || p == free1; + return p == reinterpret_cast(free0) || p == reinterpret_cast(free1); } size_t CDS_CONSTEXPR buffer_capacity() const CDS_NOEXCEPT @@ -264,7 +264,7 @@ namespace cds { namespace intrusive { continue; } - if ( tt == free1 ) + if ( tt == reinterpret_cast(free1) ) pNewNode = reinterpret_cast(reinterpret_cast( pNewNode ) | 1); if ( te != m_nTail.load(memory_model::memory_order_relaxed) ) continue; @@ -323,7 +323,7 @@ namespace cds { namespace intrusive { continue; } - pNull = (reinterpret_cast( tt ) & 1) ? free0 : free1; + pNull = reinterpret_cast((reinterpret_cast(tt)& 1) ? free0 : free1); if ( th != m_nHead.load(memory_model::memory_order_relaxed) ) continue;