Skip to content

Commit

Permalink
Code review changes
Browse files Browse the repository at this point in the history
Prevent warnings about implicit conversion from int to float.
  • Loading branch information
michaelgregorius committed Mar 11, 2024
1 parent f3448d0 commit 12a5981
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion plugins/Eq/EqEffect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ float EqEffect::peakBand( float minF, float maxF, EqAnalyser *fft, int sr )
{
if( bandToFreq( x ,sr) >= minF && bandToFreq( x,sr ) <= maxF )
{
h = 20 * ( log10( *b / fftEnergy ) );
h = 20. * ( log10( *b / fftEnergy ) );
peak = h > peak ? h : peak;
}
}
Expand Down
4 changes: 2 additions & 2 deletions plugins/Eq/EqSpectrumView.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ EqSpectrumView::EqSpectrumView(EqAnalyser *b, QWidget *_parent) :
void EqSpectrumView::paintEvent(QPaintEvent *event)
{
const float energy = m_analyser->getEnergy();
if (energy <= 0)
if (energy <= 0.)
{
// If there is no energy in the signal we don't need to draw anything
return;
Expand Down Expand Up @@ -238,7 +238,7 @@ void EqSpectrumView::paintEvent(QPaintEvent *event)
const float fallOff = 1.07;
for( int x = 0; x < MAX_BANDS; ++x, ++bands )
{
peak = *bands != 0 ? ( fh * 2.0 / 3.0 * ( 20 * ( log10( *bands / energy ) ) - LOWER_Y ) / ( - LOWER_Y ) ) : 0.;
peak = *bands != 0. ? ( fh * 2.0 / 3.0 * ( 20. * ( log10( *bands / energy ) ) - LOWER_Y ) / ( - LOWER_Y ) ) : 0.;
if( peak < 0 )
{
peak = 0;
Expand Down

0 comments on commit 12a5981

Please sign in to comment.