Commit 69e1c7dc authored by Jim Meyering's avatar Jim Meyering Committed by Viswanath Sivakumar

folly/AtomicHashMap-inl.h: avoid -Wsign-compare warning/error (easy)

Summary:
* folly/AtomicHashMap-inl.h (insertInternal): Do not declare
nextMapIdx to be signed ("int"), since we compare it against
variables of unsigned type.  Otherwise, gcc-4.9 would give this
diagnostic:
folly/AtomicHashMap-inl.h:99:18: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare]
complaining about this comparison:
if (nextMapIdx >= kNumSubMaps_ ||

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: D1770683

Tasks: 5941250

Signature: t1:1770683:1420683505:4452c7cb4f14f098be089601be906884036348ed
parent 29be5d6d
...@@ -78,7 +78,7 @@ typename AtomicHashMap<KeyT, ValueT, HashFcn, EqualFcn, Allocator>::SimpleRetT ...@@ -78,7 +78,7 @@ typename AtomicHashMap<KeyT, ValueT, HashFcn, EqualFcn, Allocator>::SimpleRetT
AtomicHashMap<KeyT, ValueT, HashFcn, EqualFcn, Allocator>:: AtomicHashMap<KeyT, ValueT, HashFcn, EqualFcn, Allocator>::
insertInternal(key_type key, T&& value) { insertInternal(key_type key, T&& value) {
beginInsertInternal: beginInsertInternal:
int nextMapIdx = // this maintains our state auto nextMapIdx = // this maintains our state
numMapsAllocated_.load(std::memory_order_acquire); numMapsAllocated_.load(std::memory_order_acquire);
typename SubMap::SimpleRetT ret; typename SubMap::SimpleRetT ret;
FOR_EACH_RANGE(i, 0, nextMapIdx) { FOR_EACH_RANGE(i, 0, nextMapIdx) {
......
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