summaryrefslogtreecommitdiffstats
path: root/src/pulsecore/atomic.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/pulsecore/atomic.h')
-rw-r--r--src/pulsecore/atomic.h12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/pulsecore/atomic.h b/src/pulsecore/atomic.h
index a91c4d56..072943ab 100644
--- a/src/pulsecore/atomic.h
+++ b/src/pulsecore/atomic.h
@@ -420,7 +420,7 @@ typedef struct pa_atomic {
volatile AO_t value;
} pa_atomic_t;
-#define PA_ATOMIC_INIT(v) { .value = (v) }
+#define PA_ATOMIC_INIT(v) { .value = (AO_t) (v) }
static inline int pa_atomic_load(const pa_atomic_t *a) {
return (int) AO_load_full((AO_t*) &a->value);
@@ -431,23 +431,23 @@ static inline void pa_atomic_store(pa_atomic_t *a, int i) {
}
static inline int pa_atomic_add(pa_atomic_t *a, int i) {
- return AO_fetch_and_add_full(&a->value, (AO_t) i);
+ return (int) AO_fetch_and_add_full(&a->value, (AO_t) i);
}
static inline int pa_atomic_sub(pa_atomic_t *a, int i) {
- return AO_fetch_and_add_full(&a->value, (AO_t) -i);
+ return (int) AO_fetch_and_add_full(&a->value, (AO_t) -i);
}
static inline int pa_atomic_inc(pa_atomic_t *a) {
- return AO_fetch_and_add1_full(&a->value);
+ return (int) AO_fetch_and_add1_full(&a->value);
}
static inline int pa_atomic_dec(pa_atomic_t *a) {
- return AO_fetch_and_sub1_full(&a->value);
+ return (int) AO_fetch_and_sub1_full(&a->value);
}
static inline int pa_atomic_cmpxchg(pa_atomic_t *a, int old_i, int new_i) {
- return AO_compare_and_swap_full(&a->value, old_i, new_i);
+ return AO_compare_and_swap_full(&a->value, (unsigned long) old_i, (unsigned long) new_i);
}
typedef struct pa_atomic_ptr {