From: Uwe Hermann Date: Wed, 27 Aug 2014 13:29:48 +0000 (+0200) Subject: Fix two errors with clang 3.6. X-Git-Tag: pulseview-0.3.0~562 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=c8870d9e7af0af746776680a266d0da3ec3280ec;p=pulseview.git Fix two errors with clang 3.6. [...]/pv/view/viewport.cpp:202:6: error: using integer absolute value function 'abs' when argument is of floating point type [-Werror,-Wabsolute-value] if (abs(w) >= 1.0) { ^ [...]/pv/view/viewport.cpp:202:6: note: use function 'std::abs' instead if (abs(w) >= 1.0) { ^~~ std::abs [...]/pv/widgets/sweeptimingwidget.cpp:172:33: error: absolute value function 'abs' given an argument of type 'long' but has parameter of type 'int' which may cause truncation of value [-Werror,-Wabsolute-value] const int64_t this_variance = abs( ^ [...]/pv/widgets/sweeptimingwidget.cpp:172:33: note: use function 'std::abs' instead const int64_t this_variance = abs( ^~~ std::abs --- diff --git a/pv/view/viewport.cpp b/pv/view/viewport.cpp index f0c78e67..b141c38a 100644 --- a/pv/view/viewport.cpp +++ b/pv/view/viewport.cpp @@ -28,6 +28,7 @@ #include +using std::abs; using std::max; using std::min; using std::shared_ptr; diff --git a/pv/widgets/sweeptimingwidget.cpp b/pv/widgets/sweeptimingwidget.cpp index 00ebb769..7a734a13 100644 --- a/pv/widgets/sweeptimingwidget.cpp +++ b/pv/widgets/sweeptimingwidget.cpp @@ -26,6 +26,7 @@ #include +using std::abs; using std::vector; namespace pv {