mirror of
https://git.FreeBSD.org/src.git
synced 2024-12-17 10:26:15 +00:00
Fix warnings by moving static functions before they are used.
This commit is contained in:
parent
da65de1dee
commit
8ac2d635c4
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=65390
@ -44,6 +44,45 @@ static u_int16_t snd_mixerdefaults[SOUND_MIXER_NRDEVICES] = {
|
||||
[SOUND_MIXER_OGAIN] = 50,
|
||||
};
|
||||
|
||||
static int
|
||||
mixer_set(snddev_info *d, unsigned dev, unsigned lev)
|
||||
{
|
||||
if (d == NULL || d->mixer.set == NULL) return -1;
|
||||
if ((dev < SOUND_MIXER_NRDEVICES) && (d->mixer.devs & (1 << dev))) {
|
||||
unsigned l = min((lev & 0x00ff), 100);
|
||||
unsigned r = min(((lev & 0xff00) >> 8), 100);
|
||||
int v = d->mixer.set(&d->mixer, dev, l, r);
|
||||
if (v >= 0) d->mixer.level[dev] = l | (r << 8);
|
||||
return 0;
|
||||
} else return -1;
|
||||
}
|
||||
|
||||
static int
|
||||
mixer_get(snddev_info *d, int dev)
|
||||
{
|
||||
if (d == NULL) return -1;
|
||||
if (dev < SOUND_MIXER_NRDEVICES && (d->mixer.devs & (1 << dev)))
|
||||
return d->mixer.level[dev];
|
||||
else return -1;
|
||||
}
|
||||
|
||||
static int
|
||||
mixer_setrecsrc(snddev_info *d, u_int32_t src)
|
||||
{
|
||||
if (d == NULL || d->mixer.setrecsrc == NULL) return -1;
|
||||
src &= d->mixer.recdevs;
|
||||
if (src == 0) src = SOUND_MASK_MIC;
|
||||
d->mixer.recsrc = d->mixer.setrecsrc(&d->mixer, src);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
mixer_getrecsrc(snddev_info *d)
|
||||
{
|
||||
if (d == NULL) return -1;
|
||||
return d->mixer.recsrc;
|
||||
}
|
||||
|
||||
int
|
||||
mixer_init(device_t dev, snd_mixer *m, void *devinfo)
|
||||
{
|
||||
@ -90,45 +129,6 @@ mixer_reinit(device_t dev)
|
||||
} else return -1;
|
||||
}
|
||||
|
||||
static int
|
||||
mixer_set(snddev_info *d, unsigned dev, unsigned lev)
|
||||
{
|
||||
if (d == NULL || d->mixer.set == NULL) return -1;
|
||||
if ((dev < SOUND_MIXER_NRDEVICES) && (d->mixer.devs & (1 << dev))) {
|
||||
unsigned l = min((lev & 0x00ff), 100);
|
||||
unsigned r = min(((lev & 0xff00) >> 8), 100);
|
||||
int v = d->mixer.set(&d->mixer, dev, l, r);
|
||||
if (v >= 0) d->mixer.level[dev] = l | (r << 8);
|
||||
return 0;
|
||||
} else return -1;
|
||||
}
|
||||
|
||||
static int
|
||||
mixer_get(snddev_info *d, int dev)
|
||||
{
|
||||
if (d == NULL) return -1;
|
||||
if (dev < SOUND_MIXER_NRDEVICES && (d->mixer.devs & (1 << dev)))
|
||||
return d->mixer.level[dev];
|
||||
else return -1;
|
||||
}
|
||||
|
||||
static int
|
||||
mixer_setrecsrc(snddev_info *d, u_int32_t src)
|
||||
{
|
||||
if (d == NULL || d->mixer.setrecsrc == NULL) return -1;
|
||||
src &= d->mixer.recdevs;
|
||||
if (src == 0) src = SOUND_MASK_MIC;
|
||||
d->mixer.recsrc = d->mixer.setrecsrc(&d->mixer, src);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
mixer_getrecsrc(snddev_info *d)
|
||||
{
|
||||
if (d == NULL) return -1;
|
||||
return d->mixer.recsrc;
|
||||
}
|
||||
|
||||
int
|
||||
mixer_ioctl(snddev_info *d, u_long cmd, caddr_t arg)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user