alsa/0034-Reduce-compilation-warnings.patch
Takashi Iwai 7a3b45a028 Accepting request 141190 from home:tiwai:branches:multimedia:libs
- backport fixes from upstream tree:
  0031-pcm-support-for-audio-timestamps.patch
  0032-pcm-fix-64-bit-SNDRV_PCM_IOCTL_STATUS-ABI-breakage.patch
  0033-PCM-Fix-memory-leak-for-pcm-empty-and-asym-plugins.patch
  0034-Reduce-compilation-warnings.patch
  0035-PCM-Avoid-busy-loop-in-snd_pcm_write_areas-with-rate.patch

OBS-URL: https://build.opensuse.org/request/show/141190
OBS-URL: https://build.opensuse.org/package/show/multimedia:libs/alsa?expand=0&rev=115
2012-11-13 16:37:14 +00:00

180 lines
6.7 KiB
Diff

From 49dde08641f8c6b480c0d410d4fdb2160752dd9a Mon Sep 17 00:00:00 2001
From: Jaroslav Kysela <perex@perex.cz>
Date: Tue, 30 Oct 2012 13:07:48 +0100
Subject: [PATCH 34/35] Reduce compilation warnings
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
---
src/alisp/alisp.c | 2 +-
src/mixer/simple_none.c | 2 --
src/pcm/pcm_generic.c | 2 +-
src/pcm/pcm_ioplug.c | 2 +-
src/pcm/pcm_ladspa.c | 8 +-------
src/pcm/pcm_mmap_emul.c | 2 --
src/pcm/pcm_route.c | 2 +-
src/pcm/pcm_share.c | 5 +----
src/seq/seqmid.c | 2 +-
9 files changed, 7 insertions(+), 20 deletions(-)
diff --git a/src/alisp/alisp.c b/src/alisp/alisp.c
index 7575f55..5dd5b06 100644
--- a/src/alisp/alisp.c
+++ b/src/alisp/alisp.c
@@ -3256,7 +3256,7 @@ int alsa_lisp(struct alisp_cfg *cfg, struct alisp_instance **_instance)
else
alsa_lisp_free(instance);
- return 0;
+ return retval;
}
void alsa_lisp_free(struct alisp_instance *instance)
diff --git a/src/mixer/simple_none.c b/src/mixer/simple_none.c
index b11e9e8..1c2774a 100644
--- a/src/mixer/simple_none.c
+++ b/src/mixer/simple_none.c
@@ -672,7 +672,6 @@ static int simple_update(snd_mixer_elem_t *melem)
unsigned int caps, pchannels, cchannels;
long pmin, pmax, cmin, cmax;
selem_ctl_t *ctl;
- const char *name;
caps = 0;
pchannels = 0;
@@ -683,7 +682,6 @@ static int simple_update(snd_mixer_elem_t *melem)
cmax = LONG_MIN;
assert(snd_mixer_elem_get_type(melem) == SND_MIXER_ELEM_SIMPLE);
simple = snd_mixer_elem_get_private(melem);
- name = snd_mixer_selem_get_name(melem);
ctl = &simple->ctls[CTL_SINGLE];
if (ctl->elem) {
pchannels = cchannels = ctl->values;
diff --git a/src/pcm/pcm_generic.c b/src/pcm/pcm_generic.c
index 0436439..d56e5d3 100644
--- a/src/pcm/pcm_generic.c
+++ b/src/pcm/pcm_generic.c
@@ -41,7 +41,7 @@ int snd_pcm_generic_close(snd_pcm_t *pcm)
if (generic->close_slave)
err = snd_pcm_close(generic->slave);
free(generic);
- return 0;
+ return err;
}
int snd_pcm_generic_nonblock(snd_pcm_t *pcm, int nonblock)
diff --git a/src/pcm/pcm_ioplug.c b/src/pcm/pcm_ioplug.c
index 9c6275a..a90c844 100644
--- a/src/pcm/pcm_ioplug.c
+++ b/src/pcm/pcm_ioplug.c
@@ -625,7 +625,7 @@ static snd_pcm_sframes_t snd_pcm_ioplug_avail_update(snd_pcm_t *pcm)
snd_pcm_uframes_t avail;
snd_pcm_ioplug_hw_ptr_update(pcm);
- if (io->data->state == SNDRV_PCM_STATE_XRUN)
+ if (io->data->state == SND_PCM_STATE_XRUN)
return -EPIPE;
if (pcm->stream == SND_PCM_STREAM_CAPTURE &&
pcm->access != SND_PCM_ACCESS_RW_INTERLEAVED &&
diff --git a/src/pcm/pcm_ladspa.c b/src/pcm/pcm_ladspa.c
index 31e2875..0a9c52e 100644
--- a/src/pcm/pcm_ladspa.c
+++ b/src/pcm/pcm_ladspa.c
@@ -612,8 +612,7 @@ static int snd_pcm_ladspa_allocate_instances(snd_pcm_t *pcm, snd_pcm_ladspa_t *l
{
struct list_head *list, *pos;
unsigned int depth, idx, count;
- unsigned int in_channel, out_channel;
- unsigned int in_channels, out_channels;
+ unsigned int in_channels;
unsigned int in_ports, out_ports;
snd_pcm_ladspa_instance_t *instance = NULL;
int err;
@@ -622,11 +621,8 @@ static int snd_pcm_ladspa_allocate_instances(snd_pcm_t *pcm, snd_pcm_ladspa_t *l
in_channels = ladspa->channels > 0 ? ladspa->channels :
(pcm->stream == SND_PCM_STREAM_PLAYBACK ? pcm->channels : ladspa->plug.gen.slave->channels);
depth = 0;
- out_channels = 0;
list_for_each(pos, list) {
snd_pcm_ladspa_plugin_t *plugin = list_entry(pos, snd_pcm_ladspa_plugin_t, list);
- if (pos->next == list) /* last entry */
- out_channels = pcm->stream == SND_PCM_STREAM_PLAYBACK ? ladspa->plug.gen.slave->channels : pcm->channels;
in_ports = snd_pcm_ladspa_count_ports(plugin, LADSPA_PORT_INPUT | LADSPA_PORT_AUDIO);
out_ports = snd_pcm_ladspa_count_ports(plugin, LADSPA_PORT_OUTPUT | LADSPA_PORT_AUDIO);
count = 1;
@@ -636,8 +632,6 @@ static int snd_pcm_ladspa_allocate_instances(snd_pcm_t *pcm, snd_pcm_ladspa_t *l
else
plugin->policy = SND_PCM_LADSPA_POLICY_NONE;
}
- in_channel = 0;
- out_channel = 0;
for (idx = 0; idx < count; idx++) {
instance = (snd_pcm_ladspa_instance_t *)calloc(1, sizeof(snd_pcm_ladspa_instance_t));
if (instance == NULL)
diff --git a/src/pcm/pcm_mmap_emul.c b/src/pcm/pcm_mmap_emul.c
index 236fe69..811cb1c 100644
--- a/src/pcm/pcm_mmap_emul.c
+++ b/src/pcm/pcm_mmap_emul.c
@@ -332,9 +332,7 @@ static snd_pcm_sframes_t snd_pcm_mmap_emul_avail_update(snd_pcm_t *pcm)
{
mmap_emul_t *map = pcm->private_data;
snd_pcm_t *slave = map->gen.slave;
- snd_pcm_sframes_t avail;
- avail = snd_pcm_avail_update(slave);
if (!map->mmap_emul || pcm->stream == SND_PCM_STREAM_PLAYBACK)
map->hw_ptr = *slave->hw.ptr;
else
diff --git a/src/pcm/pcm_route.c b/src/pcm/pcm_route.c
index a3d1695..2beedf6 100644
--- a/src/pcm/pcm_route.c
+++ b/src/pcm/pcm_route.c
@@ -725,7 +725,7 @@ static snd_pcm_chmap_t *snd_pcm_route_get_chmap(snd_pcm_t *pcm)
for (dst = 0; dst < route->params.ndsts; dst++) {
snd_pcm_route_ttable_dst_t *d = &route->params.dsts[dst];
for (src = 0; src < d->nsrcs; src++) {
- int c = d->srcs[src].channel;
+ unsigned int c = d->srcs[src].channel;
if (c < nsrcs && map->pos[c] == SND_CHMAP_NA)
map->pos[c] = slave_map->pos[dst];
}
diff --git a/src/pcm/pcm_share.c b/src/pcm/pcm_share.c
index 56a8685..936e2f9 100644
--- a/src/pcm/pcm_share.c
+++ b/src/pcm/pcm_share.c
@@ -136,18 +136,15 @@ static snd_pcm_uframes_t snd_pcm_share_slave_avail(snd_pcm_share_slave_t *slave)
static snd_pcm_uframes_t _snd_pcm_share_slave_forward(snd_pcm_share_slave_t *slave)
{
struct list_head *i;
- snd_pcm_uframes_t buffer_size, boundary;
- snd_pcm_uframes_t slave_appl_ptr;
+ snd_pcm_uframes_t buffer_size;
snd_pcm_sframes_t frames, safety_frames;
snd_pcm_sframes_t min_frames, max_frames;
snd_pcm_uframes_t avail, slave_avail;
snd_pcm_uframes_t slave_hw_avail;
slave_avail = snd_pcm_share_slave_avail(slave);
- boundary = slave->pcm->boundary;
buffer_size = slave->pcm->buffer_size;
min_frames = slave_avail;
max_frames = 0;
- slave_appl_ptr = *slave->pcm->appl.ptr;
list_for_each(i, &slave->clients) {
snd_pcm_share_t *share = list_entry(i, snd_pcm_share_t, list);
snd_pcm_t *pcm = share->pcm;
diff --git a/src/seq/seqmid.c b/src/seq/seqmid.c
index 2ff7e8d..7d8bf1a 100644
--- a/src/seq/seqmid.c
+++ b/src/seq/seqmid.c
@@ -423,7 +423,7 @@ int snd_seq_parse_address(snd_seq_t *seq, snd_seq_addr_t *addr, const char *arg)
return -EINVAL;
cinfo.client = -1;
while (snd_seq_query_next_client(seq, &cinfo) >= 0) {
- if ((strlen(cinfo.name) == len) &&
+ if ((strlen(cinfo.name) == (size_t)len) &&
! strncmp(arg, cinfo.name, len)) {
addr->client = cinfo.client;
return 0;
--
1.8.0