Skip to content

Commit a9a2772

Browse files
committed
Revert "SERVER-29887 address clang-4.0 warnings in geo code"
This reverts commit 8204c7d.
1 parent 3848e76 commit a9a2772

File tree

3 files changed

+5
-9
lines changed

3 files changed

+5
-9
lines changed

src/mongo/db/exec/geo_near.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,7 @@ class GeoNear2DStage::DensityEstimator {
288288
// Since appendVertexNeighbors(level, output) requires level < hash.getBits(),
289289
// we have to start to find documents at most GeoHash::kMaxBits - 1. Thus the finest
290290
// search area is 16 * finest cell area at GeoHash::kMaxBits.
291-
_currentLevel = std::max(0, hashParams.bits - 1);
291+
_currentLevel = std::max(0u, hashParams.bits - 1u);
292292
}
293293

294294
PlanStage::StageState work(OperationContext* opCtx,

src/mongo/db/geo/r2_region_coverer.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,13 +68,15 @@ R2RegionCoverer::R2RegionCoverer(GeoHashConverter* hashConverter)
6868
R2RegionCoverer::~R2RegionCoverer() {}
6969

7070
void R2RegionCoverer::setMinLevel(unsigned int minLevel) {
71+
dassert(minLevel >= 0);
7172
dassert(minLevel <= GeoHash::kMaxBits);
72-
_minLevel = min(GeoHash::kMaxBits, minLevel);
73+
_minLevel = max(0u, min(GeoHash::kMaxBits, minLevel));
7374
}
7475

7576
void R2RegionCoverer::setMaxLevel(unsigned int maxLevel) {
77+
dassert(maxLevel >= 0);
7678
dassert(maxLevel <= GeoHash::kMaxBits);
77-
_maxLevel = min(GeoHash::kMaxBits, maxLevel);
79+
_maxLevel = max(0u, min(GeoHash::kMaxBits, maxLevel));
7880
}
7981

8082
void R2RegionCoverer::setMaxCells(int maxCells) {

src/third_party/s2/util/math/mathutil.cc

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,7 @@ using std::vector;
2727
return static_cast<IntOut>(x < 0 ? (x - 0.5) : (x + 0.5));
2828
}
2929

30-
// MONGODB suppress clang-4.0 warning by disabling the following line, but leave it in for MSVC
31-
// since removing it results in a linker error there.
32-
// error: explicit instantiation of 'Round<int, double>' that occurs after an explicit
33-
// specialization has no effect [-Werror,-Winstantiation-after-specialization]
34-
#ifdef _MSC_VER
3530
template int MathUtil::Round<int,double>(double x);
36-
#endif
3731

3832
MathUtil::QuadraticRootType MathUtil::RealRootsForQuadratic(long double a,
3933
long double b,

0 commit comments

Comments
 (0)