diff --git a/include/lmms_math.h b/include/lmms_math.h index 3fd76896e18..1ecebf4a353 100644 --- a/include/lmms_math.h +++ b/include/lmms_math.h @@ -32,7 +32,6 @@ #include #include -using namespace std; #ifndef exp10 #define exp10(x) std::pow( 10.0, x ) @@ -220,10 +219,10 @@ static inline float logToLinearScale( float min, float max, float value ) const float mmax = qMax( qAbs( min ), qAbs( max ) ); const float val = value * ( max - min ) + min; float result = signedPowf( val / mmax, F_E ) * mmax; - return isnan( result ) ? 0 : result; + return std::isnan( result ) ? 0 : result; } float result = powf( value, F_E ) * ( max - min ) + min; - return isnan( result ) ? 0 : result; + return std::isnan( result ) ? 0 : result; } @@ -237,10 +236,10 @@ static inline float linearToLogScale( float min, float max, float value ) { const float mmax = qMax( qAbs( min ), qAbs( max ) ); float result = signedPowf( valueLimited / mmax, EXP ) * mmax; - return isnan( result ) ? 0 : result; + return std::isnan( result ) ? 0 : result; } float result = powf( val, EXP ) * ( max - min ) + min; - return isnan( result ) ? 0 : result; + return std::isnan( result ) ? 0 : result; } @@ -262,7 +261,7 @@ static inline float safeAmpToDbfs( float amp ) //! @return Linear amplitude static inline float safeDbfsToAmp( float dbfs ) { - return isinf( dbfs ) + return std::isinf( dbfs ) ? 0.0f : exp10( dbfs * 0.05f ); } diff --git a/plugins/Compressor/Compressor.cpp b/plugins/Compressor/Compressor.cpp index 25b4d0cf0d1..c009b91b6f3 100755 --- a/plugins/Compressor/Compressor.cpp +++ b/plugins/Compressor/Compressor.cpp @@ -328,7 +328,7 @@ bool CompressorEffect::processAudioBuffer(sampleFrame* buf, const fpp_t frames) m_rmsVal[i] = m_rmsTimeConst * m_rmsVal[i] + ((1 - m_rmsTimeConst) * (inputValue * inputValue)); // Grab the peak or RMS value - inputValue = qMax(COMP_NOISE_FLOOR, peakmode ? abs(inputValue) : sqrt(m_rmsVal[i])); + inputValue = qMax(COMP_NOISE_FLOOR, peakmode ? std::abs(inputValue) : std::sqrt(m_rmsVal[i])); // The following code uses math magic to semi-efficiently // find the largest value in the lookahead buffer. diff --git a/plugins/GigPlayer/GigPlayer.cpp b/plugins/GigPlayer/GigPlayer.cpp index 1e077f5d4e3..4ecbd3500b2 100644 --- a/plugins/GigPlayer/GigPlayer.cpp +++ b/plugins/GigPlayer/GigPlayer.cpp @@ -568,7 +568,7 @@ void GigInstrument::loadSample( GigSample& sample, sampleFrame* sampleData, f_cn { samplestoloopend = loopEnd - sample.sample->GetPos(); readsamples = sample.sample->Read( &buffer[totalreadsamples * sample.sample->FrameSize], - min( samplestoread, samplestoloopend ) ); + std::min( samplestoread, samplestoloopend ) ); samplestoread -= readsamples; totalreadsamples += readsamples; diff --git a/plugins/vestige/vestige.cpp b/plugins/vestige/vestige.cpp index d76ac37f6e5..421cc72408a 100644 --- a/plugins/vestige/vestige.cpp +++ b/plugins/vestige/vestige.cpp @@ -137,7 +137,7 @@ class VstInstrumentPlugin : public VstPlugin return m_pluginSubWindow.get(); } private: - unique_ptr m_pluginSubWindow; + std::unique_ptr m_pluginSubWindow; }; diff --git a/plugins/zynaddsubfx/zynaddsubfx b/plugins/zynaddsubfx/zynaddsubfx index ccac06336b3..5a8328bc43c 160000 --- a/plugins/zynaddsubfx/zynaddsubfx +++ b/plugins/zynaddsubfx/zynaddsubfx @@ -1 +1 @@ -Subproject commit ccac06336b363b9afe7ff4aea02bfa2d48187e1a +Subproject commit 5a8328bc43ce638b5b5c4d8fbb23fc401c18d2b5 diff --git a/src/core/MixHelpers.cpp b/src/core/MixHelpers.cpp index de1c5cfc3a8..d78f6f879d5 100644 --- a/src/core/MixHelpers.cpp +++ b/src/core/MixHelpers.cpp @@ -99,7 +99,7 @@ bool sanitize( sampleFrame * src, int frames ) { for( int c = 0; c < 2; ++c ) { - if( isinf( src[f][c] ) || isnan( src[f][c] ) ) + if( std::isinf( src[f][c] ) || std::isnan( src[f][c] ) ) { #ifdef LMMS_DEBUG printf("Bad data, clearing buffer. frame: "); @@ -210,8 +210,8 @@ void addSanitizedMultipliedByBuffer( sampleFrame* dst, const sampleFrame* src, f for( int f = 0; f < frames; ++f ) { - dst[f][0] += ( isinf( src[f][0] ) || isnan( src[f][0] ) ) ? 0.0f : src[f][0] * coeffSrc * coeffSrcBuf->values()[f]; - dst[f][1] += ( isinf( src[f][1] ) || isnan( src[f][1] ) ) ? 0.0f : src[f][1] * coeffSrc * coeffSrcBuf->values()[f]; + dst[f][0] += ( std::isinf( src[f][0] ) || std::isnan( src[f][0] ) ) ? 0.0f : src[f][0] * coeffSrc * coeffSrcBuf->values()[f]; + dst[f][1] += ( std::isinf( src[f][1] ) || std::isnan( src[f][1] ) ) ? 0.0f : src[f][1] * coeffSrc * coeffSrcBuf->values()[f]; } } @@ -226,10 +226,10 @@ void addSanitizedMultipliedByBuffers( sampleFrame* dst, const sampleFrame* src, for( int f = 0; f < frames; ++f ) { - dst[f][0] += ( isinf( src[f][0] ) || isnan( src[f][0] ) ) + dst[f][0] += ( std::isinf( src[f][0] ) || std::isnan( src[f][0] ) ) ? 0.0f : src[f][0] * coeffSrcBuf1->values()[f] * coeffSrcBuf2->values()[f]; - dst[f][1] += ( isinf( src[f][1] ) || isnan( src[f][1] ) ) + dst[f][1] += ( std::isinf( src[f][1] ) || std::isnan( src[f][1] ) ) ? 0.0f : src[f][1] * coeffSrcBuf1->values()[f] * coeffSrcBuf2->values()[f]; } @@ -243,8 +243,8 @@ struct AddSanitizedMultipliedOp void operator()( sampleFrame& dst, const sampleFrame& src ) const { - dst[0] += ( isinf( src[0] ) || isnan( src[0] ) ) ? 0.0f : src[0] * m_coeff; - dst[1] += ( isinf( src[1] ) || isnan( src[1] ) ) ? 0.0f : src[1] * m_coeff; + dst[0] += ( std::isinf( src[0] ) || std::isnan( src[0] ) ) ? 0.0f : src[0] * m_coeff; + dst[1] += ( std::isinf( src[1] ) || std::isnan( src[1] ) ) ? 0.0f : src[1] * m_coeff; } const float m_coeff; diff --git a/src/gui/widgets/Knob.cpp b/src/gui/widgets/Knob.cpp index 98a2683b198..ec96b0698d3 100644 --- a/src/gui/widgets/Knob.cpp +++ b/src/gui/widgets/Knob.cpp @@ -153,7 +153,7 @@ void Knob::onKnobNumUpdated() } // If knobFilename is still empty here we should get the fallback pixmap of size 1x1 - m_knobPixmap = make_unique(QPixmap(embed::getIconPixmap(knobFilename.toUtf8().constData()))); + m_knobPixmap = std::make_unique(QPixmap(embed::getIconPixmap(knobFilename.toUtf8().constData()))); if (!this->isEnabled()) { convertPixmapToGrayScale(*m_knobPixmap.get());