Reduce some warnings using the atomic compatibility layer (cannot fix all)

This commit is contained in:
Patrick Pelissier committed 2020-07-01 11:06:58 +02:00
1 parent 47296e5c11
commit 3b347f2ba5
1 file changed
+3 -3
+3 -3
View File
@@ -222,7 +222,7 @@ static inline long long atomic_fetch_unlock (m_mutex_t *lock, long long val)
(m_mutex_lock((ptr)->_lock), \ (m_mutex_lock((ptr)->_lock), \
(ptr)->_previous = (ptr)->_val, \ (ptr)->_previous = (ptr)->_val, \
(ptr)->_val op (val), \ (ptr)->_val op (val), \
atomic_fetch_unlock(&(ptr)->_lock, (ptr)->_previous-(ptr)->_zero)+(ptr)->_zero) atomic_fetch_unlock(&(ptr)->_lock, (long long)((ptr)->_previous-(ptr)->_zero))+(ptr)->_zero)
/* Perform an atomic add (EMULATION) */ /* Perform an atomic add (EMULATION) */
#define atomic_fetch_add(ptr, val) atomic_fetch_op(ptr, val, +=) #define atomic_fetch_add(ptr, val) atomic_fetch_op(ptr, val, +=)
@@ -249,7 +249,7 @@ static inline long long atomic_fetch_unlock (m_mutex_t *lock, long long val)
#define atomic_load_lock(ptr) \ #define atomic_load_lock(ptr) \
(m_mutex_lock((ptr)->_lock), \ (m_mutex_lock((ptr)->_lock), \
(ptr)->_previous = (ptr)->_val, \ (ptr)->_previous = (ptr)->_val, \
atomic_fetch_unlock(&(ptr)->_lock, (ptr)->_previous-(ptr)->_zero)+(ptr)->_zero) atomic_fetch_unlock(&(ptr)->_lock, (long long) ((ptr)->_previous-(ptr)->_zero))+(ptr)->_zero)
/* (INTERNAL) Store an atomic variable within a lock /* (INTERNAL) Store an atomic variable within a lock
(needed for variable greater than CPU atomic size) */ (needed for variable greater than CPU atomic size) */
@@ -273,7 +273,7 @@ static inline long long atomic_fetch_unlock (m_mutex_t *lock, long long val)
if ( sizeof ((ptr)->_val) <= ATOMICI_MIN_RW_SIZE) { \ if ( sizeof ((ptr)->_val) <= ATOMICI_MIN_RW_SIZE) { \
(ptr)->_val = (val); \ (ptr)->_val = (val); \
} else { \ } else { \
long long _offset = (val) - (ptr)->_zero; \ long long _offset = (long long) ((val) - (ptr)->_zero); \
atomic_store_lock(ptr, (ptr)->_zero + _offset); \ atomic_store_lock(ptr, (ptr)->_zero + _offset); \
} \ } \
} while (0) } while (0)