Skip to content

Commit 15f0166

Browse files
committed
formatting
1 parent a562d1c commit 15f0166

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

libc/src/wchar/wcstok.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
namespace LIBC_NAMESPACE_DECL {
1515

1616
bool isADelimeter(wchar_t wc, const wchar_t *delimiters) {
17-
for (const wchar_t *delim_ptr = delimiters; *delim_ptr != L'\0'; delim_ptr++)
17+
for (const wchar_t *delim_ptr = delimiters; *delim_ptr != L'\0'; ++delim_ptr)
1818
if (wc == *delim_ptr)
1919
return true;
2020
return false;
@@ -32,16 +32,16 @@ LLVM_LIBC_FUNCTION(wchar_t *, wcstok,
3232

3333
wchar_t *tok_start, *tok_end;
3434
for (tok_start = str; *tok_start != L'\0' && isADelimeter(*tok_start, delim);
35-
tok_start++)
35+
++tok_start)
3636
;
3737

3838
for (tok_end = tok_start; *tok_end != L'\0' && !isADelimeter(*tok_end, delim);
39-
tok_end++)
39+
++tok_end)
4040
;
4141

4242
if (*tok_end != L'\0') {
4343
*tok_end = L'\0';
44-
tok_end++;
44+
++tok_end;
4545
}
4646
*context = tok_end;
4747
return *tok_start == L'\0' ? nullptr : tok_start;

libc/test/src/wchar/wcstok_test.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,15 @@ TEST(LlvmLibcWCSTokReentrantTest, NoTokenFound) {
2828
ASSERT_EQ(LIBC_NAMESPACE::wcstok(empty, L"_", &reserve), nullptr);
2929
ASSERT_EQ(LIBC_NAMESPACE::wcstok(nullptr, L"_", &reserve), nullptr);
3030
}
31-
{ // Same wchar_tacter source and delimiter string.
31+
{ // Same character source and delimiter string.
3232
wchar_t single[] = L"_";
3333
wchar_t *reserve = nullptr;
3434
ASSERT_EQ(LIBC_NAMESPACE::wcstok(single, L"_", &reserve), nullptr);
3535
// Another call to ensure that 'reserve' is not in a bad state.
3636
ASSERT_EQ(LIBC_NAMESPACE::wcstok(single, L"_", &reserve), nullptr);
3737
ASSERT_EQ(LIBC_NAMESPACE::wcstok(nullptr, L"_", &reserve), nullptr);
3838
}
39-
{ // Multiple wchar_tacter source and single wchar_tacter delimiter string.
39+
{ // Multiple character source and single character delimiter string.
4040
wchar_t multiple[] = L"1,2";
4141
wchar_t *reserve = nullptr;
4242
wchar_t *tok = LIBC_NAMESPACE::wcstok(multiple, L":", &reserve);

0 commit comments

Comments
 (0)