Commit 3d4f7737 authored by Jim Meyering's avatar Jim Meyering Committed by Viswanath Sivakumar

folly/test/SpinLockTest.cpp: avoid -Wsign-compare error (trivial)

Summary:
* folly/test/SpinLockTest.cpp (trylockTestThread):
Change parameter type from int to size_t, to fix these:
folly/test/SpinLockTest.cpp:67:25: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare]
folly/test/SpinLockTest.cpp:82:60: 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: net-systems@, folly-diffs@

FB internal diff: D1770564

Tasks: 5941250

Signature: t1:1770564:1420674373:fa3020398e2df66590eb71f798419b6f555d07c4
parent 5227dcf2
......@@ -60,7 +60,7 @@ struct TryLockState {
};
template <typename LOCK>
void trylockTestThread(TryLockState<LOCK>* state, int count) {
void trylockTestThread(TryLockState<LOCK>* state, size_t count) {
while (true) {
asm("pause");
SpinLockGuardImpl<LOCK> g(state->lock1);
......@@ -111,7 +111,7 @@ void trylockTest() {
int nthrs = sysconf(_SC_NPROCESSORS_ONLN) + 4;
std::vector<std::thread> threads;
TryLockState<LOCK> state;
int count = 100;
size_t count = 100;
for (int i = 0; i < nthrs; ++i) {
threads.push_back(std::thread(trylockTestThread<LOCK>, &state, 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