[clang-tidy] use auto
Found with modernize-use-auto. Signed-off-by: Rosen Penev <rosenp@gmail.com>
This commit is contained in:
parent
71792ffd43
commit
6979be008c
@ -129,7 +129,7 @@ audiofile_file_seek(AFvirtualfile *vfile, AFfileoffset _offset,
|
|||||||
static AFvirtualfile *
|
static AFvirtualfile *
|
||||||
setup_virtual_fops(AudioFileInputStream &afis) noexcept
|
setup_virtual_fops(AudioFileInputStream &afis) noexcept
|
||||||
{
|
{
|
||||||
AFvirtualfile *vf = (AFvirtualfile *)malloc(sizeof(*vf));
|
auto vf = (AFvirtualfile *)malloc(sizeof(AFvirtualfile));
|
||||||
vf->closure = &afis;
|
vf->closure = &afis;
|
||||||
vf->write = nullptr;
|
vf->write = nullptr;
|
||||||
vf->read = audiofile_file_read;
|
vf->read = audiofile_file_read;
|
||||||
|
@ -214,7 +214,7 @@ PulseMixer::GetVolume()
|
|||||||
int
|
int
|
||||||
PulseMixer::GetVolumeInternal()
|
PulseMixer::GetVolumeInternal()
|
||||||
{
|
{
|
||||||
pa_volume_t max_pa_volume = pa_volume_t(volume_scale_factor * PA_VOLUME_NORM);
|
auto max_pa_volume = pa_volume_t(volume_scale_factor * PA_VOLUME_NORM);
|
||||||
return online ?
|
return online ?
|
||||||
(int)((100 * (pa_cvolume_avg(&volume) + 1)) / max_pa_volume)
|
(int)((100 * (pa_cvolume_avg(&volume) + 1)) / max_pa_volume)
|
||||||
: -1;
|
: -1;
|
||||||
@ -228,7 +228,7 @@ PulseMixer::SetVolume(unsigned new_volume)
|
|||||||
if (!online)
|
if (!online)
|
||||||
throw std::runtime_error("disconnected");
|
throw std::runtime_error("disconnected");
|
||||||
|
|
||||||
pa_volume_t max_pa_volume = pa_volume_t(volume_scale_factor * PA_VOLUME_NORM);
|
auto max_pa_volume = pa_volume_t(volume_scale_factor * PA_VOLUME_NORM);
|
||||||
|
|
||||||
struct pa_cvolume cvolume;
|
struct pa_cvolume cvolume;
|
||||||
pa_cvolume_set(&cvolume, volume.channels,
|
pa_cvolume_set(&cvolume, volume.channels,
|
||||||
|
Loading…
Reference in New Issue
Block a user