13
0

fix math ambiguity & OSX compilation

cc121.cc: In member function 'void ArdourSurface::CC121::encoder_handler(MIDI::Parser&, MIDI::EventTwoBytes*)':
cc121.cc:413: 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 2016-10-13 23:41:49 +02:00
parent 8f9a9523d2
commit 88dedfcbdb

View File

@ -410,8 +410,8 @@ CC121::encoder_handler (MIDI::Parser &, MIDI::EventTwoBytes* tb)
if (_current_stripable) {
/* Get amount of change (encoder clicks) * (change per click)*/
/*Create an exponential curve*/
float curve = sign * pow(adj, (1.0 + 10.0) / 10.0);
adj = curve * (31 / 1000.0);
float curve = sign * powf (adj, (1.f + 10.f) / 10.f);
adj = curve * (31.f / 1000.f);
ardour_pan_azimuth (adj);
}
break;