From d5ef749761a26fdfd6c5587a2ef0b3b41bb2fab6 Mon Sep 17 00:00:00 2001 From: rusEfi Date: Sun, 22 Sep 2019 08:22:35 -0400 Subject: [PATCH] s/NULL/nullptr/ --- firmware/console/binary/bluetooth.cpp | 4 ++-- firmware/controllers/algo/engine.h | 6 +++--- firmware/controllers/core/common_headers.h | 8 ++++---- firmware/controllers/scheduling/event_queue.cpp | 14 +++++++------- .../controllers/scheduling/pwm_generator_logic.cpp | 6 +++--- .../controllers/scheduling/pwm_generator_logic.h | 4 ++-- .../controllers/scheduling/signal_executor.cpp | 2 +- .../controllers/trigger/main_trigger_callback.cpp | 2 +- firmware/controllers/trigger/spark_logic.cpp | 4 ++-- firmware/hw_layer/pin_repository.cpp | 4 ++-- 10 files changed, 27 insertions(+), 27 deletions(-) diff --git a/firmware/console/binary/bluetooth.cpp b/firmware/console/binary/bluetooth.cpp index ff14d2e232..1260ef921c 100644 --- a/firmware/console/binary/bluetooth.cpp +++ b/firmware/console/binary/bluetooth.cpp @@ -28,8 +28,8 @@ static ts_channel_s *tsChannel; static THD_WORKING_AREA(btThreadStack, UTILITY_THREAD_STACK_SIZE); -static thread_t *btThread = NULL; -static thread_reference_t btThreadRef = NULL; // used by thread suspend/resume as a flag +static thread_t *btThread = nullptr; +static thread_reference_t btThreadRef = nullptr; // used by thread suspend/resume as a flag static LoggingWithStorage btLogger("bluetooth"); diff --git a/firmware/controllers/algo/engine.h b/firmware/controllers/algo/engine.h index 5c7eac74a6..c6078a00df 100644 --- a/firmware/controllers/algo/engine.h +++ b/firmware/controllers/algo/engine.h @@ -120,7 +120,7 @@ public: /** * That's the list of pending spark firing events */ - IgnitionEvent *iHead = NULL; + IgnitionEvent *iHead = nullptr; /** * this is based on isEngineChartEnabled and engineSnifferRpmThreshold settings */ @@ -158,12 +158,12 @@ public: bool withError = false; RpmCalculator rpmCalculator; - persistent_config_s *config = NULL; + persistent_config_s *config = nullptr; /** * we use funny unique name to make sure that compiler is not confused between global variable and class member * todo: this variable is probably a sign of some problem, should we even have it? */ - engine_configuration_s *engineConfigurationPtr = NULL; + engine_configuration_s *engineConfigurationPtr = nullptr; /** * this is about 'stopengine' command diff --git a/firmware/controllers/core/common_headers.h b/firmware/controllers/core/common_headers.h index 195e676c3a..88b984c5a1 100644 --- a/firmware/controllers/core/common_headers.h +++ b/firmware/controllers/core/common_headers.h @@ -66,10 +66,10 @@ #define DISPLAY_IF(x) x #define DECLARE_ENGINE_PTR \ - Engine *engine = NULL; \ - engine_configuration_s *engineConfiguration = NULL; \ - persistent_config_s *config = NULL; \ - board_configuration_s *boardConfiguration = NULL; + Engine *engine = nullptr; \ + engine_configuration_s *engineConfiguration = nullptr; \ + persistent_config_s *config = nullptr; \ + board_configuration_s *boardConfiguration = nullptr; #define INJECT_ENGINE_REFERENCE(x) \ diff --git a/firmware/controllers/scheduling/event_queue.cpp b/firmware/controllers/scheduling/event_queue.cpp index 1f82f85007..c5dff86d73 100644 --- a/firmware/controllers/scheduling/event_queue.cpp +++ b/firmware/controllers/scheduling/event_queue.cpp @@ -24,15 +24,15 @@ extern bool verboseMode; uint32_t maxSchedulingPrecisionLoss = 0; scheduling_s::scheduling_s() { - callback = NULL; - next = NULL; - param = NULL; + callback = nullptr; + next = nullptr; + param = nullptr; isScheduled = false; momentX = 0; } EventQueue::EventQueue() { - head = NULL; + head = nullptr; setLateDelay(100); } @@ -128,8 +128,8 @@ static uint32_t lastEventCallbackDuration; int EventQueue::executeAll(efitime_t now) { scheduling_s * current, *tmp; - scheduling_s * executionList = NULL; - scheduling_s * lastInExecutionList = NULL; + scheduling_s * executionList = nullptr; + scheduling_s * lastInExecutionList = nullptr; int listIterationCounter = 0; int executionCounter = 0; @@ -233,5 +233,5 @@ scheduling_s *EventQueue::getForUnitText(int index) { } void EventQueue::clear(void) { - head = NULL; + head = nullptr; } diff --git a/firmware/controllers/scheduling/pwm_generator_logic.cpp b/firmware/controllers/scheduling/pwm_generator_logic.cpp index 48ef00eda8..7fbdc1b520 100644 --- a/firmware/controllers/scheduling/pwm_generator_logic.cpp +++ b/firmware/controllers/scheduling/pwm_generator_logic.cpp @@ -41,9 +41,9 @@ PwmConfig::PwmConfig() { mode = PM_NORMAL; memset(&outputPins, 0, sizeof(outputPins)); phaseCount = 0; - pwmCycleCallback = NULL; - stateChangeCallback = NULL; - executor = NULL; + pwmCycleCallback = nullptr; + stateChangeCallback = nullptr; + executor = nullptr; name = "[noname]"; arg = this; } diff --git a/firmware/controllers/scheduling/pwm_generator_logic.h b/firmware/controllers/scheduling/pwm_generator_logic.h index 77e081ead3..d72190643c 100644 --- a/firmware/controllers/scheduling/pwm_generator_logic.h +++ b/firmware/controllers/scheduling/pwm_generator_logic.h @@ -56,7 +56,7 @@ public: PwmConfig(); PwmConfig(float *switchTimes, SingleWave *waves); void init(float *switchTimes, SingleWave *waves); - void *arg = NULL; + void *arg = nullptr; void weComplexInit(const char *msg, ExecutorInterface *executor, @@ -102,7 +102,7 @@ public: /** * this main callback is invoked when it's time to switch level on any of the output channels */ - pwm_gen_callback *stateChangeCallback = NULL; + pwm_gen_callback *stateChangeCallback = nullptr; private: /** * float value of PWM period diff --git a/firmware/controllers/scheduling/signal_executor.cpp b/firmware/controllers/scheduling/signal_executor.cpp index 0fbb855f0a..3ede7aaeef 100644 --- a/firmware/controllers/scheduling/signal_executor.cpp +++ b/firmware/controllers/scheduling/signal_executor.cpp @@ -44,5 +44,5 @@ extern WaveChart waveChart; InjectionSignalPair::InjectionSignalPair() { isScheduled = false; memset(outputs, 0, sizeof(outputs)); - event = NULL; + event = nullptr; } diff --git a/firmware/controllers/trigger/main_trigger_callback.cpp b/firmware/controllers/trigger/main_trigger_callback.cpp index 03e8c86381..482148f614 100644 --- a/firmware/controllers/trigger/main_trigger_callback.cpp +++ b/firmware/controllers/trigger/main_trigger_callback.cpp @@ -61,7 +61,7 @@ EXTERN_ENGINE ; extern bool hasFirmwareErrorFlag; -static const char *prevOutputName = NULL; +static const char *prevOutputName = nullptr; static InjectionEvent primeInjEvent; diff --git a/firmware/controllers/trigger/spark_logic.cpp b/firmware/controllers/trigger/spark_logic.cpp index c2ce28bc96..c6aaff2838 100644 --- a/firmware/controllers/trigger/spark_logic.cpp +++ b/firmware/controllers/trigger/spark_logic.cpp @@ -25,7 +25,7 @@ extern bool verboseMode; static cyclic_buffer ignitionErrorDetection; static Logging *logger; -static const char *prevSparkName = NULL; +static const char *prevSparkName = nullptr; IgnitionEventList::IgnitionEventList() { isReady = false; @@ -100,7 +100,7 @@ static void prepareCylinderIgnitionSchedule(angle_t dwellAngle, floatms_t sparkD secondOutput = &enginePins.coils[secondCoilIndex]; assertPinAssigned(secondOutput); } else { - secondOutput = NULL; + secondOutput = nullptr; } assertPinAssigned(output); diff --git a/firmware/hw_layer/pin_repository.cpp b/firmware/hw_layer/pin_repository.cpp index da9f6f3d66..473047b9fa 100644 --- a/firmware/hw_layer/pin_repository.cpp +++ b/firmware/hw_layer/pin_repository.cpp @@ -212,7 +212,7 @@ void brain_pin_markUnused(brain_pin_e brainPin) if (getBrainUsedPin(index) != NULL) totalPinsUsed--; - getBrainUsedPin(index) = NULL; + getBrainUsedPin(index) = nullptr; } /** @@ -255,7 +255,7 @@ void gpio_pin_markUnused(ioportid_t port, ioportmask_t pin) { if (getBrainUsedPin(index) != NULL) totalPinsUsed--; - getBrainUsedPin(index) = NULL; + getBrainUsedPin(index) = nullptr; } const char *getPinFunction(brain_input_pin_e brainPin) {