+ scale *= tmp;
+ }
+ return res;
+}
+
+/**
+ * convert a counter into an unsigned
+ */
+static INLINE unsigned cnt_to_uint(const counter_t *a)
+{
+ int i;
+
+ for (i = 1; i < STAT_CNT_NUM; ++i)
+ if (a->cnt[i])
+ return UINT_MAX;
+
+ return a->cnt[0];
+}
+
+/**
+ * check, if a counter is equal to an unsigned
+ */
+static INLINE int cnt_eq(const counter_t *a, unsigned value)
+{
+ int i;
+
+ for (i = 1; i < STAT_CNT_NUM; ++i)
+ if (a->cnt[i])
+ return 0;
+
+ return a->cnt[0] == value;
+}
+
+/**
+ * check, if a counter as greater than an unsigned
+ */
+static INLINE int cnt_gt(const counter_t *a, unsigned value)
+{
+ int i;