From dc9b8dce309728b47059b9b44fd3bbd3798667ae Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Wed, 20 Aug 2008 03:33:06 +0300 Subject: add a few missing casts --- src/pulsecore/atomic.h | 12 ++++++------ src/pulsecore/core-util.c | 2 +- src/pulsecore/protocol-native.c | 2 +- src/pulsecore/resampler.c | 4 ++-- src/pulsecore/tagstruct.c | 4 ++-- 5 files changed, 12 insertions(+), 12 deletions(-) (limited to 'src/pulsecore') 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 { diff --git a/src/pulsecore/core-util.c b/src/pulsecore/core-util.c index 41a31042..89416d8b 100644 --- a/src/pulsecore/core-util.c +++ b/src/pulsecore/core-util.c @@ -2041,7 +2041,7 @@ void *pa_will_need(const void *p, size_t l) { return (void*) p; } - bs = PA_PAGE_ALIGN(rlim.rlim_cur); + bs = PA_PAGE_ALIGN((size_t) rlim.rlim_cur); #else bs = PA_PAGE_SIZE*4; #endif diff --git a/src/pulsecore/protocol-native.c b/src/pulsecore/protocol-native.c index d4694a05..1ee7a971 100644 --- a/src/pulsecore/protocol-native.c +++ b/src/pulsecore/protocol-native.c @@ -1142,7 +1142,7 @@ static void handle_seek(playback_stream *s, int64_t indexw) { pa_log_debug("Requesting rewind due to end of underrun."); pa_sink_input_request_rewind(s->sink_input, - s->sink_input->thread_info.underrun_for == (size_t) -1 ? 0 : s->sink_input->thread_info.underrun_for, + (size_t) (s->sink_input->thread_info.underrun_for == (size_t) -1 ? 0 : s->sink_input->thread_info.underrun_for), FALSE, TRUE); } diff --git a/src/pulsecore/resampler.c b/src/pulsecore/resampler.c index ee953652..b20fc61f 100644 --- a/src/pulsecore/resampler.c +++ b/src/pulsecore/resampler.c @@ -1178,10 +1178,10 @@ static void libsamplerate_resample(pa_resampler *r, const pa_memchunk *input, un memset(&data, 0, sizeof(data)); data.data_in = (float*) ((uint8_t*) pa_memblock_acquire(input->memblock) + input->index); - data.input_frames = in_n_frames; + data.input_frames = (long int) in_n_frames; data.data_out = (float*) ((uint8_t*) pa_memblock_acquire(output->memblock) + output->index); - data.output_frames = *out_n_frames; + data.output_frames = (long int) *out_n_frames; data.src_ratio = (double) r->o_ss.rate / r->i_ss.rate; data.end_of_input = 0; diff --git a/src/pulsecore/tagstruct.c b/src/pulsecore/tagstruct.c index e5b228e9..62a30144 100644 --- a/src/pulsecore/tagstruct.c +++ b/src/pulsecore/tagstruct.c @@ -435,9 +435,9 @@ int pa_tagstruct_get_timeval(pa_tagstruct*t, struct timeval *tv) { return -1; memcpy(&tv->tv_sec, t->data+t->rindex+1, 4); - tv->tv_sec = ntohl((uint32_t) tv->tv_sec); + tv->tv_sec = (time_t) ntohl((uint32_t) tv->tv_sec); memcpy(&tv->tv_usec, t->data+t->rindex+5, 4); - tv->tv_usec = ntohl((uint32_t) tv->tv_usec); + tv->tv_usec = (suseconds_t) ntohl((uint32_t) tv->tv_usec); t->rindex += 9; return 0; } -- cgit