diff --git a/src/core/api/joiner_api.cpp b/src/core/api/joiner_api.cpp index 0b35e2604..4a1d8dffc 100644 --- a/src/core/api/joiner_api.cpp +++ b/src/core/api/joiner_api.cpp @@ -83,7 +83,7 @@ otError otJoinerSetDiscerner(otInstance *aInstance, otJoinerDiscerner *aDiscerne otError error = OT_ERROR_NONE; MeshCoP::Joiner &joiner = static_cast(aInstance)->Get(); - if (aDiscerner != NULL) + if (aDiscerner != nullptr) { error = joiner.SetDiscerner(*static_cast(aDiscerner)); } diff --git a/src/core/backbone_router/bbr_manager.hpp b/src/core/backbone_router/bbr_manager.hpp index f55aa595f..bd68a110b 100644 --- a/src/core/backbone_router/bbr_manager.hpp +++ b/src/core/backbone_router/bbr_manager.hpp @@ -73,7 +73,7 @@ public: * Note: available only when `OPENTHREAD_CONFIG_REFERENCE_DEVICE_ENABLE` is enabled. * Only used for test and certification. * - * @param[in] aMlIid A pointer to the Mesh Local IID. If NULL, respond with @p aStatus for any + * @param[in] aMlIid A pointer to the Mesh Local IID. If nullptr, respond with @p aStatus for any * coming DUA.req, otherwise only respond the one with matching @p aMlIid. * @param[in] aStatus The status to respond. * diff --git a/src/core/mac/link_raw.cpp b/src/core/mac/link_raw.cpp index 9fa17ceed..dc0f5c22d 100644 --- a/src/core/mac/link_raw.cpp +++ b/src/core/mac/link_raw.cpp @@ -68,7 +68,7 @@ otError LinkRaw::SetReceiveDone(otLinkRawReceiveDone aCallback) { otError error = OT_ERROR_NONE; - otLogDebgMac("LinkRaw::Enabled(%s)", (aCallback != NULL ? "true" : "false")); + otLogDebgMac("LinkRaw::Enabled(%s)", (aCallback != nullptr ? "true" : "false")); #if OPENTHREAD_MTD || OPENTHREAD_FTD VerifyOrExit(!Get().IsUp(), error = OT_ERROR_INVALID_STATE); diff --git a/src/core/mac/link_raw.hpp b/src/core/mac/link_raw.hpp index 5de185491..0f0c81975 100644 --- a/src/core/mac/link_raw.hpp +++ b/src/core/mac/link_raw.hpp @@ -71,13 +71,13 @@ public: * @returns true if enabled, false otherwise. * */ - bool IsEnabled(void) const { return mReceiveDoneCallback != NULL; } + bool IsEnabled(void) const { return mReceiveDoneCallback != nullptr; } /** * This method enables/disables the raw link-layer. * - * @param[in] aCallback A pointer to a function called on receipt of a IEEE 802.15.4 frame, NULL to disable - * raw link-layer. + * @param[in] aCallback A pointer to a function called on receipt of a IEEE 802.15.4 frame, nullptr to disable + * raw link-layer. * * * @retval OT_ERROR_INVALID_STATE Thread stack is enabled. diff --git a/src/core/thread/dua_manager.cpp b/src/core/thread/dua_manager.cpp index f8178af0f..bb12ff220 100644 --- a/src/core/thread/dua_manager.cpp +++ b/src/core/thread/dua_manager.cpp @@ -615,7 +615,7 @@ otError DuaManager::ProcessDuaResponse(Coap::Message &aMessage) { Child *child = Get().GetChildAtIndex(mChildIndexDuaRegistering); - VerifyOrExit(child != NULL, error = OT_ERROR_NOT_FOUND); + VerifyOrExit(child != nullptr, error = OT_ERROR_NOT_FOUND); VerifyOrExit(child->HasIp6Address(target), error = OT_ERROR_NOT_FOUND); mRegisterCurrentChildIndex = false; @@ -684,7 +684,7 @@ exit: otLogWarnDua("Sent ADDR_NTF for child %04x DUA %s Error %s", aChild.GetRloc16(), aAddress.ToString().AsCString(), otThreadErrorToString(error)); - if (message != NULL) + if (message != nullptr) { message->Free(); } diff --git a/src/ncp/ncp_base_radio.cpp b/src/ncp/ncp_base_radio.cpp index 0d23a697f..8d3d4499d 100644 --- a/src/ncp/ncp_base_radio.cpp +++ b/src/ncp/ncp_base_radio.cpp @@ -348,7 +348,7 @@ template <> otError NcpBase::HandlePropertySet(void) if (value == false) { - error = otLinkRawSetReceiveDone(mInstance, NULL); + error = otLinkRawSetReceiveDone(mInstance, nullptr); } else { diff --git a/src/posix/platform/alarm.cpp b/src/posix/platform/alarm.cpp index 0dfdddc0b..195a2719c 100644 --- a/src/posix/platform/alarm.cpp +++ b/src/posix/platform/alarm.cpp @@ -113,7 +113,7 @@ void platformAlarmInit(uint32_t aSpeedUpFactor, int aRealTimeSignal) sa.sa_sigaction = microTimerHandler; sigemptyset(&sa.sa_mask); - VerifyOrDie(sigaction(aRealTimeSignal, &sa, NULL) != -1, OT_EXIT_ERROR_ERRNO); + VerifyOrDie(sigaction(aRealTimeSignal, &sa, nullptr) != -1, OT_EXIT_ERROR_ERRNO); sev.sigev_notify = SIGEV_SIGNAL; sev.sigev_signo = aRealTimeSignal; @@ -176,7 +176,7 @@ void otPlatAlarmMicroStartAt(otInstance *aInstance, uint32_t aT0, uint32_t aDt) its.it_interval.tv_sec = 0; its.it_interval.tv_nsec = 0; - if (-1 == timer_settime(sMicroTimer, 0, &its, NULL)) + if (-1 == timer_settime(sMicroTimer, 0, &its, nullptr)) { otLogWarnPlat("Failed to update microsecond timer: %s", strerror(errno)); } @@ -195,7 +195,7 @@ void otPlatAlarmMicroStop(otInstance *aInstance) { struct itimerspec its = {{0, 0}, {0, 0}}; - if (-1 == timer_settime(sMicroTimer, 0, &its, NULL)) + if (-1 == timer_settime(sMicroTimer, 0, &its, nullptr)) { otLogWarnPlat("Failed to stop microsecond timer: %s", strerror(errno)); }