mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-04 13:29:59 -05:00
add a few more gcc warning flags and fix quite a few problems found by doing so
This commit is contained in:
parent
047eb52b52
commit
b7026bf248
99 changed files with 810 additions and 776 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue