mirror of
https://github.com/nlohmann/json.git
synced 2026-03-04 16:26:26 +00:00
Add clang-tools to required tools for ci_static_analysis_clang (#3724)
* 💚 add clang-tools to required tools for ci_static_analysis_clang * 🚨 update Clang-Tidy warning selection * 🚨 fix Clang-Tidy warnings * 🚨 fix Clang-Tidy warnings * 🚨 fix Clang-Tidy warnings * 🚨 fix Clang-Tidy warnings * 🚨 fix Clang-Tidy warnings * 🚨 fix Clang-Tidy warnings * 🚨 fix Clang-Tidy warnings * 🚨 fix Clang-Tidy warnings * 🚨 fix Clang-Tidy warnings * 🚨 fix Clang-Tidy warnings * 🚨 fix Clang-Tidy warnings (#3738) * ⏪ revert fix * ⏪ revert fix * 🚨 fix Clang-Tidy warnings (#3739) Co-authored-by: Florian Albrechtskirchinger <falbrechtskirchinger@gmail.com>
This commit is contained in:
@@ -61,11 +61,11 @@ float make_float(uint64_t f, int e)
|
||||
e--;
|
||||
}
|
||||
|
||||
uint64_t biased_exponent = (e == kDenormalExponent && (f & kHiddenBit) == 0)
|
||||
? 0
|
||||
: static_cast<uint64_t>(e + kExponentBias);
|
||||
const uint64_t biased_exponent = (e == kDenormalExponent && (f & kHiddenBit) == 0)
|
||||
? 0
|
||||
: static_cast<uint64_t>(e + kExponentBias);
|
||||
|
||||
uint64_t bits = (f & kSignificandMask) | (biased_exponent << kPhysicalSignificandSize);
|
||||
const uint64_t bits = (f & kSignificandMask) | (biased_exponent << kPhysicalSignificandSize);
|
||||
return reinterpret_bits<float>(static_cast<uint32_t>(bits));
|
||||
}
|
||||
|
||||
@@ -113,11 +113,11 @@ double make_double(uint64_t f, int e)
|
||||
e--;
|
||||
}
|
||||
|
||||
uint64_t biased_exponent = (e == kDenormalExponent && (f & kHiddenBit) == 0)
|
||||
? 0
|
||||
: static_cast<uint64_t>(e + kExponentBias);
|
||||
const uint64_t biased_exponent = (e == kDenormalExponent && (f & kHiddenBit) == 0)
|
||||
? 0
|
||||
: static_cast<uint64_t>(e + kExponentBias);
|
||||
|
||||
uint64_t bits = (f & kSignificandMask) | (biased_exponent << kPhysicalSignificandSize);
|
||||
const uint64_t bits = (f & kSignificandMask) | (biased_exponent << kPhysicalSignificandSize);
|
||||
return reinterpret_bits<double>(bits);
|
||||
}
|
||||
} // namespace
|
||||
@@ -458,7 +458,7 @@ TEST_CASE("formatting")
|
||||
{
|
||||
auto check_integer = [](std::int64_t number, const std::string & expected)
|
||||
{
|
||||
nlohmann::json j = number;
|
||||
const nlohmann::json j = number;
|
||||
CHECK(j.dump() == expected);
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user