folly: -Wsign-compare
authorLucian Grijincu <lucian@fb.com>
Mon, 1 Jun 2015 05:58:40 +0000 (22:58 -0700)
committerNoam Lerner <noamler@fb.com>
Wed, 3 Jun 2015 16:51:53 +0000 (09:51 -0700)
Test Plan: runtests

Reviewed By: philipp@fb.com

Subscribers: folly-diffs@, jsedgwick, yfeldblum, tudort, chalfant

FB internal diff: D2114063

Signature: t1:2114063:1433111051:6686508d78de39ea4ea5dc283189c472e23f8f42

folly/experimental/test/SharedMutexTest.cpp
folly/futures/Future-inl.h

index 2bf85b25df072c97866006e1fbf3776a05a907cb..026284c37bef83376c8376478acaf919e7614617 100644 (file)
@@ -486,7 +486,7 @@ static void runContendedReaders(size_t numOps,
   vector<thread> threads(numThreads);
 
   BENCHMARK_SUSPEND {
-    for (int t = 0; t < numThreads; ++t) {
+    for (size_t t = 0; t < numThreads; ++t) {
       threads[t] = DSched::thread([&, t, numThreads] {
         Lock privateLock;
         Lock* lock = useSeparateLocks ? &privateLock : &globalLock;
@@ -583,7 +583,7 @@ static void runMixed(size_t numOps,
   vector<thread> threads(numThreads);
 
   BENCHMARK_SUSPEND {
-    for (int t = 0; t < numThreads; ++t) {
+    for (size_t t = 0; t < numThreads; ++t) {
       threads[t] = DSched::thread([&, t, numThreads] {
         struct drand48_data buffer;
         srand48_r(t, &buffer);
@@ -712,7 +712,7 @@ static void runAllAndValidate(size_t numOps, size_t numThreads) {
   vector<thread> threads(numThreads);
 
   BENCHMARK_SUSPEND {
-    for (int t = 0; t < numThreads; ++t) {
+    for (size_t t = 0; t < numThreads; ++t) {
       threads[t] = DSched::thread([&, t, numThreads] {
         struct drand48_data buffer;
         srand48_r(t, &buffer);
@@ -1098,7 +1098,7 @@ static void runRemoteUnlock(size_t numOps,
   vector<thread> threads(numSendingThreads + numReceivingThreads);
 
   BENCHMARK_SUSPEND {
-    for (int t = 0; t < threads.size(); ++t) {
+    for (size_t t = 0; t < threads.size(); ++t) {
       threads[t] = DSched::thread([&, t, numSendingThreads] {
         if (t >= numSendingThreads) {
           // we're a receiver
@@ -1246,7 +1246,7 @@ static void runPingPong(size_t numRounds, size_t burnCount) {
       while (!goPtr->load()) {
         this_thread::yield();
       }
-      for (int i = 0; i < numRounds; ++i) {
+      for (size_t i = 0; i < numRounds; ++i) {
         locks[i % 3].first.unlock();
         locks[(i + 2) % 3].first.lock();
         burn(burnCount);
@@ -1257,7 +1257,7 @@ static void runPingPong(size_t numRounds, size_t burnCount) {
       while (!goPtr->load()) {
         this_thread::yield();
       }
-      for (int i = 0; i < numRounds; ++i) {
+      for (size_t i = 0; i < numRounds; ++i) {
         locks[i % 3].first.lock_shared();
         burn(burnCount);
         locks[(i + 2) % 3].first.unlock_shared();
index c33e5a8dfe0090cf7cfcd5b01006c2ff53cb2172..a63b2a801fb9c09a7f7566eafc9feb2874f8f96b 100644 (file)
@@ -688,7 +688,7 @@ collectN(InputIterator first, InputIterator last, size_t n) {
   };
   auto ctx = std::make_shared<CollectNContext>();
 
-  if (std::distance(first, last) < n) {
+  if (size_t(std::distance(first, last)) < n) {
     ctx->p.setException(std::runtime_error("Not enough futures"));
   } else {
     // for each completed Future, increase count and add to vector, until we