From: Jim Meyering Date: Tue, 6 Jan 2015 22:28:49 +0000 (-0800) Subject: folly/gen/Parallel-inl.h: trivial -Wsign-compare fix X-Git-Tag: v0.22.0~40 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=32172a247c5f7ad8cb0beef53be26248a27a1967;p=folly.git folly/gen/Parallel-inl.h: trivial -Wsign-compare fix Summary: [just like https://phabricator.fb.com/D1767160 -- I don't know why I didn't see this the first time] * folly/gen/Parallel-inl.h (folly): Use a for-loop index of type size_t (not "int") to match type of upper bound. Otherwise, gcc-4.9 fails with this: folly/gen/Parallel-inl.h:242:27: 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: philipp@fb.com Subscribers: folly-diffs@ FB internal diff: D1767520 Signature: t1:1767520:1420583501:121f7212f78774adb6ca7cf67cbab83bf604cbbe --- diff --git a/folly/gen/ParallelMap-inl.h b/folly/gen/ParallelMap-inl.h index d2f76612..bded4431 100644 --- a/folly/gen/ParallelMap-inl.h +++ b/folly/gen/ParallelMap-inl.h @@ -75,7 +75,7 @@ class PMap : public Operator> { : pred_(pred), pipeline_(nThreads, nThreads) { workers_.reserve(nThreads); - for (int i = 0; i < nThreads; i++) { + for (size_t i = 0; i < nThreads; i++) { workers_.push_back(std::thread([this] { this->predApplier(); })); } }