diff --git a/deps/fmt/fmt-7.0.3/include/fmt/format.h b/deps/fmt/fmt-7.0.3/include/fmt/format.h index d8e7c248a..92486e6bb 100644 --- a/deps/fmt/fmt-7.0.3/include/fmt/format.h +++ b/deps/fmt/fmt-7.0.3/include/fmt/format.h @@ -144,7 +144,8 @@ FMT_END_NAMESPACE # if FMT_USE_USER_DEFINED_LITERALS && \ (!defined(__EDG_VERSION__) || __EDG_VERSION__ >= 501) && \ ((FMT_GCC_VERSION >= 604 && __cplusplus >= 201402L) || \ - FMT_CLANG_VERSION >= 304) + FMT_CLANG_VERSION >= 304) && \ + !defined(__PGI) && !defined(__NVCC__) # define FMT_USE_UDL_TEMPLATE 1 # else # define FMT_USE_UDL_TEMPLATE 0 @@ -1578,7 +1579,8 @@ template struct int_writer { format_decimal(digits, abs_value, num_digits); basic_memory_buffer buffer; size += prefix_size; - buffer.resize(size); + const auto usize = to_unsigned(size); + buffer.resize(usize); basic_string_view s(&sep, sep_size); // Index of a decimal digit with the least significant digit having index 0. int digit_index = 0; @@ -1598,9 +1600,8 @@ template struct int_writer { make_checked(p, s.size())); } if (prefix_size != 0) p[-1] = static_cast('-'); - using iterator = remove_reference_t; auto data = buffer.data(); - out = write_padded(out, specs, size, size, [=](iterator it) { + out = write_padded(out, specs, usize, usize, [=](iterator it) { return copy_str(data, data + size, it); }); } @@ -2662,17 +2663,17 @@ FMT_CONSTEXPR_DECL FMT_INLINE void parse_format_string( return; } struct writer { - FMT_CONSTEXPR void operator()(const Char* begin, const Char* end) { - if (begin == end) return; + FMT_CONSTEXPR void operator()(const Char* pbegin, const Char* pend) { + if (pbegin == pend) return; for (;;) { const Char* p = nullptr; - if (!find(begin, end, '}', p)) - return handler_.on_text(begin, end); + if (!find(pbegin, pend, '}', p)) + return handler_.on_text(pbegin, pend); ++p; - if (p == end || *p != '}') + if (p == pend || *p != '}') return handler_.on_error("unmatched '}' in format string"); - handler_.on_text(begin, p); - begin = p + 1; + handler_.on_text(pbegin, p); + pbegin = p + 1; } } Handler& handler_;