[build] Upgrade clang-format and clang-tidy (NFC) (#3422)

This commit is contained in:
Tyler Veness
2021-06-10 11:13:09 -07:00
committed by GitHub
parent 099fde97d5
commit a77c6ff3a2
29 changed files with 66 additions and 48 deletions

View File

@@ -389,8 +389,9 @@ void HAL_SetCTREPCMOneShotDuration(HAL_CTREPCMHandle handle, int32_t index,
}
std::scoped_lock lock{pcm->lock};
pcm->oneShot.sol10MsPerUnit[index] = (std::min)(
static_cast<uint32_t>(durMs) / 10, static_cast<uint32_t>(0xFF));
pcm->oneShot.sol10MsPerUnit[index] =
(std::min)(static_cast<uint32_t>(durMs) / 10,
static_cast<uint32_t>(0xFF));
HAL_WriteCANPacketRepeating(pcm->canHandle, pcm->oneShot.sol10MsPerUnit, 8,
Control2, SendPeriod, status);
}

View File

@@ -158,8 +158,9 @@ int32_t HAL_SendError(HAL_Bool isError, int32_t errorCode, HAL_Bool isLVCode,
auto curTime = std::chrono::steady_clock::now();
int i;
for (i = 0; i < KEEP_MSGS; ++i) {
if (prevMsg[i] == details)
if (prevMsg[i] == details) {
break;
}
}
int retval = 0;
if (i == KEEP_MSGS || (curTime - prevMsgTime[i]) >= std::chrono::seconds(1)) {

View File

@@ -76,10 +76,12 @@ static void alarmCallback() {
// process all notifiers
notifierHandles->ForEach([&](HAL_NotifierHandle handle, Notifier* notifier) {
if (notifier->triggerTime == UINT64_MAX)
if (notifier->triggerTime == UINT64_MAX) {
return;
if (currentTime == 0)
}
if (currentTime == 0) {
currentTime = HAL_GetFPGATime(&status);
}
std::unique_lock lock(notifier->mutex);
if (notifier->triggerTime < currentTime) {
notifier->triggerTime = UINT64_MAX;

View File

@@ -7,7 +7,7 @@
#include "hal/Types.h"
#include "jni.h"
typedef HAL_Handle SIM_JniHandle;
using SIM_JniHandle = HAL_Handle; // NOLINT
namespace hal::sim {
JavaVM* GetJVM();

View File

@@ -6,7 +6,7 @@
#include <stdint.h>
typedef enum {
enum CTR_Code {
CTR_OKAY, // No Error - Function executed as expected
CTR_RxTimeout, // CAN frame has not been received within specified period of
// time.
@@ -17,7 +17,7 @@ typedef enum {
CTR_SigNotUpdated, // Have not received an value response for signal.
CTR_BufferFull, // Caller attempted to insert data into a buffer that is
// full.
} CTR_Code;
};
// VISA Error
#define _VI_ERROR (-2147483647L - 1)
@@ -108,7 +108,7 @@ typedef enum {
* Represents the resulting status of a function call through its return value.
* 0 is success, negative values are errors, and positive values are warnings.
*/
typedef int32_t NiFpga_Status; // NOLINT
using NiFpga_Status = int32_t; // NOLINT
/**
* No errors or warnings.

View File

@@ -60,7 +60,7 @@ struct SynchronousWaitData {
static LimitedHandleResource<HAL_InterruptHandle, Interrupt, kNumInterrupts,
HAL_HandleEnum::Interrupt>* interruptHandles;
typedef HAL_Handle SynchronousWaitDataHandle;
using SynchronousWaitDataHandle = HAL_Handle;
static UnlimitedHandleResource<SynchronousWaitDataHandle, SynchronousWaitData,
HAL_HandleEnum::Vendor>*
synchronousInterruptHandles;