[style] replace NULL with nullptr (#5109)

This commit is contained in:
Jonathan Hui
2020-06-17 22:44:54 -07:00
committed by GitHub
parent 3b362071e5
commit 1326d64a64
209 changed files with 1981 additions and 1906 deletions
+4 -4
View File
@@ -47,8 +47,8 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)
{
const otPanId panId = 0xdead;
otInstance *instance = NULL;
uint8_t * buf = NULL;
otInstance *instance = nullptr;
uint8_t * buf = nullptr;
VerifyOrExit(size <= 65536, OT_NOOP);
@@ -81,12 +81,12 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)
exit:
if (buf != NULL)
if (buf != nullptr)
{
free(buf);
}
if (instance != NULL)
if (instance != nullptr)
{
otInstanceFinalize(instance);
}
+1 -1
View File
@@ -109,7 +109,7 @@ void FuzzerPlatformProcess(otInstance *aInstance)
}
else
{
otPlatRadioTxDone(aInstance, &sRadioTransmitFrame, NULL, OT_ERROR_NONE);
otPlatRadioTxDone(aInstance, &sRadioTransmitFrame, nullptr, OT_ERROR_NONE);
}
}
+6 -6
View File
@@ -45,8 +45,8 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)
{
const otPanId panId = 0xdead;
otInstance * instance = NULL;
otMessage * message = NULL;
otInstance * instance = nullptr;
otMessage * message = nullptr;
otError error = OT_ERROR_NONE;
otMessageSettings settings;
@@ -64,14 +64,14 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)
settings.mPriority = OT_MESSAGE_PRIORITY_NORMAL;
message = otIp6NewMessage(instance, &settings);
VerifyOrExit(message != NULL, error = OT_ERROR_NO_BUFS);
VerifyOrExit(message != nullptr, error = OT_ERROR_NO_BUFS);
error = otMessageAppend(message, data + 1, static_cast<uint16_t>(size - 1));
SuccessOrExit(error);
error = otIp6Send(instance, message);
message = NULL;
message = nullptr;
VerifyOrExit(!FuzzerPlatformResetWasRequested(), OT_NOOP);
@@ -87,12 +87,12 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)
exit:
if (message != NULL)
if (message != nullptr)
{
otMessageFree(message);
}
if (instance != NULL)
if (instance != nullptr)
{
otInstanceFinalize(instance);
}
+4 -4
View File
@@ -47,8 +47,8 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)
{
const otPanId panId = 0xdead;
otInstance *instance = NULL;
uint8_t * buf = NULL;
otInstance *instance = nullptr;
uint8_t * buf = nullptr;
VerifyOrExit(size <= 65536, OT_NOOP);
@@ -81,12 +81,12 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)
exit:
if (buf != NULL)
if (buf != nullptr)
{
free(buf);
}
if (instance != NULL)
if (instance != nullptr)
{
otInstanceFinalize(instance);
}
+4 -4
View File
@@ -46,9 +46,9 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)
{
const otPanId panId = 0xdead;
otInstance * instance = NULL;
otInstance * instance = nullptr;
otRadioFrame frame;
uint8_t * buf = NULL;
uint8_t * buf = nullptr;
VerifyOrExit(size <= OT_RADIO_FRAME_MAX_SIZE, OT_NOOP);
@@ -85,12 +85,12 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)
exit:
if (buf != NULL)
if (buf != nullptr)
{
free(buf);
}
if (instance != NULL)
if (instance != nullptr)
{
otInstanceFinalize(instance);
}