code style

This commit is contained in:
rusefi 2020-01-21 01:47:58 -05:00
parent 83b1ca00a4
commit 0c3f73c2b4
7 changed files with 12 additions and 12 deletions

View File

@ -294,7 +294,7 @@ static void handleGetStructContent(ts_channel_s *tsChannel, int structId, int si
tsState.readPageCommandsCounter++; tsState.readPageCommandsCounter++;
const void *addr = getStructAddr(structId); const void *addr = getStructAddr(structId);
if (addr == NULL) { if (addr == nullptr) {
// todo: add warning code - unexpected structId // todo: add warning code - unexpected structId
return; return;
} }

View File

@ -176,7 +176,7 @@ void sr5WriteData(ts_channel_s *tsChannel, const uint8_t * buffer, int size) {
int transferred = size; int transferred = size;
uartSendTimeout(TS_UART_DEVICE, (size_t *)&transferred, buffer, BINARY_IO_TIMEOUT); uartSendTimeout(TS_UART_DEVICE, (size_t *)&transferred, buffer, BINARY_IO_TIMEOUT);
#else #else
if (tsChannel->channel == NULL) if (tsChannel->channel == nullptr)
return; return;
// int transferred = chnWriteTimeout(tsChannel->channel, buffer, size, BINARY_IO_TIMEOUT); // int transferred = chnWriteTimeout(tsChannel->channel, buffer, size, BINARY_IO_TIMEOUT);
@ -214,7 +214,7 @@ int sr5ReadDataTimeout(ts_channel_s *tsChannel, uint8_t * buffer, int size, int
uartReceiveTimeout(TS_UART_DEVICE, &received, buffer, timeout); uartReceiveTimeout(TS_UART_DEVICE, &received, buffer, timeout);
return (int)received; return (int)received;
#else /* TS_UART_DMA_MODE */ #else /* TS_UART_DMA_MODE */
if (tsChannel->channel == NULL) if (tsChannel->channel == nullptr)
return 0; return 0;
return chnReadTimeout(tsChannel->channel, (uint8_t * )buffer, size, timeout); return chnReadTimeout(tsChannel->channel, (uint8_t * )buffer, size, timeout);
#endif /* TS_UART_DMA_MODE */ #endif /* TS_UART_DMA_MODE */

View File

@ -103,7 +103,7 @@ void LECalculator::reset(LEElement *element) {
} }
void LECalculator::add(LEElement *element) { void LECalculator::add(LEElement *element) {
if (first == NULL) { if (first == nullptr) {
first = element; first = element;
} else { } else {
LEElement *last = first; LEElement *last = first;
@ -411,7 +411,7 @@ LEElement *LEElementPool::parseExpression(const char * line) {
while (true) { while (true) {
line = getNextToken(line, parsingBuffer, sizeof(parsingBuffer)); line = getNextToken(line, parsingBuffer, sizeof(parsingBuffer));
if (line == NULL) { if (line == nullptr) {
/** /**
* No more tokens in this line * No more tokens in this line
*/ */
@ -419,7 +419,7 @@ LEElement *LEElementPool::parseExpression(const char * line) {
} }
LEElement *n = next(); LEElement *n = next();
if (n == NULL) { if (n == nullptr) {
return first; return first;
} }
@ -432,12 +432,12 @@ LEElement *LEElementPool::parseExpression(const char * line) {
* Cannot recognize token * Cannot recognize token
*/ */
warning(CUSTOM_ERR_PARSING_ERROR, "unrecognized [%s]", parsingBuffer); warning(CUSTOM_ERR_PARSING_ERROR, "unrecognized [%s]", parsingBuffer);
return NULL; return nullptr;
} }
n->init(action); n->init(action);
} }
if (first == NULL) { if (first == nullptr) {
first = n; first = n;
last = n; last = n;
} else { } else {

View File

@ -259,7 +259,7 @@ void set10K_4050K(ThermistorConf *thermistorConf, float pullup) {
#if EFI_PROD_CODE #if EFI_PROD_CODE
static void testCltByR(float resistance) { static void testCltByR(float resistance) {
if (logger == NULL) { if (logger == nullptr) {
firmwareError(CUSTOM_ERR_THERM, "thermstr not initialized"); firmwareError(CUSTOM_ERR_THERM, "thermstr not initialized");
return; return;
} }

View File

@ -257,7 +257,7 @@ static void timerCallback(PwmConfig *state) {
// we are here when PWM gets stopped // we are here when PWM gets stopped
return; return;
} }
if (state->executor == NULL) { if (state->executor == nullptr) {
firmwareError(CUSTOM_NULL_EXECUTOR, "exec on %s", state->name); firmwareError(CUSTOM_NULL_EXECUTOR, "exec on %s", state->name);
return; return;
} }

View File

@ -241,7 +241,7 @@ void TriggerWaveform::addEvent(angle_t angle, trigger_wheel_e const channelIndex
for (int i = 0; i < PWM_PHASE_MAX_WAVE_PER_PWM; i++) { for (int i = 0; i < PWM_PHASE_MAX_WAVE_PER_PWM; i++) {
SingleChannelStateSequence *wave = &this->wave.channels[i]; SingleChannelStateSequence *wave = &this->wave.channels[i];
if (wave->pinStates == NULL) { if (wave->pinStates == nullptr) {
warning(CUSTOM_ERR_STATE_NULL, "wave pinStates is NULL"); warning(CUSTOM_ERR_STATE_NULL, "wave pinStates is NULL");
setShapeDefinitionError(true); setShapeDefinitionError(true);
return; return;

View File

@ -161,7 +161,7 @@ static float getSignalPeriodMs(int index) {
} }
static void reportWave(Logging *logging, int index) { static void reportWave(Logging *logging, int index) {
if (readers[index].hw == NULL) { if (readers[index].hw == nullptr) {
return; return;
} }
if (readers[index].hw->started) { if (readers[index].hw->started) {