From 9d36cf5ff0a83fcc3027560633e09ba680fa20f8 Mon Sep 17 00:00:00 2001 From: tildearrow Date: Thu, 26 May 2022 13:31:17 -0500 Subject: [PATCH] fix compilation on GCC 12 --- src/engine/platform/sound/n163/n163.cpp | 5 +++-- src/engine/platform/sound/scc/scc.cpp | 5 +++-- src/engine/platform/sound/vrcvi/vrcvi.cpp | 3 ++- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/engine/platform/sound/n163/n163.cpp b/src/engine/platform/sound/n163/n163.cpp index 20853963e..e6801fc1f 100644 --- a/src/engine/platform/sound/n163/n163.cpp +++ b/src/engine/platform/sound/n163/n163.cpp @@ -67,6 +67,7 @@ */ #include "n163.hpp" +#include void n163_core::tick() { @@ -126,12 +127,12 @@ void n163_core::reset() // reset this chip m_disable = false; m_multiplex = true; - std::fill(std::begin(m_ram), std::end(m_ram), 0); + memset(m_ram,0,sizeof(m_ram)); m_voice_cycle = 0x78; m_addr_latch.reset(); m_out = 0; m_acc = 0; - std::fill(std::begin(m_ch_out), std::end(m_ch_out), 0); + memset(m_ch_out,0,sizeof(m_ch_out)); } // accessor diff --git a/src/engine/platform/sound/scc/scc.cpp b/src/engine/platform/sound/scc/scc.cpp index 427461e62..b9758fae4 100644 --- a/src/engine/platform/sound/scc/scc.cpp +++ b/src/engine/platform/sound/scc/scc.cpp @@ -322,6 +322,7 @@ */ #include "scc.hpp" +#include // shared SCC features void scc_core::tick() @@ -372,12 +373,12 @@ void scc_core::reset() m_test.reset(); m_out = 0; - std::fill(std::begin(m_reg), std::end(m_reg), 0); + memset(m_reg,0,sizeof(m_reg)); } void scc_core::voice_t::reset() { - std::fill(std::begin(wave), std::end(wave), 0); + memset(wave,0,sizeof(wave)); enable = false; pitch = 0; volume = 0; diff --git a/src/engine/platform/sound/vrcvi/vrcvi.cpp b/src/engine/platform/sound/vrcvi/vrcvi.cpp index bca3ecda3..a6561db80 100644 --- a/src/engine/platform/sound/vrcvi/vrcvi.cpp +++ b/src/engine/platform/sound/vrcvi/vrcvi.cpp @@ -81,6 +81,7 @@ */ #include "vrcvi.hpp" +#include void vrcvi_core::tick() { @@ -119,7 +120,7 @@ void vrcvi_core::reset() m_timer.reset(); m_control.reset(); m_out = 0; - std::fill(std::begin(m_ch_out),std::end(m_ch_out),0); + memset(m_ch_out,0,sizeof(m_ch_out)); } bool vrcvi_core::alu_t::tick()