fix math ambiguity & OSX compilation
authorRobin Gareus <robin@gareus.org>
Thu, 13 Oct 2016 21:41:49 +0000 (23:41 +0200)
committerRobin Gareus <robin@gareus.org>
Thu, 13 Oct 2016 21:41:49 +0000 (23:41 +0200)
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)

libs/surfaces/cc121/cc121.cc

index 800605c9f7a31089614263318d28f80838a86883..241abb1518e2d05b6e575d610699eaa09901bee6 100644 (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;