Skip to content

Commit

Permalink
Fix warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
vitaut committed Jun 30, 2021
1 parent fbb70ee commit 785908e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
4 changes: 2 additions & 2 deletions include/fmt/core.h
Original file line number Diff line number Diff line change
Expand Up @@ -2427,7 +2427,7 @@ FMT_CONSTEXPR FMT_INLINE void parse_format_string(
if (pbegin == pend) return;
for (;;) {
const Char* p = nullptr;
if (!find<IS_CONSTEXPR>(pbegin, pend, '}', p))
if (!find<IS_CONSTEXPR>(pbegin, pend, Char('}'), p))
return handler_.on_text(pbegin, pend);
++p;
if (p == pend || *p != '}')
Expand All @@ -2442,7 +2442,7 @@ FMT_CONSTEXPR FMT_INLINE void parse_format_string(
// Doing two passes with memchr (one for '{' and another for '}') is up to
// 2.5x faster than the naive one-pass implementation on big format strings.
const Char* p = begin;
if (*begin != '{' && !find<IS_CONSTEXPR>(begin + 1, end, '{', p))
if (*begin != '{' && !find<IS_CONSTEXPR>(begin + 1, end, Char('{'), p))
return write(begin, end);
write(begin, p);
begin = parse_replacement_field(p, end, handler);
Expand Down
8 changes: 5 additions & 3 deletions include/fmt/format.h
Original file line number Diff line number Diff line change
Expand Up @@ -882,8 +882,10 @@ template <typename T = void> struct basic_data {
FMT_API static constexpr const char signs[4] = {0, '-', '+', ' '};
FMT_API static constexpr const unsigned prefixes[4] = {0, 0, 0x1000000u | '+',
0x1000000u | ' '};
FMT_API static constexpr const char left_padding_shifts[5] = {31, 31, 0, 1, 0};
FMT_API static constexpr const char right_padding_shifts[5] = {0, 31, 0, 1, 0};
FMT_API static constexpr const char left_padding_shifts[5] = {31, 31, 0, 1,
0};
FMT_API static constexpr const char right_padding_shifts[5] = {0, 31, 0, 1,
0};
};

#ifdef FMT_SHARED
Expand Down Expand Up @@ -1023,7 +1025,7 @@ template <> inline auto decimal_point(locale_ref loc) -> wchar_t {

// Compares two characters for equality.
template <typename Char> auto equal2(const Char* lhs, const char* rhs) -> bool {
return lhs[0] == rhs[0] && lhs[1] == rhs[1];
return lhs[0] == Char(rhs[0]) && lhs[1] == Char(rhs[1]);
}
inline auto equal2(const char* lhs, const char* rhs) -> bool {
return memcmp(lhs, rhs, 2) == 0;
Expand Down

0 comments on commit 785908e

Please sign in to comment.