]> sigrok.org Git - pulseview.git/blobdiff - pv/view/ruler.cpp
Corrected signed/unsigned inconsistencies in Ruler::paintEvent
[pulseview.git] / pv / view / ruler.cpp
index 84a6a2d736afd250cb22bf6bda4d7f3e2135a24c..f71240de1722c301d9b6ad0bb1960a8ff338e5ed 100644 (file)
@@ -21,7 +21,7 @@
 #include "ruler.h"
 #include "view.h"
 
-#include "../../extdef.h"
+#include <extdef.h>
 
 #include <assert.h>
 #include <math.h>
@@ -56,7 +56,7 @@ void Ruler::paintEvent(QPaintEvent *event)
        const int order = (int)floorf(log10f(min_period));
        const double order_decimal = pow(10, order);
 
-       int unit = 0;
+       unsigned int unit = 0;
        double tick_period = 0.0f;
 
        do
@@ -64,7 +64,7 @@ void Ruler::paintEvent(QPaintEvent *event)
                tick_period = order_decimal * ScaleUnits[unit++];
        } while(tick_period < min_period && unit < countof(ScaleUnits));
 
-       const int prefix = (order - FirstSIPrefixPower) / 3;
+       const unsigned int prefix = (order - FirstSIPrefixPower) / 3;
        assert(prefix >= 0);
        assert(prefix < countof(SIPrefixes));