From 4b2df6150fc26d8434c2cc1a430fb839c26f0608 Mon Sep 17 00:00:00 2001 From: Jonathan Naylor Date: Tue, 20 Feb 2018 20:31:26 +0000 Subject: [PATCH] Small fixes. --- NXDNAudio.cpp | 17 ++++------------- NXDNControl.cpp | 2 +- 2 files changed, 5 insertions(+), 14 deletions(-) diff --git a/NXDNAudio.cpp b/NXDNAudio.cpp index 3509276a1..912036eac 100644 --- a/NXDNAudio.cpp +++ b/NXDNAudio.cpp @@ -498,18 +498,13 @@ void CNXDNAudio::decode(const unsigned char* in, unsigned char* out, unsigned in MASK >>= 1; } - bool b24 = (b & 0x01U) == 0x01U; - unsigned int data = CGolay24128::decode24128(a); // The PRNG unsigned int p = PRNG_TABLE[data]; - b ^= p; - unsigned int datb = CGolay24128::decode24128(b); - datb &= 0xFFFFFEU; - datb |= b24 ? 0x01U : 0x00U; + unsigned int datb = CGolay24128::decode24128(b); MASK = 0x000800U; for (unsigned int i = 0U; i < 12U; i++) { @@ -564,18 +559,14 @@ void CNXDNAudio::encode(const unsigned char* in, unsigned char* out, unsigned in MASK >>= 1; } - bool b24 = (cOrig & 0x1000000U) == 0x1000000U; + unsigned int a = CGolay24128::encode24128(aOrig); // The PRNG unsigned int p = PRNG_TABLE[aOrig]; - - unsigned int a = CGolay24128::encode24128(aOrig); unsigned int b = CGolay24128::encode24128(bOrig); - unsigned int c = cOrig; - b ^= p; - b &= 0xFFFFFEU; - b |= b24 ? 0x01U : 0x00U; + + unsigned int c = cOrig; MASK = 0x800000U; for (unsigned int i = 0U; i < 24U; i++) { diff --git a/NXDNControl.cpp b/NXDNControl.cpp index 401e73bf6..3231d0fd1 100644 --- a/NXDNControl.cpp +++ b/NXDNControl.cpp @@ -773,8 +773,8 @@ void CNXDNControl::writeNetwork() m_netFrames = 1U; m_netLost = 0U; } else { - m_netFrames++; CUtils::dump(2U, "NXDN, interesting non superblock network frame", netData, 33U); + return; } } else { if (m_netState == RS_NET_IDLE) {