]> git.alsa-project.org Git - alsa-lib.git/commitdiff
Reduce compilation warnings
authorJaroslav Kysela <perex@perex.cz>
Tue, 30 Oct 2012 12:07:48 +0000 (13:07 +0100)
committerJaroslav Kysela <perex@perex.cz>
Tue, 30 Oct 2012 12:09:10 +0000 (13:09 +0100)
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
src/alisp/alisp.c
src/mixer/simple_none.c
src/pcm/pcm_generic.c
src/pcm/pcm_ioplug.c
src/pcm/pcm_ladspa.c
src/pcm/pcm_mmap_emul.c
src/pcm/pcm_route.c
src/pcm/pcm_share.c
src/seq/seqmid.c

index 7575f55a208726acb1971d526a2e756076667f25..5dd5b0639ceaac18028a7b13df3e1d70317bac7e 100644 (file)
@@ -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)
index b11e9e8ad01936e6ace0e00cb9d295ccb80a9028..1c2774acbc35bec9259d585e33cb2b3d8df17d88 100644 (file)
@@ -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;
index 0436439a5a33138b388b15fe09ca6069dcdedd56..d56e5d3fce7954222b90b8383c51c9eee71d5162 100644 (file)
@@ -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)
index 9c6275ac1fcc15643738a6246b25e783432a3a6e..a90c844598bdbb3c10f2d38008369f8bbdace463 100644 (file)
@@ -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 &&
index 31e2875866e2ec2f78d1cae9996d7d9961e48487..0a9c52e975e67876b4a0d45e5d5b267a1841e01d 100644 (file)
@@ -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)
index 236fe6962a33512be38f438b8cf6f2799e35c682..811cb1cb7a3b939924e24b9c0bd39f4b0be398cb 100644 (file)
@@ -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
index a3d1695e6ac9931d2d14283edb2e56af84f1528a..2beedf68c3e0e9b6887115f95ac051c637a6df0e 100644 (file)
@@ -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];
                }
index 56a868598a522c4dfa636fc5cc946c8ee917c221..936e2f973ce5249e87618e00297aa3186da407e6 100644 (file)
@@ -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;
index 2ff7e8d0589e6c88c6f278f136fa92361ba18f8a..7d8bf1afa1ac8138224e893cbe96f96d013e8b04 100644 (file)
@@ -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;