Histogram and Timeseries vs gcc-4.9 and -Wsign-compare
authorJim Meyering <meyering@fb.com>
Tue, 6 Jan 2015 18:00:14 +0000 (10:00 -0800)
committerViswanath Sivakumar <viswanath@fb.com>
Tue, 13 Jan 2015 19:01:04 +0000 (11:01 -0800)
commit29be5d6dca2f048f194d890c8e6c90a999fd3ba4
tree63c02df82792df408548ceedef175038613f1e80
parent8cae10aa7399b37ef15a85f9afbf485cf57a5135
Histogram and Timeseries vs gcc-4.9 and -Wsign-compare

Summary:
Address multiple -Werror=sign-compare issues exposed when building
tao with gcc-4.9.
In most of these changes I've changed the type of the index in
a for-loop from int to size_t.  The important thing is to use
an unsigned type when the limit is also unsigned.  I choose size_t
because the general recommendation (when writing portable code)
to avoid size-tied types like uint32_t and uint64_t unless you
have a very good reason to require them.

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

Reviewed By: andrei.alexandrescu@fb.com

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

FB internal diff: D1766651

Tasks: 5941250

Signature: t1:1766651:1420594537:56ef53ca233e1649469db9570942c1d5dd47cf6d
folly/stats/Histogram.h
folly/stats/MultiLevelTimeSeries-defs.h
folly/stats/TimeseriesHistogram-defs.h
folly/stats/TimeseriesHistogram.h