*: use auto

This commit is contained in:
Max Kellermann
2020-02-01 13:55:08 +01:00
parent 4f22f4d357
commit 72ec641f0d
51 changed files with 87 additions and 87 deletions

View File

@@ -181,7 +181,7 @@ void
filter_chain_append(PreparedFilter &_chain, const char *name,
std::unique_ptr<PreparedFilter> filter) noexcept
{
PreparedChainFilter &chain = (PreparedChainFilter &)_chain;
auto &chain = (PreparedChainFilter &)_chain;
chain.Append(name, std::move(filter));
}

View File

@@ -130,7 +130,7 @@ convert_filter_new(const AudioFormat in_audio_format,
void
convert_filter_set(Filter *_filter, AudioFormat out_audio_format)
{
ConvertFilter *filter = (ConvertFilter *)_filter;
auto *filter = (ConvertFilter *)_filter;
filter->Set(out_audio_format);
}

View File

@@ -69,7 +69,7 @@ PreparedNormalizeFilter::Open(AudioFormat &audio_format)
ConstBuffer<void>
NormalizeFilter::FilterPCM(ConstBuffer<void> src)
{
int16_t *dest = (int16_t *)buffer.Get(src.size);
auto *dest = (int16_t *)buffer.Get(src.size);
memcpy(dest, src.data, src.size);
Compressor_Process_int16(compressor, dest, src.size / 2);

View File

@@ -230,14 +230,14 @@ RouteFilter::FilterPCM(ConstBuffer<void> src)
const size_t bytes_per_frame_per_channel = input_format.GetSampleSize();
// A moving pointer that always refers to channel 0 in the input, at the currently handled frame
const uint8_t *base_source = (const uint8_t *)src.data;
const auto *base_source = (const uint8_t *)src.data;
// Grow our reusable buffer, if needed, and set the moving pointer
const size_t result_size = number_of_frames * output_frame_size;
void *const result = output_buffer.Get(result_size);
// A moving pointer that always refers to the currently filled channel of the currently handled frame, in the output
uint8_t *chan_destination = (uint8_t *)result;
auto *chan_destination = (uint8_t *)result;
// Perform our copy operations, with N input channels and M output channels
for (unsigned int s=0; s<number_of_frames; ++s) {

View File

@@ -73,7 +73,7 @@ volume_filter_prepare() noexcept
unsigned
volume_filter_get(const Filter *_filter) noexcept
{
const VolumeFilter *filter =
const auto *filter =
(const VolumeFilter *)_filter;
return filter->GetVolume();
@@ -82,7 +82,7 @@ volume_filter_get(const Filter *_filter) noexcept
void
volume_filter_set(Filter *_filter, unsigned volume) noexcept
{
VolumeFilter *filter = (VolumeFilter *)_filter;
auto *filter = (VolumeFilter *)_filter;
filter->SetVolume(volume);
}