folly/Bits.h (BitIterator): avoid -Wsign-compare error
authorJim Meyering <meyering@fb.com>
Wed, 7 Jan 2015 03:25:48 +0000 (19:25 -0800)
committerViswanath Sivakumar <viswanath@fb.com>
Tue, 13 Jan 2015 19:01:05 +0000 (11:01 -0800)
commit0a9f6eefe125672a5978333c85acc865746841da
tree095ed8b1591e4dcbc53771a7069c830b32b4777d
parent377e3f4cb4f599e01a897cf761d05c3ffa25b511
folly/Bits.h (BitIterator): avoid -Wsign-compare error

Summary:
* folly/Bits.h (BitIterator) [bitOffset_]: Change type of this
member from ssize_t to "unsigned int".
(bitsPerBlock): Change return type from size_t to "unsigned int".
These changes avoid some -Wsign-compare-highlighted issues, e.g.,
folly/Bits.h:456: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

I've also run "fbmake runtests", and it failed precisely the way it does
without this patch.

Reviewed By: andrei.alexandrescu@fb.com

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

FB internal diff: D1770613

Tasks: 5941250

Signature: t1:1770613:1420757397:7ee7e5de500c8991af2597a6245d12d8f286b4b7
folly/Bits.h