add a few missing casts

This commit is contained in:
Lennart Poettering 2008-08-20 03:33:06 +03:00
parent a3e57da0f0
commit dc9b8dce30
7 changed files with 20 additions and 20 deletions

View file

@ -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 {