From daf09bd562fcf1c9a888bb330b1727e0906985f8 Mon Sep 17 00:00:00 2001 From: Bryan Biedenkapp Date: Sat, 15 Oct 2022 16:39:27 -0400 Subject: [PATCH] more NULL to nullptr changes; --- nxdn/Audio.cpp | 16 ++++++------ nxdn/Control.cpp | 48 +++++++++++++++++------------------ nxdn/Convolution.cpp | 18 ++++++------- nxdn/NXDNUtils.cpp | 2 +- nxdn/Sync.cpp | 2 +- nxdn/channel/CAC.cpp | 12 ++++----- nxdn/channel/FACCH1.cpp | 12 ++++----- nxdn/channel/LICH.cpp | 4 +-- nxdn/channel/SACCH.cpp | 12 ++++----- nxdn/channel/UDCH.cpp | 12 ++++----- nxdn/lc/PacketInformation.cpp | 4 +-- nxdn/lc/RCCH.cpp | 8 +++--- nxdn/lc/RTCH.cpp | 8 +++--- nxdn/packet/Data.cpp | 8 +++--- nxdn/packet/Trunk.cpp | 14 +++++----- nxdn/packet/Voice.cpp | 8 +++--- 16 files changed, 94 insertions(+), 94 deletions(-) diff --git a/nxdn/Audio.cpp b/nxdn/Audio.cpp index 832c8cb0..342de132 100644 --- a/nxdn/Audio.cpp +++ b/nxdn/Audio.cpp @@ -65,8 +65,8 @@ Audio::~Audio() /// void Audio::decode(const uint8_t* in, uint8_t* out) const { - assert(in != NULL); - assert(out != NULL); + assert(in != nullptr); + assert(out != nullptr); decode(in + 0U, out, 0U); decode(in + 9U, out, 49U); @@ -79,8 +79,8 @@ void Audio::decode(const uint8_t* in, uint8_t* out) const /// void Audio::encode(const uint8_t* in, uint8_t* out) const { - assert(in != NULL); - assert(out != NULL); + assert(in != nullptr); + assert(out != nullptr); encode(in, out + 0U, 0U); encode(in, out + 9U, 49U); @@ -98,8 +98,8 @@ void Audio::encode(const uint8_t* in, uint8_t* out) const /// void Audio::decode(const uint8_t* in, uint8_t* out, uint32_t offset) const { - assert(in != NULL); - assert(out != NULL); + assert(in != nullptr); + assert(out != nullptr); uint32_t a = 0U; uint32_t MASK = 0x800000U; @@ -154,8 +154,8 @@ void Audio::decode(const uint8_t* in, uint8_t* out, uint32_t offset) const /// void Audio::encode(const uint8_t* in, uint8_t* out, uint32_t offset) const { - assert(in != NULL); - assert(out != NULL); + assert(in != nullptr); + assert(out != nullptr); uint32_t aOrig = 0U; uint32_t bOrig = 0U; diff --git a/nxdn/Control.cpp b/nxdn/Control.cpp index 64fe44ad..25fd41ee 100644 --- a/nxdn/Control.cpp +++ b/nxdn/Control.cpp @@ -89,8 +89,8 @@ Control::Control(uint32_t ran, uint32_t callHang, uint32_t queueSize, uint32_t t modem::Modem* modem, network::BaseNetwork* network, bool duplex, lookups::RadioIdLookup* ridLookup, lookups::TalkgroupIdLookup* tidLookup, lookups::IdenTableLookup* idenTable, lookups::RSSIInterpolator* rssiMapper, bool dumpRCCHData, bool debug, bool verbose) : - m_voice(NULL), - m_data(NULL), + m_voice(nullptr), + m_data(nullptr), m_ran(ran), m_timeout(timeout), m_modem(modem), @@ -135,10 +135,10 @@ Control::Control(uint32_t ran, uint32_t callHang, uint32_t queueSize, uint32_t t m_verbose(verbose), m_debug(debug) { - assert(ridLookup != NULL); - assert(tidLookup != NULL); - assert(idenTable != NULL); - assert(rssiMapper != NULL); + assert(ridLookup != nullptr); + assert(tidLookup != nullptr); + assert(idenTable != nullptr); + assert(rssiMapper != nullptr); acl::AccessControl::init(m_ridLookup, m_tidLookup); @@ -155,15 +155,15 @@ Control::Control(uint32_t ran, uint32_t callHang, uint32_t queueSize, uint32_t t /// Control::~Control() { - if (m_voice != NULL) { + if (m_voice != nullptr) { delete m_voice; } - if (m_trunk != NULL) { + if (m_trunk != nullptr) { delete m_trunk; } - if (m_data != NULL) { + if (m_data != nullptr) { delete m_data; } } @@ -176,11 +176,11 @@ void Control::reset() m_rfState = RS_RF_LISTENING; m_ccHalted = false; - if (m_voice != NULL) { + if (m_voice != nullptr) { m_voice->resetRF(); } - if (m_data != NULL) { + if (m_data != nullptr) { m_data->resetRF(); } @@ -273,16 +273,16 @@ void Control::setOptions(yaml::Node& conf, const std::string cwCallsign, const s LogInfo(" Verify Registration: %s", m_trunk->m_verifyReg ? "yes" : "no"); } - if (m_voice != NULL) { + if (m_voice != nullptr) { m_voice->resetRF(); m_voice->resetNet(); } - if (m_data != NULL) { + if (m_data != nullptr) { m_data->resetRF(); } - if (m_trunk != NULL) { + if (m_trunk != nullptr) { m_trunk->resetRF(); m_trunk->resetNet(); } @@ -296,7 +296,7 @@ void Control::setOptions(yaml::Node& conf, const std::string cwCallsign, const s /// bool Control::processFrame(uint8_t* data, uint32_t len) { - assert(data != NULL); + assert(data != nullptr); uint8_t type = data[0U]; bool sync = data[1U] == 0x01U; @@ -455,7 +455,7 @@ bool Control::processFrame(uint8_t* data, uint32_t len) /// Length of frame data retreived. uint32_t Control::getFrame(uint8_t* data) { - assert(data != NULL); + assert(data != nullptr); if (m_queue.isEmpty()) return 0U; @@ -473,7 +473,7 @@ uint32_t Control::getFrame(uint8_t* data) /// void Control::clock(uint32_t ms) { - if (m_network != NULL) { + if (m_network != nullptr) { processNetwork(); if (m_network->getStatus() == network::NET_STAT_RUNNING) { @@ -553,7 +553,7 @@ void Control::clock(uint32_t ms) } if (m_dedicatedControl) { - if (m_network != NULL) + if (m_network != nullptr) m_network->resetNXDN(); } @@ -574,14 +574,14 @@ void Control::clock(uint32_t ms) m_data->resetRF(); - if (m_network != NULL) + if (m_network != nullptr) m_network->resetNXDN(); m_rfState = RS_RF_LISTENING; } // clock data and trunking - if (m_trunk != NULL) { + if (m_trunk != nullptr) { m_trunk->clock(ms); } } @@ -627,7 +627,7 @@ void Control::setRCCHVerbose(bool verbose) /// void Control::addFrame(const uint8_t *data, uint32_t length, bool net) { - assert(data != NULL); + assert(data != nullptr); if (!net) { if (m_rfTimeout.isRunning() && m_rfTimeout.hasExpired()) @@ -677,7 +677,7 @@ void Control::processNetwork() return; if (length == 0U) return; - if (data == NULL) { + if (data == nullptr) { m_network->resetNXDN(); return; } @@ -815,7 +815,7 @@ void Control::writeEndRF() m_rfTimeout.stop(); //m_queue.clear(); - if (m_network != NULL) + if (m_network != nullptr) m_network->resetNXDN(); } @@ -832,6 +832,6 @@ void Control::writeEndNet() m_netTimeout.stop(); m_networkWatchdog.stop(); - if (m_network != NULL) + if (m_network != nullptr) m_network->resetP25(); } diff --git a/nxdn/Convolution.cpp b/nxdn/Convolution.cpp index e26d0b98..c8ced0ad 100644 --- a/nxdn/Convolution.cpp +++ b/nxdn/Convolution.cpp @@ -59,12 +59,12 @@ const uint32_t K = 5U; /// Initializes a new instance of the Convolution class. /// Convolution::Convolution() : - m_metrics1(NULL), - m_metrics2(NULL), - m_oldMetrics(NULL), - m_newMetrics(NULL), - m_decisions(NULL), - m_dp(NULL) + m_metrics1(nullptr), + m_metrics2(nullptr), + m_oldMetrics(nullptr), + m_newMetrics(nullptr), + m_decisions(nullptr), + m_dp(nullptr) { m_metrics1 = new uint16_t[20U]; m_metrics2 = new uint16_t[20U]; @@ -101,7 +101,7 @@ void Convolution::start() /// uint32_t Convolution::chainback(uint8_t* out, uint32_t nBits) { - assert(out != NULL); + assert(out != nullptr); uint32_t state = 0U; @@ -173,8 +173,8 @@ bool Convolution::decode(uint8_t s0, uint8_t s1) /// void Convolution::encode(const uint8_t* in, uint8_t* out, uint32_t nBits) const { - assert(in != NULL); - assert(out != NULL); + assert(in != nullptr); + assert(out != nullptr); assert(nBits > 0U); uint8_t d1 = 0U, d2 = 0U, d3 = 0U, d4 = 0U; diff --git a/nxdn/NXDNUtils.cpp b/nxdn/NXDNUtils.cpp index 9c3a473d..f564abe5 100644 --- a/nxdn/NXDNUtils.cpp +++ b/nxdn/NXDNUtils.cpp @@ -57,7 +57,7 @@ const uint8_t SCRAMBLER[] = { /// void NXDNUtils::scrambler(uint8_t* data) { - assert(data != NULL); + assert(data != nullptr); for (uint32_t i = 0U; i < NXDN_FRAME_LENGTH_BYTES; i++) data[i] ^= SCRAMBLER[i]; diff --git a/nxdn/Sync.cpp b/nxdn/Sync.cpp index c9c2a795..a3d19683 100644 --- a/nxdn/Sync.cpp +++ b/nxdn/Sync.cpp @@ -47,7 +47,7 @@ using namespace nxdn; /// void Sync::addNXDNSync(uint8_t* data) { - assert(data != NULL); + assert(data != nullptr); for (uint32_t i = 0U; i < NXDN_FSW_BYTES_LENGTH; i++) data[i] = (data[i] & ~NXDN_FSW_BYTES_MASK[i]) | NXDN_FSW_BYTES[i]; diff --git a/nxdn/channel/CAC.cpp b/nxdn/channel/CAC.cpp index a2447f79..d2014c8c 100644 --- a/nxdn/channel/CAC.cpp +++ b/nxdn/channel/CAC.cpp @@ -124,7 +124,7 @@ CAC::CAC() : m_idleBusy(true), m_txContinuous(false), m_receive(true), - m_data(NULL), + m_data(nullptr), m_rxCRC(0U) { m_data = new uint8_t[NXDN_CAC_CRC_LENGTH_BYTES]; @@ -141,7 +141,7 @@ CAC::CAC(const CAC& data) : m_idleBusy(true), m_txContinuous(false), m_receive(true), - m_data(NULL), + m_data(nullptr), m_rxCRC(0U) { copy(data); @@ -185,7 +185,7 @@ CAC& CAC::operator=(const CAC& data) /// True, if CAC was decoded, otherwise false. bool CAC::decode(const uint8_t* data) { - assert(data != NULL); + assert(data != nullptr); uint8_t buffer[NXDN_CAC_IN_FEC_LENGTH_BYTES]; ::memset(buffer, 0x00U, NXDN_CAC_IN_FEC_LENGTH_BYTES); @@ -259,7 +259,7 @@ bool CAC::decode(const uint8_t* data) /// void CAC::encode(uint8_t* data) const { - assert(data != NULL); + assert(data != nullptr); m_data[0U] &= 0xC0U; m_data[0U] |= m_ran; @@ -344,7 +344,7 @@ void CAC::encode(uint8_t* data) const /// void CAC::getData(uint8_t* data) const { - assert(data != NULL); + assert(data != nullptr); uint32_t offset = 8U; for (uint32_t i = 0U; i < (NXDN_CAC_SHORT_LENGTH_BITS - 10); i++, offset++) { @@ -359,7 +359,7 @@ void CAC::getData(uint8_t* data) const /// void CAC::setData(const uint8_t* data) { - assert(data != NULL); + assert(data != nullptr); ::memset(m_data, 0x00U, NXDN_CAC_CRC_LENGTH_BYTES); diff --git a/nxdn/channel/FACCH1.cpp b/nxdn/channel/FACCH1.cpp index 66c80c0a..91300832 100644 --- a/nxdn/channel/FACCH1.cpp +++ b/nxdn/channel/FACCH1.cpp @@ -72,7 +72,7 @@ const uint32_t PUNCTURE_LIST[] = { /// Initializes a new instance of the FACCH1 class. /// FACCH1::FACCH1() : - m_data(NULL) + m_data(nullptr) { m_data = new uint8_t[NXDN_FACCH1_CRC_LENGTH_BYTES]; ::memset(m_data, 0x00U, NXDN_FACCH1_CRC_LENGTH_BYTES); @@ -83,7 +83,7 @@ FACCH1::FACCH1() : /// /// FACCH1::FACCH1(const FACCH1& data) : - m_data(NULL) + m_data(nullptr) { copy(data); } @@ -117,7 +117,7 @@ FACCH1& FACCH1::operator=(const FACCH1& data) /// True, if FACCH1 was decoded, otherwise false. bool FACCH1::decode(const uint8_t* data, uint32_t offset) { - assert(data != NULL); + assert(data != nullptr); uint8_t buffer[NXDN_FACCH1_FEC_LENGTH_BYTES]; ::memset(buffer, 0x00U, NXDN_FACCH1_FEC_LENGTH_BYTES); @@ -188,7 +188,7 @@ bool FACCH1::decode(const uint8_t* data, uint32_t offset) /// True, if LICH was decoded, otherwise false. void FACCH1::encode(uint8_t* data, uint32_t offset) const { - assert(data != NULL); + assert(data != nullptr); uint8_t buffer[NXDN_FACCH1_CRC_LENGTH_BYTES]; ::memset(buffer, 0x00U, NXDN_FACCH1_CRC_LENGTH_BYTES); @@ -240,7 +240,7 @@ void FACCH1::encode(uint8_t* data, uint32_t offset) const /// void FACCH1::getData(uint8_t* data) const { - assert(data != NULL); + assert(data != nullptr); ::memcpy(data, m_data, NXDN_FACCH1_CRC_LENGTH_BYTES - 2U); } @@ -251,7 +251,7 @@ void FACCH1::getData(uint8_t* data) const /// void FACCH1::setData(const uint8_t* data) { - assert(data != NULL); + assert(data != nullptr); ::memcpy(m_data, data, NXDN_FACCH1_CRC_LENGTH_BYTES - 2U); } diff --git a/nxdn/channel/LICH.cpp b/nxdn/channel/LICH.cpp index c8dff28d..33cf5da4 100644 --- a/nxdn/channel/LICH.cpp +++ b/nxdn/channel/LICH.cpp @@ -104,7 +104,7 @@ LICH& LICH::operator=(const LICH& data) /// True, if LICH was decoded, otherwise false. bool LICH::decode(const uint8_t* data) { - assert(data != NULL); + assert(data != nullptr); uint8_t lich[1U]; ::memset(lich, 0x00U, 1U); @@ -138,7 +138,7 @@ bool LICH::decode(const uint8_t* data) /// void LICH::encode(uint8_t* data) { - assert(data != NULL); + assert(data != nullptr); m_lich = 0U; diff --git a/nxdn/channel/SACCH.cpp b/nxdn/channel/SACCH.cpp index d80f737b..1b3f4867 100644 --- a/nxdn/channel/SACCH.cpp +++ b/nxdn/channel/SACCH.cpp @@ -67,7 +67,7 @@ const uint32_t PUNCTURE_LIST[] = { 5U, 11U, 17U, 23U, 29U, 35U, 41U, 47U, 53U, 5 SACCH::SACCH() : m_ran(0U), m_structure(NXDN_SR_SINGLE), - m_data(NULL) + m_data(nullptr) { m_data = new uint8_t[NXDN_SACCH_CRC_LENGTH_BYTES]; ::memset(m_data, 0x00U, NXDN_SACCH_CRC_LENGTH_BYTES); @@ -80,7 +80,7 @@ SACCH::SACCH() : SACCH::SACCH(const SACCH& data) : m_ran(0U), m_structure(NXDN_SR_SINGLE), - m_data(NULL) + m_data(nullptr) { copy(data); } @@ -117,7 +117,7 @@ SACCH& SACCH::operator=(const SACCH& data) /// True, if SACCH was decoded, otherwise false. bool SACCH::decode(const uint8_t* data) { - assert(data != NULL); + assert(data != nullptr); uint8_t buffer[NXDN_SACCH_FEC_LENGTH_BYTES]; ::memset(buffer, 0x00U, NXDN_SACCH_FEC_LENGTH_BYTES); @@ -192,7 +192,7 @@ bool SACCH::decode(const uint8_t* data) /// void SACCH::encode(uint8_t* data) const { - assert(data != NULL); + assert(data != nullptr); m_data[0U] &= 0xC0U; m_data[0U] |= m_ran; @@ -254,7 +254,7 @@ void SACCH::encode(uint8_t* data) const /// void SACCH::getData(uint8_t* data) const { - assert(data != NULL); + assert(data != nullptr); uint32_t offset = 8U; for (uint32_t i = 0U; i < (NXDN_SACCH_LENGTH_BITS - 8); i++, offset++) { @@ -269,7 +269,7 @@ void SACCH::getData(uint8_t* data) const /// void SACCH::setData(const uint8_t* data) { - assert(data != NULL); + assert(data != nullptr); uint32_t offset = 8U; for (uint32_t i = 0U; i < (NXDN_SACCH_LENGTH_BITS - 8); i++, offset++) { diff --git a/nxdn/channel/UDCH.cpp b/nxdn/channel/UDCH.cpp index 6c384aa7..798e46ea 100644 --- a/nxdn/channel/UDCH.cpp +++ b/nxdn/channel/UDCH.cpp @@ -95,7 +95,7 @@ const uint32_t PUNCTURE_LIST[] = { /// UDCH::UDCH() : m_ran(0U), - m_data(NULL) + m_data(nullptr) { m_data = new uint8_t[NXDN_UDCH_CRC_LENGTH_BYTES]; ::memset(m_data, 0x00U, NXDN_UDCH_CRC_LENGTH_BYTES); @@ -107,7 +107,7 @@ UDCH::UDCH() : /// UDCH::UDCH(const UDCH& data) : m_ran(0U), - m_data(NULL) + m_data(nullptr) { copy(data); } @@ -143,7 +143,7 @@ UDCH& UDCH::operator=(const UDCH& data) /// True, if UDCH was decoded, otherwise false. bool UDCH::decode(const uint8_t* data) { - assert(data != NULL); + assert(data != nullptr); uint8_t buffer[NXDN_UDCH_FEC_LENGTH_BYTES]; ::memset(buffer, 0x00U, NXDN_UDCH_FEC_LENGTH_BYTES); @@ -215,7 +215,7 @@ bool UDCH::decode(const uint8_t* data) /// void UDCH::encode(uint8_t* data) const { - assert(data != NULL); + assert(data != nullptr); m_data[0U] = m_ran; @@ -269,7 +269,7 @@ void UDCH::encode(uint8_t* data) const /// void UDCH::getData(uint8_t* data) const { - assert(data != NULL); + assert(data != nullptr); ::memcpy(data, m_data + 1U, NXDN_RTCH_LC_LENGTH_BYTES); } @@ -280,7 +280,7 @@ void UDCH::getData(uint8_t* data) const /// void UDCH::setData(const uint8_t* data) { - assert(data != NULL); + assert(data != nullptr); ::memcpy(m_data + 1U, data, NXDN_RTCH_LC_LENGTH_BYTES); } diff --git a/nxdn/lc/PacketInformation.cpp b/nxdn/lc/PacketInformation.cpp index a4b2320b..894820b3 100644 --- a/nxdn/lc/PacketInformation.cpp +++ b/nxdn/lc/PacketInformation.cpp @@ -74,7 +74,7 @@ PacketInformation::~PacketInformation() /// True, if packet information was decoded, otherwise false. bool PacketInformation::decode(const uint8_t messageType, const uint8_t* data) { - assert(data != NULL); + assert(data != nullptr); switch (messageType) { @@ -118,7 +118,7 @@ bool PacketInformation::decode(const uint8_t messageType, const uint8_t* data) /// void PacketInformation::encode(const uint8_t messageType, uint8_t* data) { - assert(data != NULL); + assert(data != nullptr); switch (messageType) { diff --git a/nxdn/lc/RCCH.cpp b/nxdn/lc/RCCH.cpp index 473f9b54..b317d010 100644 --- a/nxdn/lc/RCCH.cpp +++ b/nxdn/lc/RCCH.cpp @@ -105,7 +105,7 @@ RCCH& RCCH::operator=(const RCCH& data) /// True, if RCCH was decoded, otherwise false. void RCCH::decode(const uint8_t* data, uint32_t length, uint32_t offset) { - assert(data != NULL); + assert(data != nullptr); uint8_t rcch[22U]; ::memset(rcch, 0x00U, NXDN_RCCH_LC_LENGTH_BYTES + 4U); @@ -130,7 +130,7 @@ void RCCH::decode(const uint8_t* data, uint32_t length, uint32_t offset) /// void RCCH::encode(uint8_t* data, uint32_t length, uint32_t offset) { - assert(data != NULL); + assert(data != nullptr); uint8_t rcch[22U]; ::memset(rcch, 0x00U, NXDN_RCCH_LC_LENGTH_BYTES + 4U); @@ -244,7 +244,7 @@ RCCH::RCCH(SiteData siteData) : /// bool RCCH::decodeLC(const uint8_t* data) { - assert(data != NULL); + assert(data != nullptr); m_messageType = data[0U] & 0x3FU; // Message Type @@ -303,7 +303,7 @@ bool RCCH::decodeLC(const uint8_t* data) /// void RCCH::encodeLC(uint8_t* data) { - assert(data != NULL); + assert(data != nullptr); data[0U] = m_messageType & 0x3FU; // Message Type diff --git a/nxdn/lc/RTCH.cpp b/nxdn/lc/RTCH.cpp index 7e0f8b37..d53fb00f 100644 --- a/nxdn/lc/RTCH.cpp +++ b/nxdn/lc/RTCH.cpp @@ -129,7 +129,7 @@ RTCH& RTCH::operator=(const RTCH& data) /// True, if RTCH was decoded, otherwise false. void RTCH::decode(const uint8_t* data, uint32_t length, uint32_t offset) { - assert(data != NULL); + assert(data != nullptr); uint8_t rtch[NXDN_RTCH_LC_LENGTH_BYTES]; ::memset(rtch, 0x00U, NXDN_RTCH_LC_LENGTH_BYTES); @@ -154,7 +154,7 @@ void RTCH::decode(const uint8_t* data, uint32_t length, uint32_t offset) /// void RTCH::encode(uint8_t* data, uint32_t length, uint32_t offset) { - assert(data != NULL); + assert(data != nullptr); uint8_t rtch[NXDN_RTCH_LC_LENGTH_BYTES]; ::memset(rtch, 0x00U, NXDN_RTCH_LC_LENGTH_BYTES); @@ -213,7 +213,7 @@ void RTCH::reset() /// bool RTCH::decodeLC(const uint8_t* data) { - assert(data != NULL); + assert(data != nullptr); m_messageType = data[0U] & 0x3FU; // Message Type @@ -329,7 +329,7 @@ bool RTCH::decodeLC(const uint8_t* data) /// void RTCH::encodeLC(uint8_t* data) { - assert(data != NULL); + assert(data != nullptr); data[0U] = m_messageType & 0x3FU; // Message Type diff --git a/nxdn/packet/Data.cpp b/nxdn/packet/Data.cpp index 576de09d..107542bc 100644 --- a/nxdn/packet/Data.cpp +++ b/nxdn/packet/Data.cpp @@ -180,7 +180,7 @@ void Data::resetNet() /// bool Data::process(uint8_t option, uint8_t* data, uint32_t len) { - assert(data != NULL); + assert(data != nullptr); channel::UDCH udch; bool validUDCH = udch.decode(data + 2U); @@ -288,7 +288,7 @@ bool Data::process(uint8_t option, uint8_t* data, uint32_t len) /// bool Data::processNetwork(uint8_t option, lc::RTCH& netLC, uint8_t* data, uint32_t len) { - assert(data != NULL); + assert(data != nullptr); if (m_nxdn->m_netState == RS_NET_IDLE) { m_nxdn->m_queue.clear(); @@ -419,9 +419,9 @@ Data::~Data() /// void Data::writeNetwork(const uint8_t *data, uint32_t len) { - assert(data != NULL); + assert(data != nullptr); - if (m_network == NULL) + if (m_network == nullptr) return; if (m_nxdn->m_rfTimeout.isRunning() && m_nxdn->m_rfTimeout.hasExpired()) diff --git a/nxdn/packet/Trunk.cpp b/nxdn/packet/Trunk.cpp index 1b87aff8..aeb353f7 100644 --- a/nxdn/packet/Trunk.cpp +++ b/nxdn/packet/Trunk.cpp @@ -143,7 +143,7 @@ void Trunk::resetNet() /// bool Trunk::process(uint8_t fct, uint8_t option, uint8_t* data, uint32_t len) { - assert(data != NULL); + assert(data != nullptr); channel::CAC cac; bool validCAC = cac.decode(data + 2U); @@ -232,7 +232,7 @@ bool Trunk::process(uint8_t fct, uint8_t option, uint8_t* data, uint32_t len) /// bool Trunk::processNetwork(uint8_t fct, uint8_t option, lc::RTCH& netLC, uint8_t* data, uint32_t len) { - assert(data != NULL); + assert(data != nullptr); if (m_nxdn->m_netState == RS_NET_IDLE) { m_nxdn->m_queue.clear(); @@ -251,7 +251,7 @@ bool Trunk::processNetwork(uint8_t fct, uint8_t option, lc::RTCH& netLC, uint8_t void Trunk::clock(uint32_t ms) { if (m_nxdn->m_control) { - if (m_nxdn->m_network != NULL) { + if (m_nxdn->m_network != nullptr) { if (m_nxdn->m_network->isHandlingChGrants() && m_nxdn->m_siteData.netActive()) { bool grp = true; uint32_t srcId = 0U; @@ -316,9 +316,9 @@ Trunk::~Trunk() /// void Trunk::writeNetwork(const uint8_t *data, uint32_t len) { - assert(data != NULL); + assert(data != nullptr); - if (m_network == NULL) + if (m_network == nullptr) return; if (m_nxdn->m_rfTimeout.isRunning() && m_nxdn->m_rfTimeout.hasExpired()) @@ -438,7 +438,7 @@ bool Trunk::writeRF_Message_Grant(bool grp, bool skip, bool net, bool skipNetChe uint8_t messageType = m_rfLC.getMessageType(); // do we have a network connection and are we handling grants at the network? - if (m_nxdn->m_network != NULL) { + if (m_nxdn->m_network != nullptr) { if (m_nxdn->m_network->isHandlingChGrants() && m_nxdn->m_siteData.netActive() && !skipNetCheck) { return m_nxdn->m_network->writeGrantReq(grp, m_rfLC.getSrcId(), m_rfLC.getDstId()); } @@ -779,7 +779,7 @@ void Trunk::writeRF_CC_Message_Service_Info() /// void Trunk::addPostBits(uint8_t* data) { - assert(data != NULL); + assert(data != nullptr); // post field for (uint32_t i = 0U; i < NXDN_CAC_E_POST_FIELD_BITS; i++) { diff --git a/nxdn/packet/Voice.cpp b/nxdn/packet/Voice.cpp index 443af75a..266ae0c5 100644 --- a/nxdn/packet/Voice.cpp +++ b/nxdn/packet/Voice.cpp @@ -187,7 +187,7 @@ void Voice::resetNet() /// bool Voice::process(uint8_t fct, uint8_t option, uint8_t* data, uint32_t len) { - assert(data != NULL); + assert(data != nullptr); channel::SACCH sacch; bool valid = sacch.decode(data + 2U); @@ -621,7 +621,7 @@ bool Voice::process(uint8_t fct, uint8_t option, uint8_t* data, uint32_t len) /// bool Voice::processNetwork(uint8_t fct, uint8_t option, lc::RTCH& netLC, uint8_t *data, uint32_t len) { - assert(data != NULL); + assert(data != nullptr); if (m_nxdn->m_netState == RS_NET_IDLE) { m_nxdn->m_queue.clear(); @@ -1016,9 +1016,9 @@ Voice::~Voice() /// void Voice::writeNetwork(const uint8_t *data, uint32_t len) { - assert(data != NULL); + assert(data != nullptr); - if (m_network == NULL) + if (m_network == nullptr) return; if (m_nxdn->m_rfTimeout.isRunning() && m_nxdn->m_rfTimeout.hasExpired())