Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix some type errors #82

Merged
merged 1 commit into from Aug 14, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/analyzer.cpp
Expand Up @@ -471,12 +471,12 @@ void analyzer::draw(int subindex, float *data, int points, bool fftdone) const
//pumping up actual signal an erase surrounding
// sounds
fft_outL[_iter] = 0.25f * std::max(n * 0.6f * \
fabs(fft_outL[_iter]) - var1L , 1e-20);
fabs(fft_outL[_iter]) - var1L , 1e-20f);
if(_mode == 3 or _mode == 4) {
// do the same with R channel if needed
lastoutR = fft_outR[_iter];
fft_outR[_iter] = 0.25f * std::max(n * \
0.6f * fabs(fft_outR[_iter]) - var1R , 1e-20);
0.6f * fabs(fft_outR[_iter]) - var1R , 1e-20f);
}
break;
}
Expand Down
2 changes: 1 addition & 1 deletion src/jack_client.cpp
Expand Up @@ -226,7 +226,7 @@ void jack_client::calculate_plugin_order(std::vector<int> &indices)
map<string, int>::const_iterator p = port_to_plugin.find((*k) + cnlen + 1);
if (p != port_to_plugin.end())
{
run_before.insert(make_pair<int, int>(p->second, i));
run_before.insert(make_pair<const int&, unsigned int&>(p->second, i));

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it would be simpler to call the std::pair constructor directly here, like this:

run_before.insert(pair<int, int>(p->second, i));

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or maybe like this (which also seems to work):

run_before.insert(make_pair(p->second, i));

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yup, make_pair(p->second, i) did the job for me too.
The other changes are still necessary though.

}
}
jack_free(conns);
Expand Down
4 changes: 2 additions & 2 deletions src/modules_dist.cpp
Expand Up @@ -794,8 +794,8 @@ uint32_t tapesimulator_audio_module::process(uint32_t offset, uint32_t numsample
lfo2.advance(1);

// dot
rms = std::max((double)rms, (fabs(Lo) + fabs(Ro)) / 2);
input = std::max((double)input, (fabs(Lc) + fabs(Rc)) / 2);
rms = std::max((double)rms, (double)((fabs(Lo) + fabs(Ro)) / 2));
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can even remove the (double) and just replace 2 by 2.0. That will do the trick too.

input = std::max((double)input, (double)((fabs(Lc) + fabs(Rc)) / 2));

float values[] = {inL, inR, outs[0][i], outs[1][i]};
meters.process(values);
Expand Down
4 changes: 2 additions & 2 deletions src/modules_limit.cpp
Expand Up @@ -429,7 +429,7 @@ uint32_t multibandlimiter_audio_module::process(uint32_t offset, uint32_t numsam
}

// write multiband coefficient to buffer
buffer[pos] = std::min(*params[param_limit] / std::max(fabs(tmpL), fabs(tmpR)), 1.0);
buffer[pos] = std::min(*params[param_limit] / std::max(fabs(tmpL), fabs(tmpR)), 1.0f);

// step forward in multiband buffer
pos = (pos + channels) % buffer_size;
Expand Down Expand Up @@ -811,7 +811,7 @@ uint32_t sidechainlimiter_audio_module::process(uint32_t offset, uint32_t numsam
}

// write multiband coefficient to buffer
buffer[pos] = std::min(*params[param_limit] / std::max(fabs(tmpL), fabs(tmpR)), 1.0);
buffer[pos] = std::min(*params[param_limit] / std::max(fabs(tmpL), fabs(tmpR)), 1.0f);

// step forward in multiband buffer
pos = (pos + channels) % buffer_size;
Expand Down