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

Fixed int conversion warning #2313

Merged
merged 2 commits into from
May 25, 2021
Merged
Changes from 1 commit
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
4 changes: 2 additions & 2 deletions include/fmt/format.h
Original file line number Diff line number Diff line change
Expand Up @@ -550,7 +550,7 @@ FMT_CONSTEXPR inline size_t compute_width(string_view s) {
size_t* count;
FMT_CONSTEXPR void operator()(uint32_t cp, int error) const {
*count +=
1 +
size_t(1 +
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use to_unsigned instead of a C-style cast.

(error == 0 && cp >= 0x1100 &&
(cp <= 0x115f || // Hangul Jamo init. consonants
cp == 0x2329 || // LEFT-POINTING ANGLE BRACKET〈
Expand All @@ -568,7 +568,7 @@ FMT_CONSTEXPR inline size_t compute_width(string_view s) {
// Miscellaneous Symbols and Pictographs + Emoticons:
(cp >= 0x1f300 && cp <= 0x1f64f) ||
// Supplemental Symbols and Pictographs:
(cp >= 0x1f900 && cp <= 0x1f9ff)));
(cp >= 0x1f900 && cp <= 0x1f9ff))));
}
};
for_each_codepoint(s, count_code_points{&num_code_points});
Expand Down