Skip to content

Commit e7669d3

Browse files
author
Sriya Pratipati
committed
added casting to avoid integer promotion
1 parent 45d67dc commit e7669d3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

libc/src/__support/wchar/character_converter.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ int CharacterConverter::push(char8_t utf8_byte) {
4444
/* Since the format is 110xxxxx, 1110xxxx, and 11110xxx for 2, 3, and 4,
4545
we will make the base mask with 7 ones and right shift it as necessary. */
4646
constexpr size_t SIGNIFICANT_BITS = 7;
47-
uint8_t base_mask = mask_trailing_ones<uint8_t, SIGNIFICANT_BITS>();
47+
char8_t base_mask = static_cast<char8_t>(mask_trailing_ones<uint8_t, SIGNIFICANT_BITS>());
4848
state->total_bytes = num_ones;
4949
utf8_byte &= (base_mask >> num_ones);
5050
}

0 commit comments

Comments
 (0)