diff options
author | Max Kellermann <max@musicpd.org> | 2020-02-01 13:55:08 +0100 |
---|---|---|
committer | Max Kellermann <max@musicpd.org> | 2020-02-01 14:02:43 +0100 |
commit | 72ec641f0d5a33de882a05a53e2f3a3b74226eb3 (patch) | |
tree | d52d290cab7f7cbec7e67ebb0f7998962cdae534 /src/pcm | |
parent | 4f22f4d357c99ba4163a496882f813138db3c39b (diff) |
*: use `auto`
Diffstat (limited to 'src/pcm')
-rw-r--r-- | src/pcm/Export.cxx | 6 | ||||
-rw-r--r-- | src/pcm/Pack.cxx | 2 | ||||
-rw-r--r-- | src/pcm/PcmDsd.cxx | 2 | ||||
-rw-r--r-- | src/pcm/SoxrResampler.cxx | 4 |
4 files changed, 7 insertions, 7 deletions
diff --git a/src/pcm/Export.cxx b/src/pcm/Export.cxx index cc4bc3500..76b25d09c 100644 --- a/src/pcm/Export.cxx +++ b/src/pcm/Export.cxx @@ -297,7 +297,7 @@ PcmExport::Export(ConstBuffer<void> data) noexcept const auto src = ConstBuffer<int32_t>::FromVoid(data); const size_t num_samples = src.size; const size_t dest_size = num_samples * 3; - uint8_t *dest = (uint8_t *)pack_buffer.Get(dest_size); + auto *dest = (uint8_t *)pack_buffer.Get(dest_size); assert(dest != nullptr); pcm_pack_24(dest, src.begin(), src.end()); @@ -307,7 +307,7 @@ PcmExport::Export(ConstBuffer<void> data) noexcept } else if (shift8) { const auto src = ConstBuffer<int32_t>::FromVoid(data); - uint32_t *dest = (uint32_t *)pack_buffer.Get(data.size); + auto *dest = (uint32_t *)pack_buffer.Get(data.size); data.data = dest; for (auto i : src) @@ -319,7 +319,7 @@ PcmExport::Export(ConstBuffer<void> data) noexcept const auto src = ConstBuffer<uint8_t>::FromVoid(data); - uint8_t *dest = (uint8_t *)reverse_buffer.Get(data.size); + auto *dest = (uint8_t *)reverse_buffer.Get(data.size); assert(dest != nullptr); data.data = dest; diff --git a/src/pcm/Pack.cxx b/src/pcm/Pack.cxx index fa6b739f6..0ec6aa3df 100644 --- a/src/pcm/Pack.cxx +++ b/src/pcm/Pack.cxx @@ -23,7 +23,7 @@ static void pack_sample(uint8_t *dest, const int32_t *src0) noexcept { - const uint8_t *src = (const uint8_t *)src0; + const auto *src = (const uint8_t *)src0; if (IsBigEndian()) ++src; diff --git a/src/pcm/PcmDsd.cxx b/src/pcm/PcmDsd.cxx index a75a09089..7111c22cb 100644 --- a/src/pcm/PcmDsd.cxx +++ b/src/pcm/PcmDsd.cxx @@ -33,7 +33,7 @@ PcmDsd::ToFloat(unsigned channels, ConstBuffer<uint8_t> src) noexcept const size_t num_samples = src.size; const size_t num_frames = src.size / channels; - float *dest = buffer.GetT<float>(num_samples); + auto *dest = buffer.GetT<float>(num_samples); dsd2pcm.Translate(channels, num_frames, src.data, dest); return { dest, num_samples }; diff --git a/src/pcm/SoxrResampler.cxx b/src/pcm/SoxrResampler.cxx index 87349be40..c70c99647 100644 --- a/src/pcm/SoxrResampler.cxx +++ b/src/pcm/SoxrResampler.cxx @@ -157,7 +157,7 @@ SoxrPcmResampler::Resample(ConstBuffer<void> src) /* always round up: worst case output buffer size */ const size_t o_frames = size_t(n_frames * ratio) + 1; - float *output_buffer = (float *)buffer.Get(o_frames * frame_size); + auto *output_buffer = (float *)buffer.Get(o_frames * frame_size); size_t i_done, o_done; soxr_error_t e = soxr_process(soxr, src.data, n_frames, &i_done, @@ -174,7 +174,7 @@ SoxrPcmResampler::Flush() const size_t frame_size = channels * sizeof(float); const size_t o_frames = 1024; - float *output_buffer = (float *)buffer.Get(o_frames * frame_size); + auto *output_buffer = (float *)buffer.Get(o_frames * frame_size); size_t o_done; soxr_error_t e = soxr_process(soxr, nullptr, 0, nullptr, |