Emscripten workarounds and llvm syntax fixes
[platform/core/uifw/dali-core.git] / dali / integration-api / common / lockless-buffer.cpp
index 3f362ae..3f36c78 100644 (file)
@@ -57,7 +57,9 @@ void LocklessBuffer::Write( const unsigned char *src, size_t size )
   memcpy( mBuffer[index], src, size );
 
   // unset WRITING bit, set UPDATED bit
-  BufferState checkState = __sync_val_compare_and_swap( &mState, (currentState | WRITING), (index | UPDATED) );
+  BufferState checkState = __sync_val_compare_and_swap( &mState,
+                                                        static_cast<BufferState>(currentState | WRITING),
+                                                        static_cast<BufferState>(index | UPDATED) );
 
   DALI_ASSERT_DEBUG( checkState & WRITING );
   (void)checkState; // Avoid unused variable warning
@@ -73,7 +75,9 @@ const unsigned char* LocklessBuffer::Read()
   {
     // Try to swap buffers.
     // This will set mState to 1 if readbuffer 0 was updated, 0 if readbuffer 1 was updated and fail if WRITING is set
-    if( __sync_bool_compare_and_swap( &mState, currentWriteBuf | UPDATED, !currentWriteBuf ) )
+    if( __sync_bool_compare_and_swap( &mState,
+                                      static_cast<BufferState>(currentWriteBuf | UPDATED),
+                                      static_cast<BufferState>(!currentWriteBuf) )  )
     {
       // swap successful
       return mBuffer[currentWriteBuf];