From 471cb04dc9e5028ebc74ab6d7cb60afd3839117c Mon Sep 17 00:00:00 2001 From: "Raine M. Ekman" Date: Thu, 8 Jan 2015 09:28:57 +0200 Subject: [PATCH] Removed #ifdefs around assert()s. --- src/core/SampleRecordHandle.cpp | 4 ++-- src/core/audio/AudioDevice.cpp | 4 ++-- src/core/audio/AudioSampleRecorder.cpp | 4 ++-- src/gui/AutomationEditor.cpp | 4 ++-- src/gui/PianoRoll.cpp | 4 ++-- src/gui/SetupDialog.cpp | 4 ++-- 6 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/core/SampleRecordHandle.cpp b/src/core/SampleRecordHandle.cpp index 590333492..a16f56330 100644 --- a/src/core/SampleRecordHandle.cpp +++ b/src/core/SampleRecordHandle.cpp @@ -116,9 +116,9 @@ void SampleRecordHandle::createSampleBuffer( SampleBuffer** sampleBuf ) // make sure buffer is cleaned up properly at the end... sampleFrame * data_ptr = data; -#ifdef LMMS_DEBUG + assert( data != NULL ); -#endif + // now copy all buffers into big buffer for( bufferList::const_iterator it = m_buffers.begin(); it != m_buffers.end(); ++it ) diff --git a/src/core/audio/AudioDevice.cpp b/src/core/audio/AudioDevice.cpp index 68b475cf7..7acbdbbf1 100644 --- a/src/core/audio/AudioDevice.cpp +++ b/src/core/audio/AudioDevice.cpp @@ -237,9 +237,9 @@ int AudioDevice::convertToS16( const surroundSampleFrame * _ab, void AudioDevice::clearS16Buffer( int_sample_t * _outbuf, const fpp_t _frames ) { -#ifdef LMMS_DEBUG + assert( _outbuf != NULL ); -#endif + memset( _outbuf, 0, _frames * channels() * BYTES_PER_INT_SAMPLE ); } diff --git a/src/core/audio/AudioSampleRecorder.cpp b/src/core/audio/AudioSampleRecorder.cpp index e239c7bb1..01d1091ac 100644 --- a/src/core/audio/AudioSampleRecorder.cpp +++ b/src/core/audio/AudioSampleRecorder.cpp @@ -76,9 +76,9 @@ void AudioSampleRecorder::createSampleBuffer( SampleBuffer** sampleBuf ) // make sure buffer is cleaned up properly at the end... sampleFrame * data_ptr = data; -#ifdef LMMS_DEBUG + assert( data != NULL ); -#endif + // now copy all buffers into big buffer for( BufferList::ConstIterator it = m_buffers.begin(); it != m_buffers.end(); ++it ) diff --git a/src/gui/AutomationEditor.cpp b/src/gui/AutomationEditor.cpp index 2d28bd8f1..474402be5 100644 --- a/src/gui/AutomationEditor.cpp +++ b/src/gui/AutomationEditor.cpp @@ -2385,9 +2385,9 @@ void AutomationEditor::zoomingXChanged() { const QString & zfac = m_zoomingXModel.currentText(); m_ppt = zfac.left( zfac.length() - 1 ).toInt() * DEFAULT_PPT / 100; -#ifdef LMMS_DEBUG + assert( m_ppt > 0 ); -#endif + m_timeLine->setPixelsPerTact( m_ppt ); update(); } diff --git a/src/gui/PianoRoll.cpp b/src/gui/PianoRoll.cpp index 97842c405..cfa98bc23 100644 --- a/src/gui/PianoRoll.cpp +++ b/src/gui/PianoRoll.cpp @@ -4194,9 +4194,9 @@ void PianoRoll::zoomingChanged() { const QString & zfac = m_zoomingModel.currentText(); m_ppt = zfac.left( zfac.length() - 1 ).toInt() * DEFAULT_PR_PPT / 100; -#ifdef LMMS_DEBUG + assert( m_ppt > 0 ); -#endif + m_timeLine->setPixelsPerTact( m_ppt ); update(); diff --git a/src/gui/SetupDialog.cpp b/src/gui/SetupDialog.cpp index 7f6c3391b..83bd357b7 100644 --- a/src/gui/SetupDialog.cpp +++ b/src/gui/SetupDialog.cpp @@ -73,9 +73,9 @@ inline void labelWidget( QWidget * _w, const QString & _txt ) f.setBold( true ); title->setFont( pointSize<12>( f ) ); -#ifdef LMMS_DEBUG + assert( dynamic_cast( _w->layout() ) != NULL ); -#endif + dynamic_cast( _w->layout() )->addSpacing( 5 ); dynamic_cast( _w->layout() )->addWidget( title ); dynamic_cast( _w->layout() )->addSpacing( 10 );