提交 ae41b850 编写于 作者: 还_没_想_好's avatar 还_没_想_好

[components][cplusplus] 格式化代码

上级 583f8c30
...@@ -28,7 +28,7 @@ template<typename T, uint32_t queue_sz> ...@@ -28,7 +28,7 @@ template<typename T, uint32_t queue_sz>
class Mail { class Mail {
public: public:
/** Create and Initialise Mail queue. */ /** Create and Initialise Mail queue. */
Mail(const char* name = "") Mail(const char *name = "")
{ {
rt_mb_init(&mID, name, mPool, queue_sz, RT_IPC_FLAG_FIFO); rt_mb_init(&mID, name, mPool, queue_sz, RT_IPC_FLAG_FIFO);
} }
......
...@@ -21,7 +21,7 @@ namespace rtthread { ...@@ -21,7 +21,7 @@ namespace rtthread {
class Mutex { class Mutex {
public: public:
/** Create and Initialize a Mutex object */ /** Create and Initialize a Mutex object */
Mutex(const char* name = "mutex"); Mutex(const char *name = "mutex");
~Mutex(); ~Mutex();
/** Wait until a Mutex becomes available. /** Wait until a Mutex becomes available.
......
...@@ -68,7 +68,7 @@ public: ...@@ -68,7 +68,7 @@ public:
private: private:
struct rt_messagequeue mID; struct rt_messagequeue mID;
char mPool[(sizeof(struct rt_messagequeue)+sizeof(T)) * queue_sz]; char mPool[(sizeof(struct rt_messagequeue) + sizeof(T)) * queue_sz];
}; };
} }
...@@ -20,7 +20,7 @@ namespace rtthread ...@@ -20,7 +20,7 @@ namespace rtthread
class Thread class Thread
{ {
public: public:
typedef void (*thread_func_t) (void *param); typedef void (*thread_func_t)(void *param);
/** Allocate a new thread without starting execution /** Allocate a new thread without starting execution
@param priority initial priority of the thread function. (default: osPriorityNormal). @param priority initial priority of the thread function. (default: osPriorityNormal).
...@@ -28,14 +28,14 @@ public: ...@@ -28,14 +28,14 @@ public:
@param stack_pointer pointer to the stack area to be used by this thread (default: NULL). @param stack_pointer pointer to the stack area to be used by this thread (default: NULL).
*/ */
Thread(rt_uint32_t stack_size = 2048, Thread(rt_uint32_t stack_size = 2048,
rt_uint8_t priority = (RT_THREAD_PRIORITY_MAX * 2)/3, rt_uint8_t priority = (RT_THREAD_PRIORITY_MAX * 2) / 3,
rt_uint32_t tick = 20, rt_uint32_t tick = 20,
const char *name = "th"); const char *name = "th");
Thread(void (*entry)(void *p), Thread(void (*entry)(void *p),
void *p = RT_NULL, void *p = RT_NULL,
rt_uint32_t stack_size = 2048, rt_uint32_t stack_size = 2048,
rt_uint8_t priority = (RT_THREAD_PRIORITY_MAX * 2)/3, rt_uint8_t priority = (RT_THREAD_PRIORITY_MAX * 2) / 3,
rt_uint32_t tick = 20, rt_uint32_t tick = 20,
const char *name = "th"); const char *name = "th");
......
...@@ -26,7 +26,7 @@ void operator delete(void *ptr) ...@@ -26,7 +26,7 @@ void operator delete(void *ptr)
rt_free(ptr); rt_free(ptr);
} }
void operator delete[] (void *ptr) void operator delete[](void *ptr)
{ {
return rt_free(ptr); return rt_free(ptr);
} }
......
...@@ -18,7 +18,7 @@ void *operator new(size_t size); ...@@ -18,7 +18,7 @@ void *operator new(size_t size);
void *operator new[](size_t size); void *operator new[](size_t size);
void operator delete(void * ptr); void operator delete(void * ptr);
void operator delete[] (void *ptr); void operator delete[](void *ptr);
extern "C" void __cxa_pure_virtual(void); extern "C" void __cxa_pure_virtual(void);
extern "C" int cplusplus_system_init(void); extern "C" int cplusplus_system_init(void);
......
...@@ -50,11 +50,11 @@ RT_WEAK int cplusplus_system_init(void) ...@@ -50,11 +50,11 @@ RT_WEAK int cplusplus_system_init(void)
for (; base != lim; base++) for (; base != lim; base++)
{ {
PROC *proc = (PROC*)((const char*)base + *base); PROC *proc = (PROC *)((const char *)base + *base);
(*proc)(); (*proc)();
} }
#elif defined(__GNUC__) #elif defined(__GNUC__)
typedef void(*pfunc) (); typedef void(*pfunc)();
extern pfunc __ctors_start__[]; extern pfunc __ctors_start__[];
extern pfunc __ctors_end__[]; extern pfunc __ctors_end__[];
pfunc *p; pfunc *p;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册