mirror of
https://github.com/espressif/openthread.git
synced 2026-07-29 23:27:46 +00:00
[style] replace NULL with nullptr (#5109)
This commit is contained in:
@@ -32,20 +32,20 @@
|
||||
|
||||
bool g_testPlatAlarmSet = false;
|
||||
uint32_t g_testPlatAlarmNext = 0;
|
||||
testPlatAlarmStop g_testPlatAlarmStop = NULL;
|
||||
testPlatAlarmStartAt g_testPlatAlarmStartAt = NULL;
|
||||
testPlatAlarmGetNow g_testPlatAlarmGetNow = NULL;
|
||||
testPlatAlarmStop g_testPlatAlarmStop = nullptr;
|
||||
testPlatAlarmStartAt g_testPlatAlarmStartAt = nullptr;
|
||||
testPlatAlarmGetNow g_testPlatAlarmGetNow = nullptr;
|
||||
|
||||
otRadioCaps g_testPlatRadioCaps = OT_RADIO_CAPS_NONE;
|
||||
testPlatRadioSetPanId g_testPlatRadioSetPanId = NULL;
|
||||
testPlatRadioSetExtendedAddress g_testPlatRadioSetExtendedAddress = NULL;
|
||||
testPlatRadioIsEnabled g_testPlatRadioIsEnabled = NULL;
|
||||
testPlatRadioEnable g_testPlatRadioEnable = NULL;
|
||||
testPlatRadioDisable g_testPlatRadioDisable = NULL;
|
||||
testPlatRadioSetShortAddress g_testPlatRadioSetShortAddress = NULL;
|
||||
testPlatRadioReceive g_testPlatRadioReceive = NULL;
|
||||
testPlatRadioTransmit g_testPlatRadioTransmit = NULL;
|
||||
testPlatRadioGetTransmitBuffer g_testPlatRadioGetTransmitBuffer = NULL;
|
||||
testPlatRadioSetPanId g_testPlatRadioSetPanId = nullptr;
|
||||
testPlatRadioSetExtendedAddress g_testPlatRadioSetExtendedAddress = nullptr;
|
||||
testPlatRadioIsEnabled g_testPlatRadioIsEnabled = nullptr;
|
||||
testPlatRadioEnable g_testPlatRadioEnable = nullptr;
|
||||
testPlatRadioDisable g_testPlatRadioDisable = nullptr;
|
||||
testPlatRadioSetShortAddress g_testPlatRadioSetShortAddress = nullptr;
|
||||
testPlatRadioReceive g_testPlatRadioReceive = nullptr;
|
||||
testPlatRadioTransmit g_testPlatRadioTransmit = nullptr;
|
||||
testPlatRadioGetTransmitBuffer g_testPlatRadioGetTransmitBuffer = nullptr;
|
||||
|
||||
enum
|
||||
{
|
||||
@@ -57,18 +57,18 @@ uint8_t g_flash[FLASH_SWAP_SIZE * FLASH_SWAP_NUM];
|
||||
|
||||
ot::Instance *testInitInstance(void)
|
||||
{
|
||||
otInstance *instance = NULL;
|
||||
otInstance *instance = nullptr;
|
||||
|
||||
#if OPENTHREAD_CONFIG_MULTIPLE_INSTANCE_ENABLE
|
||||
size_t instanceBufferLength = 0;
|
||||
uint8_t *instanceBuffer = NULL;
|
||||
uint8_t *instanceBuffer = nullptr;
|
||||
|
||||
// Call to query the buffer size
|
||||
(void)otInstanceInit(NULL, &instanceBufferLength);
|
||||
(void)otInstanceInit(nullptr, &instanceBufferLength);
|
||||
|
||||
// Call to allocate the buffer
|
||||
instanceBuffer = (uint8_t *)malloc(instanceBufferLength);
|
||||
VerifyOrQuit(instanceBuffer != NULL, "Failed to allocate otInstance");
|
||||
VerifyOrQuit(instanceBuffer != nullptr, "Failed to allocate otInstance");
|
||||
memset(instanceBuffer, 0, instanceBufferLength);
|
||||
|
||||
// Initialize OpenThread with the buffer
|
||||
@@ -147,7 +147,7 @@ uint32_t otPlatAlarmMilliGetNow(void)
|
||||
else
|
||||
{
|
||||
struct timeval tv;
|
||||
gettimeofday(&tv, NULL);
|
||||
gettimeofday(&tv, nullptr);
|
||||
return (uint32_t)((tv.tv_sec * 1000) + (tv.tv_usec / 1000) + 123456);
|
||||
}
|
||||
}
|
||||
@@ -186,7 +186,7 @@ uint32_t otPlatAlarmMicroGetNow(void)
|
||||
else
|
||||
{
|
||||
struct timeval tv;
|
||||
gettimeofday(&tv, NULL);
|
||||
gettimeofday(&tv, nullptr);
|
||||
return (uint32_t)((tv.tv_sec * 1000000) + tv.tv_usec + 123456);
|
||||
}
|
||||
}
|
||||
@@ -596,7 +596,7 @@ uint64_t otPlatTimeGet(void)
|
||||
{
|
||||
struct timeval tv;
|
||||
|
||||
gettimeofday(&tv, NULL);
|
||||
gettimeofday(&tv, nullptr);
|
||||
|
||||
return (uint64_t)tv.tv_sec * 1000000 + (uint64_t)tv.tv_usec;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user