Skip to content

Commit

Permalink
Revert "SERVER-29887 address clang-4.0 warnings in geo code"
Browse files Browse the repository at this point in the history
This reverts commit 8204c7d.
  • Loading branch information
RedBeard0531 committed Jul 14, 2017
1 parent 3848e76 commit a9a2772
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/mongo/db/exec/geo_near.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ class GeoNear2DStage::DensityEstimator {
// Since appendVertexNeighbors(level, output) requires level < hash.getBits(),
// we have to start to find documents at most GeoHash::kMaxBits - 1. Thus the finest
// search area is 16 * finest cell area at GeoHash::kMaxBits.
_currentLevel = std::max(0, hashParams.bits - 1);
_currentLevel = std::max(0u, hashParams.bits - 1u);
}

PlanStage::StageState work(OperationContext* opCtx,
Expand Down
6 changes: 4 additions & 2 deletions src/mongo/db/geo/r2_region_coverer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,15 @@ R2RegionCoverer::R2RegionCoverer(GeoHashConverter* hashConverter)
R2RegionCoverer::~R2RegionCoverer() {}

void R2RegionCoverer::setMinLevel(unsigned int minLevel) {
dassert(minLevel >= 0);
dassert(minLevel <= GeoHash::kMaxBits);
_minLevel = min(GeoHash::kMaxBits, minLevel);
_minLevel = max(0u, min(GeoHash::kMaxBits, minLevel));
}

void R2RegionCoverer::setMaxLevel(unsigned int maxLevel) {
dassert(maxLevel >= 0);
dassert(maxLevel <= GeoHash::kMaxBits);
_maxLevel = min(GeoHash::kMaxBits, maxLevel);
_maxLevel = max(0u, min(GeoHash::kMaxBits, maxLevel));
}

void R2RegionCoverer::setMaxCells(int maxCells) {
Expand Down
6 changes: 0 additions & 6 deletions src/third_party/s2/util/math/mathutil.cc
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,7 @@ using std::vector;
return static_cast<IntOut>(x < 0 ? (x - 0.5) : (x + 0.5));
}

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

MathUtil::QuadraticRootType MathUtil::RealRootsForQuadratic(long double a,
long double b,
Expand Down

0 comments on commit a9a2772

Please sign in to comment.