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;
{
unsigned long long sum = 0, cum;
unsigned i;
+
+ if (!f)
+ return;
+
for (i = 0; i < h->allocated; i++)
sum += h->data[i];
cum = sum;