Skip to content

Commit bfe680c

Browse files
style: format code with clang-format [skip ci]
1 parent f585842 commit bfe680c

File tree

3 files changed

+22
-23
lines changed

3 files changed

+22
-23
lines changed

components/libc/cplusplus/os/cxx_Thread.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ using namespace rtthread;
1515
* @brief Thread class constructor with parameters for stack size, priority, tick, and name.
1616
*/
1717
Thread::Thread(rt_uint32_t stack_size,
18-
rt_uint8_t priority,
18+
rt_uint8_t priority,
1919
rt_uint32_t tick,
20-
const char *name)
21-
: _entry(RT_NULL), _param(RT_NULL), started(false)
20+
const char *name) :
21+
_entry(RT_NULL), _param(RT_NULL), started(false)
2222
{
2323
rt_event_init(&_event, name, 0);
2424

@@ -36,10 +36,10 @@ Thread::Thread(rt_uint32_t stack_size,
3636
Thread::Thread(void (*entry)(void *p),
3737
void *p,
3838
rt_uint32_t stack_size,
39-
rt_uint8_t priority,
39+
rt_uint8_t priority,
4040
rt_uint32_t tick,
41-
const char *name)
42-
: _entry(entry), _param(p), started(false)
41+
const char *name) :
42+
_entry(entry), _param(p), started(false)
4343
{
4444
rt_event_init(&_event, name, 0);
4545

components/libc/cplusplus/utest/tc_atomic.cpp

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
*/
2121
static void test_atomic_load_store_int32(void)
2222
{
23-
constexpr int kRound = 10000000;
23+
constexpr int kRound = 10000000;
2424
std::atomic<int32_t> thread_count(0);
2525
std::atomic<int32_t> count(100);
2626
uassert_int_equal(count.load(), 100);
@@ -56,7 +56,7 @@ static void test_atomic_load_store_int32(void)
5656
*/
5757
static void test_atomic_load_store_int64(void)
5858
{
59-
constexpr int kRound = 10000000;
59+
constexpr int kRound = 10000000;
6060
std::atomic<int64_t> thread_count(0);
6161
std::atomic<int64_t> count(100);
6262
uassert_int_equal(count.load(), 100);
@@ -121,9 +121,9 @@ static void test_atomic_basic_int32(void)
121121
val.exchange(1);
122122
uassert_int_equal(val.load(), 1);
123123

124-
int32_t x = 2;
125-
int32_t y = 3;
126-
bool exchanged = val.compare_exchange_strong(x, y);
124+
int32_t x = 2;
125+
int32_t y = 3;
126+
bool exchanged = val.compare_exchange_strong(x, y);
127127
uassert_false(exchanged);
128128
uassert_int_equal(val.load(), 1);
129129
uassert_int_equal(x, 1);
@@ -168,9 +168,9 @@ static void test_atomic_basic_int64(void)
168168
val.exchange(1);
169169
uassert_int_equal(val.load(), 1);
170170

171-
int64_t x = 2;
172-
int64_t y = 3;
173-
bool exchanged = val.compare_exchange_strong(x, y);
171+
int64_t x = 2;
172+
int64_t y = 3;
173+
bool exchanged = val.compare_exchange_strong(x, y);
174174
uassert_false(exchanged);
175175
uassert_int_equal(val.load(), 1);
176176
uassert_int_equal(x, 1);
@@ -191,7 +191,7 @@ static void test_atomic_bool(void)
191191
flag.exchange(false);
192192
uassert_false(flag.load());
193193
bool expected = false;
194-
bool desired = true;
194+
bool desired = true;
195195
uassert_true(flag.compare_exchange_strong(expected, desired));
196196
uassert_true(flag.load());
197197
}
@@ -201,7 +201,7 @@ static void test_atomic_bool(void)
201201
*/
202202
static void test_atomic_pointer(void)
203203
{
204-
int a = 1, b = 2;
204+
int a = 1, b = 2;
205205
std::atomic<int *> ptr(&a);
206206
ptr.store(&b);
207207
uassert_int_equal(*ptr.load(), 2);
@@ -230,8 +230,8 @@ static void test_memory_order(void)
230230
static void test_compare_exchange_weak(void)
231231
{
232232
std::atomic<int> val(1);
233-
int expected = 1;
234-
int desired = 2;
233+
int expected = 1;
234+
int desired = 2;
235235
while (!val.compare_exchange_weak(expected, desired))
236236
{
237237
expected = 1; // reset

components/libc/cplusplus/utest/tc_thread.cpp

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,7 @@ static void test_thread(void)
2121
int count = 0; // Initialize a counter to zero.
2222

2323
// Lambda function to increment the count.
24-
auto func = [&]() mutable
25-
{
24+
auto func = [&]() mutable {
2625
for (int i = 0; i < 100; ++i)
2726
{
2827
++count; // Increment the count 100 times.
@@ -60,19 +59,19 @@ static void test_thread(void)
6059

6160
static rt_err_t utest_tc_init(void)
6261
{
63-
return RT_EOK;
62+
return RT_EOK;
6463
}
6564
/**
6665
* @brief Test case cleanup function.
6766
*/
6867
static rt_err_t utest_tc_cleanup(void)
6968
{
70-
return RT_EOK;
69+
return RT_EOK;
7170
}
7271

7372
/**
7473
* @brief Main test case function that runs the test.
75-
*/
74+
*/
7675
static void testcase(void)
7776
{
7877
UTEST_UNIT_RUN(test_thread);

0 commit comments

Comments
 (0)