diff options
author | 2021-02-14 11:05:57 -0500 | |
---|---|---|
committer | 2021-02-14 11:05:57 -0500 | |
commit | bc0146c2038c46f789a246d5616afd7c425157f3 (patch) | |
tree | b4d39194034b4c6e56ccd4035d25636034be43ca /src/lib/util/flac.cpp | |
parent | 91310bcdeb7ab0ff661738b212017bf836f4e8ad (diff) |
Eliminate ARRAY_LENGTH template in favor of C++17's std::size
* osdcomm.h: Move definition of EQUIVALENT_ARRAY to coretmpl.h
* sharc.cpp, gt64xxx.cpp, ym2413.cpp, gb_lcd.cpp, snes_ppu.cpp: Use STRUCT_MEMBER for save state registration
* gio/newport.cpp, megadrive/svp.cpp, nes_ctrl/bcbattle.cpp, arm7.cpp, tms9995.cpp, pckeybrd.cpp, sa1110.cpp, sa1111.cpp, jangou_blitter.cpp, vic4567.cpp: Use std::fill(_n) instead of memset
* emucore.h: Remove obsolete typedef
Diffstat (limited to 'src/lib/util/flac.cpp')
-rw-r--r-- | src/lib/util/flac.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/lib/util/flac.cpp b/src/lib/util/flac.cpp index 5b912b89279..13bf7aed8eb 100644 --- a/src/lib/util/flac.cpp +++ b/src/lib/util/flac.cpp @@ -10,7 +10,7 @@ #include "flac.h" -#include "osdcomm.h" +#include "corefile.h" #include <cassert> #include <new> @@ -129,7 +129,7 @@ bool flac_encoder::encode_interleaved(const int16_t *samples, uint32_t samples_p // process in batches of 2k samples FLAC__int32 converted_buffer[2048]; FLAC__int32 *dest = converted_buffer; - uint32_t cur_samples = (std::min<size_t>)(ARRAY_LENGTH(converted_buffer) / num_channels, samples_per_channel); + uint32_t cur_samples = (std::min<size_t>)(std::size(converted_buffer) / num_channels, samples_per_channel); // convert a buffers' worth for (uint32_t sampnum = 0; sampnum < cur_samples; sampnum++) @@ -162,7 +162,7 @@ bool flac_encoder::encode(int16_t *const *samples, uint32_t samples_per_channel, // process in batches of 2k samples FLAC__int32 converted_buffer[2048]; FLAC__int32 *dest = converted_buffer; - uint32_t cur_samples = (std::min<size_t>)(ARRAY_LENGTH(converted_buffer) / num_channels, samples_per_channel); + uint32_t cur_samples = (std::min<size_t>)(std::size(converted_buffer) / num_channels, samples_per_channel); // convert a buffers' worth for (uint32_t sampnum = 0; sampnum < cur_samples; sampnum++, srcindex++) @@ -464,7 +464,7 @@ bool flac_decoder::decode(int16_t **samples, uint32_t num_samples, bool swap_end { // make sure we don't have too many channels int chans = channels(); - if (chans > ARRAY_LENGTH(m_uncompressed_start)) + if (chans > std::size(m_uncompressed_start)) return false; // configure the uncompressed buffer |