13
0

Fix builds (float, double ambiguity)

```
gtk2_ardour/ardour_ui.cc:2060: error: ISO C++ says that these are ambiguous, even though the worst conversion for the first is better than the worst conversion for the second:
/usr/include/architecture/i386/math.h:343: note: candidate 1: double pow(double, double)
/usr/include/c++/4.2.1/cmath:357: note: candidate 2: float std::pow(float, float)

```
This commit is contained in:
Robin Gareus 2021-05-09 05:59:29 +02:00
parent 292547b264
commit bfb5bfcd2d
Signed by: rgareus
GPG Key ID: A090BCE02CF57F04

View File

@ -2001,7 +2001,7 @@ ARDOUR_UI::transport_ffwd_rewind (bool fwd)
// (keypress auto-repeat is 100ms)
const float maxspeed = Config->get_shuttle_max_speed();
float semitone_ratio = exp2f (1.0f/12.0f);
const float octave_down = pow (1.0/semitone_ratio, 12.0);
const float octave_down = powf (1.f / semitone_ratio, 12.f);
float transport_speed = _session->actual_speed();
float speed;
@ -2050,14 +2050,14 @@ ARDOUR_UI::transport_ffwd_rewind (bool fwd)
if (transport_speed < 0.f) {
if (fabs (transport_speed) < octave_down) {
/* we need to move the speed back towards zero */
semitone_ratio = pow (1.0/semitone_ratio, 4.0);
semitone_ratio = powf (1.f / semitone_ratio, 4.f);
} else {
semitone_ratio = 1.0/semitone_ratio;
semitone_ratio = 1.f / semitone_ratio;
}
} else {
if (fabs (transport_speed) < octave_down) {
/* moving very slowly, use 4 semitone steps */
semitone_ratio = pow (semitone_ratio, 4.0);
semitone_ratio = powf (semitone_ratio, 4.f);
}
}
} else {
@ -2065,14 +2065,14 @@ ARDOUR_UI::transport_ffwd_rewind (bool fwd)
/* we need to move the speed back towards zero */
if (transport_speed < octave_down) {
semitone_ratio = pow (1.0/semitone_ratio, 4.0);
semitone_ratio = powf (1.f / semitone_ratio, 4.f);
} else {
semitone_ratio = 1.0/semitone_ratio;
semitone_ratio = 1.f / semitone_ratio;
}
} else {
if (fabs (transport_speed) < octave_down) {
/* moving very slowly, use 4 semitone steps */
semitone_ratio = pow (semitone_ratio, 4.0);
semitone_ratio = powf (semitone_ratio, 4.f);
}
}
}