diff options
author | Hari Khalsa <hkhalsa@10gen.com> | 2012-12-20 11:59:59 -0500 |
---|---|---|
committer | Hari Khalsa <hkhalsa@10gen.com> | 2012-12-20 11:59:59 -0500 |
commit | 61659ebd62559c840a1df22ce9910d6a94cab5af (patch) | |
tree | 0f7420cab988930e736bc0cd7c0ffc629e0cab1b /src/third_party/s2 | |
parent | d74ed653b484fa707af411a918bb763a1bdd6464 (diff) | |
download | mongo-61659ebd62559c840a1df22ce9910d6a94cab5af.tar.gz |
SERVER-7822 SERVER-7976 pragma-out windows s2 warnings
Diffstat (limited to 'src/third_party/s2')
-rw-r--r-- | src/third_party/s2/s2cell.cc | 3 | ||||
-rw-r--r-- | src/third_party/s2/s2cellid.cc | 3 | ||||
-rw-r--r-- | src/third_party/s2/s2cellid.h | 9 | ||||
-rw-r--r-- | src/third_party/s2/s2regioncoverer.h | 3 |
4 files changed, 18 insertions, 0 deletions
diff --git a/src/third_party/s2/s2cell.cc b/src/third_party/s2/s2cell.cc index f01782fefe3..b6307cb58d4 100644 --- a/src/third_party/s2/s2cell.cc +++ b/src/third_party/s2/s2cell.cc @@ -16,8 +16,11 @@ // // The expression below rounds up (43 + sizeof(void*)) to the nearest // multiple of sizeof(void*). +#pragma warning(push) +#pragma warning( disable: 4146 ) COMPILE_ASSERT(sizeof(S2Cell) <= ((43+2*sizeof(void*)-1) & -sizeof(void*)), S2Cell_is_getting_bloated); +#pragma warning(pop) S2Point S2Cell::GetVertexRaw(int k) const { // Vertices are returned in the order SW, SE, NE, NW. diff --git a/src/third_party/s2/s2cellid.cc b/src/third_party/s2/s2cellid.cc index 2ce3695e862..ae2d4ea2da4 100644 --- a/src/third_party/s2/s2cellid.cc +++ b/src/third_party/s2/s2cellid.cc @@ -118,7 +118,10 @@ int S2CellId::level() const { } // We only need to look at even-numbered bits to determine the // level of a valid cell id. +#pragma warning(push) +#pragma warning( disable: 4146 ) x &= -x; // Get lowest bit. +#pragma warning(pop) if (x & 0x00005555) level += 8; if (x & 0x00550055) level += 4; if (x & 0x05050505) level += 2; diff --git a/src/third_party/s2/s2cellid.h b/src/third_party/s2/s2cellid.h index 4828597c859..2650f6bc81c 100644 --- a/src/third_party/s2/s2cellid.h +++ b/src/third_party/s2/s2cellid.h @@ -282,7 +282,10 @@ class S2CellId { // equal to (uint64(1) << (2 * (kMaxLevel - level))). So for example, // a.lsb() <= b.lsb() if and only if a.level() >= b.level(), but the // first test is more efficient. +#pragma warning(push) +#pragma warning( disable: 4146 ) uint64 lsb() const { return id_ & -id_; } +#pragma warning(pop) // Return the lowest-numbered bit that is on for cells at the given level. inline static uint64 lsb_for_level(int level) { @@ -407,14 +410,20 @@ inline S2CellId S2CellId::parent(int level) const { DCHECK_GE(level, 0); DCHECK_LE(level, this->level()); uint64 new_lsb = lsb_for_level(level); +#pragma warning(push) +#pragma warning( disable: 4146 ) return S2CellId((id_ & -new_lsb) | new_lsb); +#pragma warning(pop) } inline S2CellId S2CellId::parent() const { DCHECK(is_valid()); DCHECK(!is_face()); uint64 new_lsb = lsb() << 2; +#pragma warning(push) +#pragma warning( disable: 4146 ) return S2CellId((id_ & -new_lsb) | new_lsb); +#pragma warning(pop) } inline S2CellId S2CellId::child(int position) const { diff --git a/src/third_party/s2/s2regioncoverer.h b/src/third_party/s2/s2regioncoverer.h index 728a1d08f9f..54e5d86312a 100644 --- a/src/third_party/s2/s2regioncoverer.h +++ b/src/third_party/s2/s2regioncoverer.h @@ -140,7 +140,10 @@ class S2RegionCoverer { S2Cell cell; bool is_terminal; // Cell should not be expanded further. int num_children; // Number of children that intersect the region. +#pragma warning(push) +#pragma warning( disable: 4200 ) Candidate* children[0]; // Actual size may be 0, 4, 16, or 64 elements. +#pragma warning(pop) }; // If the cell intersects the given region, return a new candidate with no |