Visitar URL original
Fix two clang-tidy findings in the parser · marzer/tomlplusplus@03c4a10 · GitHub
Skip to content

Commit 03c4a10

Browse files
committed
Fix two clang-tidy findings in the parser
1 parent 383729f commit 03c4a10

2 files changed

Lines changed: 10 additions & 12 deletions

File tree

‎include/toml++/impl/parser.inl‎

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1020,7 +1020,7 @@ TOML_ANON_NAMESPACE_START
10201020

10211021
TOML_ATTR(nonnull)
10221022
TOML_INTERNAL_LINKAGE
1023-
void concatenate(char*& write_pos, char* const buf_end, std::string_view text) noexcept
1023+
void concatenate(char*& write_pos, const char* const buf_end, std::string_view text) noexcept
10241024
{
10251025
if TOML_UNLIKELY(write_pos >= buf_end)
10261026
return;
@@ -1038,7 +1038,7 @@ TOML_ANON_NAMESPACE_START
10381038

10391039
TOML_ATTR(nonnull)
10401040
TOML_INTERNAL_LINKAGE
1041-
void concatenate(char*& write_pos, char* const buf_end, uint64_t magnitude) noexcept
1041+
void concatenate(char*& write_pos, const char* const buf_end, uint64_t magnitude) noexcept
10421042
{
10431043
char text[max_decimal_digits];
10441044
char* const text_end = text + sizeof(text);
@@ -1048,7 +1048,7 @@ TOML_ANON_NAMESPACE_START
10481048

10491049
TOML_ATTR(nonnull)
10501050
TOML_INTERNAL_LINKAGE
1051-
void concatenate(char*& write_pos, char* const buf_end, const utf8_codepoint& cp) noexcept
1051+
void concatenate(char*& write_pos, const char* const buf_end, const utf8_codepoint& cp) noexcept
10521052
{
10531053
if (cp.value <= U'\x1F')
10541054
concatenate(write_pos, buf_end, impl::control_char_escapes[cp.value]);
@@ -1075,7 +1075,7 @@ TOML_ANON_NAMESPACE_START
10751075

10761076
// anything else would convert to one of the three
10771077
template <typename T>
1078-
void concatenate(char*&, char*, const T&) = delete;
1078+
void concatenate(char*&, const char*, const T&) = delete;
10791079

10801080
struct error_arg
10811081
{
@@ -2716,10 +2716,9 @@ TOML_IMPL_NAMESPACE_START
27162716

27172717
const std::string_view sign_text =
27182718
traits::is_signed && is_match(*cp, U'+', U'-') ? (*cp == U'-' ? "-"sv : "+"sv) : ""sv;
2719-
bool negative = {};
2719+
const bool negative = traits::is_signed && *cp == U'-';
27202720
if constexpr (traits::is_signed)
27212721
{
2722-
negative = *cp == U'-';
27232722
if (is_match(*cp, U'+', U'-'))
27242723
advance_and_return_if_error_or_unexpected_eof({});
27252724
}

‎toml.hpp‎

Lines changed: 5 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)