Commit 6bcc3fd2 authored by Victor Zverovich's avatar Victor Zverovich

Fix warnings

parent 6a497e1d
......@@ -271,7 +271,7 @@ To safe_duration_cast(std::chrono::duration<FromRep, FromPeriod> from,
ec = 1;
return {};
}
count *= Factor::num;
count *= static_cast<IntermediateRep>(Factor::num);
}
// this can't go wrong, right? den>0 is checked earlier.
......
......@@ -167,7 +167,7 @@ struct scan_handler : error_handler {
}
void on_arg_id() { on_arg_id(next_arg_id_++); }
void on_arg_id(unsigned id) {
void on_arg_id(int id) {
if (id >= args_.size) on_error("argument index out of range");
arg_ = args_.data[id];
}
......
......@@ -107,7 +107,8 @@ template <> struct std::formatter<S> {
// Parses a width argument id in the format { <digit> }.
constexpr auto parse(format_parse_context& ctx) {
auto iter = ctx.begin();
auto get_char = [&]() { return iter != ctx.end() ? *iter : 0; };
// auto get_char = [&]() { return iter != ctx.end() ? *iter : 0; };
auto get_char = [&]() { return iter != ctx.end() ? *iter : '\0'; };
if (get_char() != '{') return iter;
++iter;
char c = get_char();
......@@ -124,7 +125,9 @@ template <> struct std::formatter<S> {
[](auto value) -> int {
if constexpr (!is_integral_v<decltype(value)>)
throw format_error("width is not integral");
else if (value < 0 || value > numeric_limits<int>::max())
// else if (value < 0 || value > numeric_limits<int>::max())
else if (fmt::internal::is_negative(value) < 0 ||
value > numeric_limits<int>::max())
throw format_error("invalid width");
else
return value;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment