artf4107: clang-modernize was run on WPILib

Loops were converted to their range-based equivalents, variable types were replaced with auto where the type was already specified on the same line, the override keyword was added, and instances of NULL and assignments of 0 to pointers were replaced with nullptr.

Change-Id: If281e46a2e2e1c37f278d56df9915236d4b2c864
This commit is contained in:
Tyler Veness
2015-06-23 04:49:51 -07:00
parent 7a711a21f9
commit b1befed14f
113 changed files with 604 additions and 618 deletions

View File

@@ -14,7 +14,7 @@
#include <stdio.h>
MotorSafetyHelper *MotorSafetyHelper::m_headHelper = NULL;
MotorSafetyHelper *MotorSafetyHelper::m_headHelper = nullptr;
ReentrantSemaphore MotorSafetyHelper::m_listMutex;
/**
@@ -46,9 +46,9 @@ MotorSafetyHelper::~MotorSafetyHelper() {
if (m_headHelper == this) {
m_headHelper = m_nextHelper;
} else {
MotorSafetyHelper *prev = NULL;
MotorSafetyHelper *prev = nullptr;
MotorSafetyHelper *cur = m_headHelper;
while (cur != this && cur != NULL) prev = cur, cur = cur->m_nextHelper;
while (cur != this && cur != nullptr) prev = cur, cur = cur->m_nextHelper;
if (cur == this) prev->m_nextHelper = cur->m_nextHelper;
}
}
@@ -141,7 +141,7 @@ bool MotorSafetyHelper::IsSafetyEnabled() const {
*/
void MotorSafetyHelper::CheckMotors() {
Synchronized sync(m_listMutex);
for (MotorSafetyHelper *msh = m_headHelper; msh != NULL;
for (MotorSafetyHelper *msh = m_headHelper; msh != nullptr;
msh = msh->m_nextHelper) {
msh->Check();
}