mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-30 02:31:44 +00:00
Add format script which invokes clang-format on the C++ source code (#41)
On Windows machines, clang-format.exe must be in the PATH environment variable.
This commit is contained in:
committed by
Peter Johnson
parent
68690643d2
commit
e14e45da76
@@ -8,10 +8,10 @@
|
||||
#include "HAL/Task.hpp"
|
||||
|
||||
#ifndef OK
|
||||
#define OK 0
|
||||
#define OK 0
|
||||
#endif /* OK */
|
||||
#ifndef ERROR
|
||||
#define ERROR (-1)
|
||||
#define ERROR (-1)
|
||||
#endif /* ERROR */
|
||||
|
||||
#include <signal.h>
|
||||
@@ -20,9 +20,9 @@ extern "C" {
|
||||
|
||||
STATUS verifyTaskID(TASK task) {
|
||||
if (task != nullptr && pthread_kill(*task, 0) == 0) {
|
||||
return OK;
|
||||
return OK;
|
||||
} else {
|
||||
return ERROR;
|
||||
return ERROR;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -35,12 +35,10 @@ STATUS setTaskPriority(TASK task, int priority) {
|
||||
param.sched_priority = priority;
|
||||
if (pthread_setschedparam(*task, SCHED_FIFO, ¶m) == 0) {
|
||||
return OK;
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
return ERROR;
|
||||
}
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
return ERROR;
|
||||
}
|
||||
}
|
||||
@@ -50,11 +48,10 @@ STATUS getTaskPriority(TASK task, int* priority) {
|
||||
struct sched_param param;
|
||||
|
||||
if (verifyTaskID(task) == OK &&
|
||||
pthread_getschedparam(*task, &policy, ¶m) == 0) {
|
||||
pthread_getschedparam(*task, &policy, ¶m) == 0) {
|
||||
*priority = param.sched_priority;
|
||||
return OK;
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
return ERROR;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user