mirror of
https://github.com/AxioDL/boo.git
synced 2025-05-15 20:01:33 +00:00
const_cast is a nicer statement
This commit is contained in:
parent
e45c3feef6
commit
ceedda9e1f
@ -551,8 +551,8 @@ struct WASAPIAudioVoiceEngine : BaseAudioVoiceEngine
|
|||||||
|
|
||||||
size_t send(const void* buf, size_t len) const
|
size_t send(const void* buf, size_t len) const
|
||||||
{
|
{
|
||||||
memcpy(((MIDIOut*)this)->m_buf, buf, std::min(len, size_t(512)));
|
memcpy(const_cast<MIDIOut*>(this)->m_buf, buf, std::min(len, size_t(512)));
|
||||||
((MIDIOut*)this)->m_hdr.dwBytesRecorded = len;
|
const_cast<MIDIOut*>(this)->m_hdr.dwBytesRecorded = len;
|
||||||
midiStreamOut(m_strm, LPMIDIHDR(&m_hdr), sizeof(m_hdr));
|
midiStreamOut(m_strm, LPMIDIHDR(&m_hdr), sizeof(m_hdr));
|
||||||
return len;
|
return len;
|
||||||
}
|
}
|
||||||
@ -609,8 +609,8 @@ struct WASAPIAudioVoiceEngine : BaseAudioVoiceEngine
|
|||||||
|
|
||||||
size_t send(const void* buf, size_t len) const
|
size_t send(const void* buf, size_t len) const
|
||||||
{
|
{
|
||||||
memcpy(((MIDIOut*)this)->m_buf, buf, std::min(len, size_t(512)));
|
memcpy(const_cast<MIDIOut*>(this)->m_buf, buf, std::min(len, size_t(512)));
|
||||||
((MIDIOut*)this)->m_hdr.dwBytesRecorded = len;
|
const_cast<MIDIOut*>(this)->m_hdr.dwBytesRecorded = len;
|
||||||
midiStreamOut(m_strm, LPMIDIHDR(&m_hdr), sizeof(m_hdr));
|
midiStreamOut(m_strm, LPMIDIHDR(&m_hdr), sizeof(m_hdr));
|
||||||
return len;
|
return len;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user