Histogram and Timeseries vs gcc-4.9 and -Wsign-compare
[folly.git] / folly / stats / TimeseriesHistogram.h
index 7f4bc0841d12b8c3c47bc10dd84ca84e75d4b6ac..6c944fed4203698e76c7707f5a7b28711cf8eb7d 100644 (file)
@@ -118,7 +118,7 @@ class TimeseriesHistogram {
   /* Total count of values at the given timeseries level (all buckets). */
   int64_t count(int level) const {
     int64_t total = 0;
-    for (int b = 0; b < buckets_.getNumBuckets(); ++b) {
+    for (unsigned int b = 0; b < buckets_.getNumBuckets(); ++b) {
       total += buckets_.getByIndex(b).count(level);
     }
     return total;
@@ -127,7 +127,7 @@ class TimeseriesHistogram {
   /* Total count of values added during the given interval (all buckets). */
   int64_t count(TimeType start, TimeType end) const {
     int64_t total = 0;
-    for (int b = 0; b < buckets_.getNumBuckets(); ++b) {
+    for (unsigned int b = 0; b < buckets_.getNumBuckets(); ++b) {
       total += buckets_.getByIndex(b).count(start, end);
     }
     return total;
@@ -136,7 +136,7 @@ class TimeseriesHistogram {
   /* Total sum of values at the given timeseries level (all buckets). */
   ValueType sum(int level) const {
     ValueType total = ValueType();
-    for (int b = 0; b < buckets_.getNumBuckets(); ++b) {
+    for (unsigned int b = 0; b < buckets_.getNumBuckets(); ++b) {
       total += buckets_.getByIndex(b).sum(level);
     }
     return total;
@@ -145,7 +145,7 @@ class TimeseriesHistogram {
   /* Total sum of values added during the given interval (all buckets). */
   ValueType sum(TimeType start, TimeType end) const {
     ValueType total = ValueType();
-    for (int b = 0; b < buckets_.getNumBuckets(); ++b) {
+    for (unsigned int b = 0; b < buckets_.getNumBuckets(); ++b) {
       total += buckets_.getByIndex(b).sum(start, end);
     }
     return total;