Commit 0d98066a authored by Jim Meyering's avatar Jim Meyering Committed by Viswanath Sivakumar

folly/stats/BucketedTimeSeries-defs.h: avoid -Wsign-compare error

Summary:
* folly/stats/BucketedTimeSeries-defs.h (BucketedTimeSeries):
Assume that maxDuration is never negative, and cast the signed
duration_.count() to size_t, to avoid this error from gcc-4.9:

folly/stats/BucketedTimeSeries-defs.h:38:18: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare]

Test Plan:
Run this and note there are fewer errors than before:
fbconfig --platform-all=gcc-4.9-glibc-2.20 -r folly && fbmake dbgo

Reviewed By: andrei.alexandrescu@fb.com

Subscribers: trunkagent, net-systems@, folly-diffs@

FB internal diff: D1770171

Tasks: 5941250

Signature: t1:1770171:1420669115:61e6b8d3248f88b25736322c7066af015209fba5
parent ab794fb6
......@@ -35,7 +35,7 @@ BucketedTimeSeries<VT, TT>::BucketedTimeSeries(size_t nBuckets,
//
// There is no point in having more buckets than our timestamp
// granularity: otherwise we would have buckets that could never be used.
if (nBuckets > duration_.count()) {
if (nBuckets > size_t(duration_.count())) {
nBuckets = duration_.count();
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment