summaryrefslogtreecommitdiffstatshomepage
path: root/src/tools/chdman.cpp
diff options
context:
space:
mode:
author Vas Crabb <vas@vastheman.com>2023-02-01 16:12:58 +1100
committer Vas Crabb <vas@vastheman.com>2023-02-01 16:12:58 +1100
commit0ae68e4dea29dd55338bc829b72a67d2f59debf7 (patch)
tree190c54185700cb5b2444b27cfbe58dd4b443da3a /src/tools/chdman.cpp
parentc4830168a56953af9714907664ceee72999df70c (diff)
Use EQUIVALENT_ARRAY to avoid issues with std::size on member arrays, enable warnings for VLAs in C++.
Diffstat (limited to 'src/tools/chdman.cpp')
-rw-r--r--src/tools/chdman.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/tools/chdman.cpp b/src/tools/chdman.cpp
index 45438bc1f82..c414c05f5f5 100644
--- a/src/tools/chdman.cpp
+++ b/src/tools/chdman.cpp
@@ -13,6 +13,7 @@
#include "bitmap.h"
#include "cdrom.h"
#include "corefile.h"
+#include "coretmpl.h"
#include "hashing.h"
#include "md5.h"
#include "path.h"
@@ -517,8 +518,8 @@ public:
uint32_t samples = (uint64_t(m_info.rate) * uint64_t(effframe + 1) * uint64_t(1000000) + m_info.fps_times_1million - 1) / uint64_t(m_info.fps_times_1million) - first_sample;
// loop over channels and read the samples
- int channels = unsigned((std::min<std::size_t>)(m_info.channels, std::size(m_audio)));
- int16_t *samplesptr[sizeof(m_audio)/sizeof(*m_audio)];
+ int channels = unsigned(std::min<std::size_t>(m_info.channels, std::size(m_audio)));
+ EQUIVALENT_ARRAY(m_audio, int16_t *) samplesptr;
for (int chnum = 0; chnum < channels; chnum++)
{
// read the sound samples