Fixes warnings thrown by cpplint.py (#154)

* Fixed cpplint.py [runtime/int] warnings

* Fixed cpplint.py [readability/casting] warnings

* Fixed cpplint.py [readability/namespace] warnings

* Fixed cpplint.py [readability/braces] warnings

* Fixed cpplint.py [whitespace/braces] warnings

* Fixed cpplint.py [runtime/explicit] warnings

* Fixed cpplint.py [runtime/printf] warnings

* Fixed cpplint.py [readability/inheritance] warnings

* Fixed cpplint.py [whitespace/tab] warnings

* Fixed cpplint.py [build/storage_class] warnings

* Fixed cpplint.py [readability/multiline_comment] warnings

* Fixed cpplint.py [whitespace/semicolon] warnings

* Fixed cpplint.py [readability/check] warnings

* Fixed cpplint.py [runtime/arrays] warnings

* Ran format.py
This commit is contained in:
Tyler Veness
2016-07-10 17:47:44 -07:00
committed by Peter Johnson
parent e44a6e227a
commit 0cb288ffba
141 changed files with 670 additions and 626 deletions

View File

@@ -53,15 +53,15 @@ void SetProcessorAffinity(int core_id) {
CPU_SET(core_id, &cpuset);
pthread_t current_thread = pthread_self();
ASSERT_TRUE(
pthread_setaffinity_np(current_thread, sizeof(cpu_set_t), &cpuset) == 0);
ASSERT_EQ(pthread_setaffinity_np(current_thread, sizeof(cpu_set_t), &cpuset),
0);
}
void SetThreadRealtimePriorityOrDie(int priority) {
struct sched_param param;
// Set realtime priority for this thread
param.sched_priority = priority + sched_get_priority_min(SCHED_RR);
ASSERT_TRUE(pthread_setschedparam(pthread_self(), SCHED_RR, &param) == 0)
ASSERT_EQ(pthread_setschedparam(pthread_self(), SCHED_RR, &param), 0)
<< ": Failed to set scheduler priority.";
}
@@ -69,7 +69,7 @@ void SetThreadRealtimePriorityOrDie(int priority) {
template <typename MutexType>
class LowPriorityThread {
public:
LowPriorityThread(MutexType* mutex)
explicit LowPriorityThread(MutexType* mutex)
: m_mutex(mutex), m_hold_mutex(1), m_success(0) {}
void operator()() {
@@ -137,7 +137,7 @@ class BusyWaitingThread {
template <typename MutexType>
class HighPriorityThread {
public:
HighPriorityThread(MutexType* mutex) : m_mutex(mutex), m_success(0) {}
explicit HighPriorityThread(MutexType* mutex) : m_mutex(mutex) {}
void operator()() {
SetProcessorAffinity(0);
@@ -153,7 +153,7 @@ class HighPriorityThread {
private:
Notification m_started;
MutexType* m_mutex;
std::atomic<int> m_success;
std::atomic<int> m_success{0};
};
// Class to test a MutexType to see if it solves the priority inheritance