diff options
author | Lennart Poettering <lennart@poettering.net> | 2008-08-19 22:39:54 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2008-08-19 22:39:54 +0200 |
commit | b7026bf248948a6a30386ddbcc137f48f369a51e (patch) | |
tree | 0941ba3f61298fd9b8cb5b34fc236248519b0c8f /src/utils/padsp.c | |
parent | 047eb52b521a61aef54bd1760b5470a963ea47b6 (diff) |
add a few more gcc warning flags and fix quite a few problems found by doing so
Diffstat (limited to 'src/utils/padsp.c')
-rw-r--r-- | src/utils/padsp.c | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/src/utils/padsp.c b/src/utils/padsp.c index c82fde64f..134a7e586 100644 --- a/src/utils/padsp.c +++ b/src/utils/padsp.c @@ -748,7 +748,7 @@ static void fix_metrics(fd_info *i) { /* Number of fragments set? */ if (i->n_fragments < 2) { if (i->fragment_size > 0) { - i->n_fragments = pa_bytes_per_second(&i->sample_spec) / 2 / i->fragment_size; + i->n_fragments = (unsigned) (pa_bytes_per_second(&i->sample_spec) / 2 / i->fragment_size); if (i->n_fragments < 2) i->n_fragments = 2; } else @@ -864,7 +864,7 @@ static int fd_info_copy_data(fd_info *i, int force) { return -1; } - if (pa_stream_write(i->play_stream, i->buf, r, free, 0, PA_SEEK_RELATIVE) < 0) { + if (pa_stream_write(i->play_stream, i->buf, (size_t) r, free, 0, PA_SEEK_RELATIVE) < 0) { debug(DEBUG_LEVEL_NORMAL, __FILE__": pa_stream_write(): %s\n", pa_strerror(pa_context_errno(i->context))); return -1; } @@ -872,7 +872,7 @@ static int fd_info_copy_data(fd_info *i, int force) { i->buf = NULL; assert(n >= (size_t) r); - n -= r; + n -= (size_t) r; } if (n >= i->fragment_size) @@ -916,7 +916,7 @@ static int fd_info_copy_data(fd_info *i, int force) { } assert((size_t)r <= len - i->rec_offset); - i->rec_offset += r; + i->rec_offset += (size_t) r; if (i->rec_offset == len) { if (pa_stream_drop(i->rec_stream) < 0) { @@ -927,7 +927,7 @@ static int fd_info_copy_data(fd_info *i, int force) { } assert(n >= (size_t) r); - n -= r; + n -= (size_t) r; } if (n >= i->fragment_size) @@ -998,10 +998,10 @@ static int create_playback_stream(fd_info *i) { pa_stream_set_latency_update_callback(i->play_stream, stream_latency_update_cb, i); memset(&attr, 0, sizeof(attr)); - attr.maxlength = i->fragment_size * (i->n_fragments+1); - attr.tlength = i->fragment_size * i->n_fragments; - attr.prebuf = i->fragment_size; - attr.minreq = i->fragment_size; + attr.maxlength = (uint32_t) (i->fragment_size * (i->n_fragments+1)); + attr.tlength = (uint32_t) (i->fragment_size * i->n_fragments); + attr.prebuf = (uint32_t) i->fragment_size; + attr.minreq = (uint32_t) i->fragment_size; flags = PA_STREAM_INTERPOLATE_TIMING|PA_STREAM_AUTO_TIMING_UPDATE; if (i->play_precork) { @@ -1013,9 +1013,9 @@ static int create_playback_stream(fd_info *i) { goto fail; } - n = i->fragment_size; + n = (int) i->fragment_size; setsockopt(i->app_fd, SOL_SOCKET, SO_SNDBUF, &n, sizeof(n)); - n = i->fragment_size; + n = (int) i->fragment_size; setsockopt(i->thread_fd, SOL_SOCKET, SO_RCVBUF, &n, sizeof(n)); return 0; @@ -1042,8 +1042,8 @@ static int create_record_stream(fd_info *i) { pa_stream_set_latency_update_callback(i->rec_stream, stream_latency_update_cb, i); memset(&attr, 0, sizeof(attr)); - attr.maxlength = i->fragment_size * (i->n_fragments+1); - attr.fragsize = i->fragment_size; + attr.maxlength = (uint32_t) (i->fragment_size * (i->n_fragments+1)); + attr.fragsize = (uint32_t) i->fragment_size; flags = PA_STREAM_INTERPOLATE_TIMING|PA_STREAM_AUTO_TIMING_UPDATE; if (i->rec_precork) { @@ -1055,9 +1055,9 @@ static int create_record_stream(fd_info *i) { goto fail; } - n = i->fragment_size; + n = (int) i->fragment_size; setsockopt(i->app_fd, SOL_SOCKET, SO_RCVBUF, &n, sizeof(n)); - n = i->fragment_size; + n = (int) i->fragment_size; setsockopt(i->thread_fd, SOL_SOCKET, SO_SNDBUF, &n, sizeof(n)); return 0; @@ -1474,7 +1474,7 @@ int open(const char *filename, int flags, ...) { if (flags & O_CREAT) { va_start(args, flags); if (sizeof(mode_t) < sizeof(int)) - mode = va_arg(args, int); + mode = (mode_t) va_arg(args, int); else mode = va_arg(args, mode_t); va_end(args); |