Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix warnings #75

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion include/toml++/toml_array.h
Original file line number Diff line number Diff line change
Expand Up @@ -1036,7 +1036,7 @@ TOML_NAMESPACE_START
/// \returns An rvalue reference to the array.
array&& flatten() &&
{
return static_cast<toml::array&&>(static_cast<toml::array&>(*this).flatten());
return std::move(this->flatten());
}

/// \brief Prints the array out to a stream as formatted TOML.
Expand Down
7 changes: 2 additions & 5 deletions include/toml++/toml_default_formatter.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,7 @@ TOML_IMPL_NAMESPACE_START
for (auto c : str)
{
if TOML_UNLIKELY(c >= '\x00' && c <= '\x1F')
{
const auto& sv = low_character_escape_table[c];
s.append(reinterpret_cast<const char*>(sv.data()), sv.length());
}
s.append(low_character_escape_table[c]);
else if TOML_UNLIKELY(c == '\x7F')
s.append("\\u007F"sv);
else if TOML_UNLIKELY(c == '"')
Expand Down Expand Up @@ -141,7 +138,7 @@ TOML_IMPL_NAMESPACE_START
weight += 1;
v *= -1.0;
}
return weight + static_cast<size_t>(log10(static_cast<double>(v))) + 1_sz;
return weight + static_cast<size_t>(log10(v)) + 1_sz;
break;
}

Expand Down
9 changes: 3 additions & 6 deletions toml.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3963,7 +3963,7 @@ TOML_NAMESPACE_START
array& flatten() &;
array&& flatten() &&
{
return static_cast<toml::array&&>(static_cast<toml::array&>(*this).flatten());
return std::move(this->flatten());
}

template <typename Char>
Expand Down Expand Up @@ -8368,10 +8368,7 @@ TOML_IMPL_NAMESPACE_START
for (auto c : str)
{
if TOML_UNLIKELY(c >= '\x00' && c <= '\x1F')
{
const auto& sv = low_character_escape_table[c];
s.append(reinterpret_cast<const char*>(sv.data()), sv.length());
}
s.append(low_character_escape_table[c]);
else if TOML_UNLIKELY(c == '\x7F')
s.append("\\u007F"sv);
else if TOML_UNLIKELY(c == '"')
Expand Down Expand Up @@ -8456,7 +8453,7 @@ TOML_IMPL_NAMESPACE_START
weight += 1;
v *= -1.0;
}
return weight + static_cast<size_t>(log10(static_cast<double>(v))) + 1_sz;
return weight + static_cast<size_t>(log10(v)) + 1_sz;
break;
}

Expand Down