]> sigrok.org Git - pulseview.git/commitdiff
Fix two errors with clang 3.6.
authorUwe Hermann <redacted>
Wed, 27 Aug 2014 13:29:48 +0000 (15:29 +0200)
committerUwe Hermann <redacted>
Wed, 27 Aug 2014 13:32:27 +0000 (15:32 +0200)
[...]/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

pv/view/viewport.cpp
pv/widgets/sweeptimingwidget.cpp

index f0c78e67fcd727bdea0249120259b80331f8f1b1..b141c38ae35ab29b2b44233bff6e8d13be16de3d 100644 (file)
@@ -28,6 +28,7 @@
 
 #include <QMouseEvent>
 
+using std::abs;
 using std::max;
 using std::min;
 using std::shared_ptr;
index 00ebb7697e010fccdb6d256db53292e6a7a01447..7a734a134ede774702094792341dcbbf7e9df462 100644 (file)
@@ -26,6 +26,7 @@
 
 #include <extdef.h>
 
+using std::abs;
 using std::vector;
 
 namespace pv {