lol wine
[gentoo-diskmaster-overlay.git] / media-libs / alsa-lib / files / alsa-lib-1.0.17-sframes-type.patch
blobf4094b77a5be966424b742a35f4c052e14c03dd1
1 From: Lennart Poettering <mznyfn@0pointer.de>
2 Date: Fri, 18 Jul 2008 19:22:50 +0000 (+0200)
3 Subject: fix type of internally used sframes variable, to avoid unnecessary casts
4 X-Git-Url: http://git.alsa-project.org/?p=alsa-lib.git;a=commitdiff_plain;h=15769ead725b7c215dedd4ea5196955086d2044a;hp=0fbfe2d8d6aac06e6615b7109ffc1fea8c62dee6
6 fix type of internally used sframes variable, to avoid unnecessary casts
8 This minor patch fixes the type of the sframes variable in
9 snd_pcm_plugin_forward(). With this fix we need to cast less and the
10 code is less confusing.
12 Signed-off-by: Lennart Poettering <lennart@poettering.net>
13 Signed-off-by: Takashi Iwai <tiwai@suse.de>
14 ---
16 diff --git a/src/pcm/pcm_plugin.c b/src/pcm/pcm_plugin.c
17 index c199d8d..b377cb2 100644
18 --- a/src/pcm/pcm_plugin.c
19 +++ b/src/pcm/pcm_plugin.c
20 @@ -234,7 +234,7 @@ static snd_pcm_sframes_t snd_pcm_plugin_forward(snd_pcm_t *pcm, snd_pcm_uframes_
22 snd_pcm_plugin_t *plugin = pcm->private_data;
23 snd_pcm_sframes_t n = snd_pcm_mmap_avail(pcm);
24 - snd_pcm_uframes_t sframes;
25 + snd_pcm_sframes_t sframes;
27 if ((snd_pcm_uframes_t)n < frames)
28 frames = n;
29 @@ -246,8 +246,8 @@ static snd_pcm_sframes_t snd_pcm_plugin_forward(snd_pcm_t *pcm, snd_pcm_uframes_
30 else
31 sframes = frames;
32 snd_atomic_write_begin(&plugin->watom);
33 - sframes = INTERNAL(snd_pcm_forward)(plugin->gen.slave, (snd_pcm_uframes_t) sframes);
34 - if ((snd_pcm_sframes_t) sframes < 0) {
35 + sframes = INTERNAL(snd_pcm_forward)(plugin->gen.slave, sframes);
36 + if (sframes < 0) {
37 snd_atomic_write_end(&plugin->watom);
38 return sframes;