summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMaarten Bosmans <mkbosmans@gmail.com>2011-03-02 12:41:24 +0100
committerColin Guthrie <cguthrie@mandriva.org>2011-03-02 15:02:42 +0000
commit9cbf19b59b3db50f2f91fdf5aa206889d97ed057 (patch)
tree359eb8332e395fcc1ff4e2b2ba90556e1cd710c9
parent53695b83dcd15df981b131b2cdd927d9f984a966 (diff)
Various fixes for build warnings
-rw-r--r--src/modules/udev-util.c2
-rw-r--r--src/pulse/volume.c2
-rw-r--r--src/pulsecore/ltdl-helper.c4
-rw-r--r--src/tests/mainloop-test.c2
-rw-r--r--src/tests/mix-test.c10
5 files changed, 7 insertions, 13 deletions
diff --git a/src/modules/udev-util.c b/src/modules/udev-util.c
index 52df1039..356f7736 100644
--- a/src/modules/udev-util.c
+++ b/src/modules/udev-util.c
@@ -74,7 +74,7 @@ static int dehex(char x) {
static void proplist_sets_unescape(pa_proplist *p, const char *prop, const char *s) {
const char *f;
char *t, *r;
- int c;
+ int c = 0;
enum {
TEXT,
diff --git a/src/pulse/volume.c b/src/pulse/volume.c
index f74d7202..c1f4dad0 100644
--- a/src/pulse/volume.c
+++ b/src/pulse/volume.c
@@ -263,7 +263,7 @@ pa_volume_t pa_sw_volume_from_linear(double v) {
* same volume value! That's why we need the lround() below!
*/
- return (pa_volume_t) PA_CLAMP_VOLUME(lround(cbrt(v) * PA_VOLUME_NORM));
+ return (pa_volume_t) PA_CLAMP_VOLUME((uint64_t) lround(cbrt(v) * PA_VOLUME_NORM));
}
double pa_sw_volume_to_linear(pa_volume_t v) {
diff --git a/src/pulsecore/ltdl-helper.c b/src/pulsecore/ltdl-helper.c
index be200ca2..1a0e5558 100644
--- a/src/pulsecore/ltdl-helper.c
+++ b/src/pulsecore/ltdl-helper.c
@@ -42,7 +42,7 @@ pa_void_func_t pa_load_sym(lt_dlhandle handle, const char *module, const char *s
pa_assert(handle);
pa_assert(symbol);
- *(void**) &f = lt_dlsym(handle, symbol);
+ f = (pa_void_func_t) lt_dlsym(handle, symbol);
if (f)
return f;
@@ -59,7 +59,7 @@ pa_void_func_t pa_load_sym(lt_dlhandle handle, const char *module, const char *s
if (!isalnum(*c))
*c = '_';
- *(void**) &f = lt_dlsym(handle, sn);
+ f = (pa_void_func_t) lt_dlsym(handle, sn);
pa_xfree(sn);
return f;
diff --git a/src/tests/mainloop-test.c b/src/tests/mainloop-test.c
index 3ec6d115..cd54bcfe 100644
--- a/src/tests/mainloop-test.c
+++ b/src/tests/mainloop-test.c
@@ -48,7 +48,7 @@ static pa_defer_event *de;
static void iocb(pa_mainloop_api*a, pa_io_event *e, int fd, pa_io_event_flags_t f, void *userdata) {
unsigned char c;
- (void) read(fd, &c, sizeof(c));
+ pa_assert_se(read(fd, &c, sizeof(c)) >= 0);
fprintf(stderr, "IO EVENT: %c\n", c < 32 ? '.' : c);
a->defer_enable(de, 1);
}
diff --git a/src/tests/mix-test.c b/src/tests/mix-test.c
index 457c4acd..55844e7f 100644
--- a/src/tests/mix-test.c
+++ b/src/tests/mix-test.c
@@ -32,12 +32,6 @@
#include <pulsecore/memblock.h>
#include <pulsecore/sample-util.h>
-static float swap_float(float a) {
- uint32_t *b = (uint32_t*) &a;
- *b = PA_UINT32_SWAP(*b);
- return a;
-}
-
static void dump_block(const pa_sample_spec *ss, const pa_memchunk *chunk) {
void *d;
unsigned i;
@@ -96,7 +90,7 @@ static void dump_block(const pa_sample_spec *ss, const pa_memchunk *chunk) {
float *u = d;
for (i = 0; i < chunk->length / pa_frame_size(ss); i++) {
- printf("%1.5f ", ss->format == PA_SAMPLE_FLOAT32NE ? *u : swap_float(*u));
+ printf("%1.5f ", ss->format == PA_SAMPLE_FLOAT32NE ? *u : PA_FLOAT32_SWAP(*u));
u++;
}
@@ -188,7 +182,7 @@ static pa_memblock* generate_block(pa_mempool *pool, const pa_sample_spec *ss) {
if (ss->format == PA_SAMPLE_FLOAT32RE) {
for (i = 0; i < 10; i++)
- u[i] = swap_float(float_samples[i]);
+ u[i] = PA_FLOAT32_SWAP(float_samples[i]);
} else
memcpy(d, float_samples, sizeof(float_samples));