X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/8907154c1a8a6882c6797d1f16393ddfb23e7f3a..cdbd62d6ff290fd58acd1bc5574dfc79db3a6f70:/src/msw/sound.cpp diff --git a/src/msw/sound.cpp b/src/msw/sound.cpp index 788f3e63d3..260f49f045 100644 --- a/src/msw/sound.cpp +++ b/src/msw/sound.cpp @@ -1,10 +1,9 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: sound.cpp +// Name: src/msw/sound.cpp // Purpose: wxSound // Author: Julian Smart // Modified by: 2005-07-29: Vadim Zeitlin: redesign // Created: 04/01/98 -// RCS-ID: $Id$ // Copyright: (c) Julian Smart // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// @@ -58,7 +57,7 @@ class wxSoundDataMemory : public wxSoundData { public: // we copy the data - wxSoundDataMemory(int size, const wxByte *buf); + wxSoundDataMemory(size_t size, const void* buf); void *GetPtr() const { return m_waveDataPtr; } @@ -70,7 +69,7 @@ private: GlobalPtr m_waveData; GlobalPtrLock m_waveDataPtr; - DECLARE_NO_COPY_CLASS(wxSoundDataMemory) + wxDECLARE_NO_COPY_CLASS(wxSoundDataMemory); }; // class for sound files and resources @@ -90,7 +89,7 @@ private: const wxString m_name; const bool m_isResource; - DECLARE_NO_COPY_CLASS(wxSoundDataFile) + wxDECLARE_NO_COPY_CLASS(wxSoundDataFile); }; // ============================================================================ @@ -101,7 +100,7 @@ private: // wxSoundData-derived classes // ---------------------------------------------------------------------------- -wxSoundDataMemory::wxSoundDataMemory(int size, const wxByte *buf) +wxSoundDataMemory::wxSoundDataMemory(size_t size, const void* buf) : m_waveData(size), m_waveDataPtr(m_waveData) { @@ -131,7 +130,7 @@ wxSound::wxSound(const wxString& filename, bool isResource) Create(filename, isResource); } -wxSound::wxSound(int size, const wxByte *data) +wxSound::wxSound(size_t size, const void* data) { Init(); Create(size, data); @@ -144,11 +143,7 @@ wxSound::~wxSound() void wxSound::Free() { - if ( m_data ) - { - delete m_data; - m_data = NULL; - } + wxDELETE(m_data); } bool wxSound::CheckCreatedOk() @@ -168,7 +163,7 @@ bool wxSound::Create(const wxString& filename, bool isResource) return CheckCreatedOk(); } -bool wxSound::Create(int size, const wxByte* data) +bool wxSound::Create(size_t size, const void* data) { Free();