Convert to C++ nullptr from NULL.

This commit is contained in:
Jonathan Naylor 2025-03-14 12:13:11 +00:00
parent 43f8b2f6f0
commit cf15f42a0f
98 changed files with 1340 additions and 1340 deletions

View file

@ -1,5 +1,5 @@
/*
* Copyright (C) 2018 by Jonathan Naylor G4KLX
* Copyright (C) 2018,2025 by Jonathan Naylor G4KLX
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -29,14 +29,14 @@ const unsigned char BIT_MASK_TABLE[] = { 0x80U, 0x40U, 0x20U, 0x10U, 0x08U, 0x04
#define READ_BIT1(p,i) (p[(i)>>3] & BIT_MASK_TABLE[(i)&7])
CNXDNLayer3::CNXDNLayer3(const CNXDNLayer3& layer3) :
m_data(NULL)
m_data(nullptr)
{
m_data = new unsigned char[22U];
::memcpy(m_data, layer3.m_data, 22U);
}
CNXDNLayer3::CNXDNLayer3() :
m_data(NULL)
m_data(nullptr)
{
m_data = new unsigned char[22U];
::memset(m_data, 0x00U, 22U);
@ -49,7 +49,7 @@ CNXDNLayer3::~CNXDNLayer3()
void CNXDNLayer3::decode(const unsigned char* bytes, unsigned int length, unsigned int offset)
{
assert(bytes != NULL);
assert(bytes != nullptr);
for (unsigned int i = 0U; i < length; i++, offset++) {
bool b = READ_BIT1(bytes, i);
@ -59,7 +59,7 @@ void CNXDNLayer3::decode(const unsigned char* bytes, unsigned int length, unsign
void CNXDNLayer3::encode(unsigned char* bytes, unsigned int length, unsigned int offset)
{
assert(bytes != NULL);
assert(bytes != nullptr);
for (unsigned int i = 0U; i < length; i++, offset++) {
bool b = READ_BIT1(m_data, offset);