diff options
Diffstat (limited to 'dxr3syncbuffer.c')
-rw-r--r-- | dxr3syncbuffer.c | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/dxr3syncbuffer.c b/dxr3syncbuffer.c index db6475f..d9b7f3d 100644 --- a/dxr3syncbuffer.c +++ b/dxr3syncbuffer.c @@ -41,10 +41,10 @@ cFixedLengthFrame::~cFixedLengthFrame() // ================================== // ! setup our frame -void cFixedLengthFrame::Init(uint32_t lenght) +void cFixedLengthFrame::Init(uint32_t length) { - m_length = lenght; - m_pData = new uint8_t[lenght]; + this->length = length; + m_pData = new uint8_t[length]; // allocation ok? if (!m_pData) { @@ -56,11 +56,11 @@ void cFixedLengthFrame::Init(uint32_t lenght) // ================================== void cFixedLengthFrame::CopyFrame(const uint8_t* pStart, int length) { - if (length > m_length) { + if (length > this->length()) { delete[] m_pData; m_pData = new uint8_t[length]; } - m_length = length; + this->length = length; memcpy((void*) m_pData, (void*) pStart, length); } @@ -71,12 +71,6 @@ uint8_t* cFixedLengthFrame::GetData(void) } // ================================== -int cFixedLengthFrame::GetCount(void) -{ - return m_length; -} - -// ================================== //! constructor cDxr3SyncBuffer::cDxr3SyncBuffer(int frameCount, int frameLength) : cRingBuffer(frameCount, true) |