]> rtime.felk.cvut.cz Git - can-benchmark.git/blobdiff - latester/histogram.h
Draw histograms after substracting message tx time
[can-benchmark.git] / latester / histogram.h
index 4a9aade0bc67c793cc89d22491eca22d8a90844b..64dcb2220804d0ab75c11783735f49b33ee9723f 100644 (file)
@@ -23,8 +23,9 @@ int histogram_init(struct histogram *h,
                return -1;
 }
 
-void histogram_add(struct histogram *h, unsigned value)
+void histogram_add(struct histogram *h, int value)
 {
+       if (value < 0) value = 0;
        unsigned index = value / h->resolution;
        if (index >= h->allocated)
                index = h->allocated - 1;