Skip to content

Commit f94950d

Browse files
sribee8Sriya Pratipati
andauthored
[libc] Changed mbstate struct (#143942)
Changed the mbstate variable from bits processed to bytes processed and implemented isComplete(). Co-authored-by: Sriya Pratipati <[email protected]>
1 parent 5a6a4b6 commit f94950d

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

libc/src/__support/wchar/character_converter.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@ namespace internal {
1818

1919
CharacterConverter::CharacterConverter(mbstate *mbstate) { state = mbstate; }
2020

21-
bool CharacterConverter::isComplete() {}
21+
bool CharacterConverter::isComplete() {
22+
return state->bytes_processed == state->total_bytes;
23+
}
2224

2325
int CharacterConverter::push(char8_t utf8_byte) {}
2426

libc/src/__support/wchar/mbstate.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ namespace internal {
1818

1919
struct mbstate {
2020
char32_t partial;
21-
uint8_t bits_processed;
21+
uint8_t bytes_processed;
2222
uint8_t total_bytes;
2323
};
2424

0 commit comments

Comments
 (0)