Remove 'using namespace std;' from some headers (#6076)

This commit is contained in:
Levin Oehlmann
2021-07-23 19:16:51 +02:00
committed by GitHub
parent 660056045c
commit 0abbd6cb79
7 changed files with 17 additions and 18 deletions

View File

@@ -32,7 +32,6 @@
#include <QtCore/QtGlobal>
#include <cmath>
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 );
}