summaryrefslogtreecommitdiffstats
path: root/src/utils/paplay.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2008-08-19 22:39:54 +0200
committerLennart Poettering <lennart@poettering.net>2008-08-19 22:39:54 +0200
commitb7026bf248948a6a30386ddbcc137f48f369a51e (patch)
tree0941ba3f61298fd9b8cb5b34fc236248519b0c8f /src/utils/paplay.c
parent047eb52b521a61aef54bd1760b5470a963ea47b6 (diff)
add a few more gcc warning flags and fix quite a few problems found by doing so
Diffstat (limited to 'src/utils/paplay.c')
-rw-r--r--src/utils/paplay.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/utils/paplay.c b/src/utils/paplay.c
index 9264a940..df2edf62 100644
--- a/src/utils/paplay.c
+++ b/src/utils/paplay.c
@@ -107,14 +107,14 @@ static void stream_write_callback(pa_stream *s, size_t length, void *userdata) {
if (readf_function) {
size_t k = pa_frame_size(&sample_spec);
- if ((bytes = readf_function(sndfile, data, length/k)) > 0)
- bytes *= k;
+ if ((bytes = readf_function(sndfile, data, (sf_count_t) (length/k))) > 0)
+ bytes *= (sf_count_t) k;
} else
- bytes = sf_read_raw(sndfile, data, length);
+ bytes = sf_read_raw(sndfile, data, (sf_count_t) length);
if (bytes > 0)
- pa_stream_write(s, data, bytes, pa_xfree, 0, PA_SEEK_RELATIVE);
+ pa_stream_write(s, data, (size_t) bytes, pa_xfree, 0, PA_SEEK_RELATIVE);
else
pa_xfree(data);
@@ -283,7 +283,7 @@ int main(int argc, char *argv[]) {
case ARG_VOLUME: {
int v = atoi(optarg);
- volume = v < 0 ? 0 : v;
+ volume = v < 0 ? 0U : (pa_volume_t) v;
break;
}
@@ -315,8 +315,8 @@ int main(int argc, char *argv[]) {
goto quit;
}
- sample_spec.rate = sfinfo.samplerate;
- sample_spec.channels = sfinfo.channels;
+ sample_spec.rate = (uint32_t) sfinfo.samplerate;
+ sample_spec.channels = (uint8_t) sfinfo.channels;
readf_function = NULL;