Issue 1021: Fix clang 10 compilation (#1023)

This patch fixes an implicit long to double conversion, fixing
compilation on the as-of-yet unreleased clang v10.
This commit is contained in:
Jordan Bayles 2019-09-16 12:27:59 -07:00 committed by GitHub
parent 3013ed48b3
commit 18f790fbe7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -94,8 +94,7 @@ template <typename T, typename U>
static inline bool InRange(double d, T min, U max) {
// The casts can lose precision, but we are looking only for
// an approximate range. Might fail on edge cases though. ~cdunn
// return d >= static_cast<double>(min) && d <= static_cast<double>(max);
return d >= min && d <= max;
return d >= static_cast<double>(min) && d <= static_cast<double>(max);
}
#else // if !defined(JSON_USE_INT64_DOUBLE_CONVERSION)
static inline double integerToDouble(Json::UInt64 value) {