mirror of
https://github.com/nlohmann/json.git
synced 2026-10-07 23:17:14 +00:00
Fix CI warnings in own float parser
- pow5_table.hpp: pow5_128_largest_power was unused in this branch's own code (GCC -Werror=unused-const-variable); tie it to the table size with a static_assert instead of removing it, since a later branch in the stack (json-view/23-zmij) uses it. - number_parse.hpp: rename the local variable `copy` to `buffer` to satisfy cpplint's build/include_what_you_use check. - unit-class_lexer.cpp: extend the NOLINT list on the seeded mt19937 with bugprone-random-generator-seed, and parenthesize `8 * sizeof(Bits) - 1` for clang-tidy. Signed-off-by: Niels Lohmann <mail@nlohmann.me>
This commit is contained in:
4 files changed
+18
-10
No files matched your search
@@ -987,10 +987,10 @@ void convert_float_locale_aware(StringType& token, std::size_t decimal_point_pos
|
||||
}
|
||||
else
|
||||
{
|
||||
std::string copy(token.data(), token.size());
|
||||
copy.replace(decimal_point_position, 1, decimal_point);
|
||||
strtof_by_type(value, copy.c_str(), &endptr);
|
||||
complete = endptr == copy.c_str() + copy.size();
|
||||
std::string buffer(token.data(), token.size());
|
||||
buffer.replace(decimal_point_position, 1, decimal_point);
|
||||
strtof_by_type(value, buffer.c_str(), &endptr);
|
||||
complete = endptr == buffer.c_str() + buffer.size();
|
||||
}
|
||||
|
||||
if (JSON_HEDLEY_LIKELY(complete))
|
||||
|
||||
Reference in new issue
Block a user