summaryrefslogtreecommitdiffstats
path: root/src/pulsecore/sound-file.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/pulsecore/sound-file.c
parent047eb52b521a61aef54bd1760b5470a963ea47b6 (diff)
add a few more gcc warning flags and fix quite a few problems found by doing so
Diffstat (limited to 'src/pulsecore/sound-file.c')
-rw-r--r--src/pulsecore/sound-file.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/pulsecore/sound-file.c b/src/pulsecore/sound-file.c
index 3183ede6..74338f9a 100644
--- a/src/pulsecore/sound-file.c
+++ b/src/pulsecore/sound-file.c
@@ -108,8 +108,8 @@ int pa_sound_file_load(
break;
}
- ss->rate = sfinfo.samplerate;
- ss->channels = sfinfo.channels;
+ ss->rate = (uint32_t) sfinfo.samplerate;
+ ss->channels = (uint8_t) sfinfo.channels;
if (!pa_sample_spec_valid(ss)) {
pa_log("Unsupported sample format in file %s", fname);
@@ -119,7 +119,7 @@ int pa_sound_file_load(
if (map)
pa_channel_map_init_extend(map, ss->channels, PA_CHANNEL_MAP_DEFAULT);
- if ((l = pa_frame_size(ss) * sfinfo.frames) > PA_SCACHE_ENTRY_SIZE_MAX) {
+ if ((l = pa_frame_size(ss) * (size_t) sfinfo.frames) > PA_SCACHE_ENTRY_SIZE_MAX) {
pa_log("File too large");
goto finish;
}
@@ -131,7 +131,7 @@ int pa_sound_file_load(
ptr = pa_memblock_acquire(chunk->memblock);
if ((readf_function && readf_function(sf, ptr, sfinfo.frames) != sfinfo.frames) ||
- (!readf_function && sf_read_raw(sf, ptr, l) != (sf_count_t) l)) {
+ (!readf_function && sf_read_raw(sf, ptr, (sf_count_t) l) != (sf_count_t) l)) {
pa_log("Premature file end");
goto finish;
}
@@ -189,15 +189,15 @@ int pa_sound_file_too_big_to_cache(const char *fname) {
break;
}
- ss.rate = sfinfo.samplerate;
- ss.channels = sfinfo.channels;
+ ss.rate = (uint32_t) sfinfo.samplerate;
+ ss.channels = (uint8_t) sfinfo.channels;
if (!pa_sample_spec_valid(&ss)) {
pa_log("Unsupported sample format in file %s", fname);
return -1;
}
- if ((pa_frame_size(&ss) * sfinfo.frames) > PA_SCACHE_ENTRY_SIZE_MAX) {
+ if ((pa_frame_size(&ss) * (size_t) sfinfo.frames) > PA_SCACHE_ENTRY_SIZE_MAX) {
pa_log("File too large: %s", fname);
return 1;
}