Skip to content

Commit 2b2bce1

Browse files
committed
CLEANUP: correct some -wreorder warnings; CLEANUP: correct some type conversion warnings;
1 parent 274b805 commit 2b2bce1

1 file changed

Lines changed: 8 additions & 8 deletions

File tree

src/bridge/HostBridge.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,7 @@ HostBridge::HostBridge(const std::string& confFile) :
162162
m_confFile(confFile),
163163
m_conf(),
164164
m_network(nullptr),
165+
m_udpAudioSocket(nullptr),
165166
m_srcId(P25DEF::WUID_FNE),
166167
m_srcIdOverride(0U),
167168
m_overrideSrcIdFromMDC(false),
@@ -179,6 +180,8 @@ HostBridge::HostBridge(const std::string& confFile) :
179180
m_vocoderDecoderAutoGain(false),
180181
m_txAudioGain(1.0f),
181182
m_vocoderEncoderAudioGain(3.0),
183+
m_trace(false),
184+
m_debug(false),
182185
m_tekAlgoId(P25DEF::ALGO_UNENCRYPT),
183186
m_tekKeyId(0U),
184187
m_requestedTek(false),
@@ -203,7 +206,6 @@ HostBridge::HostBridge(const std::string& confFile) :
203206
m_decoder(nullptr),
204207
m_encoder(nullptr),
205208
m_mdcDecoder(nullptr),
206-
m_udpAudioSocket(nullptr),
207209
m_udpAudio(false),
208210
m_udpMetadata(false),
209211
m_udpSendPort(34001),
@@ -255,8 +257,6 @@ HostBridge::HostBridge(const std::string& confFile) :
255257
m_txStreamId(0U),
256258
m_detectedSampleCnt(0U),
257259
m_networkWatchdog(1000U, 0U, 1500U),
258-
m_trace(false),
259-
m_debug(false),
260260
m_rtpInitialFrame(false),
261261
m_rtpSeqNo(0U),
262262
m_rtpTimestamp(INVALID_TS),
@@ -1384,17 +1384,17 @@ void HostBridge::processUDPAudio()
13841384
return;
13851385
}
13861386

1387-
if (length > AUDIO_SAMPLES_LENGTH_BYTES * 2U) {
1387+
if (length > (int)(AUDIO_SAMPLES_LENGTH_BYTES * 2U)) {
13881388
LogWarning(LOG_NET, "UDP audio packet too large (%d bytes), dropping", length);
13891389
return;
13901390
}
13911391

13921392
// is the recieved audio frame *at least* raw PCM length of 320 bytes?
1393-
if (!m_udpUseULaw && length < AUDIO_SAMPLES_LENGTH_BYTES)
1393+
if (!m_udpUseULaw && length < (int)AUDIO_SAMPLES_LENGTH_BYTES)
13941394
return;
13951395

13961396
// is the recieved audio frame *at least* uLaw length of 160 bytes?
1397-
if (m_udpUseULaw && length < AUDIO_SAMPLES_LENGTH_BYTES / 2U)
1397+
if (m_udpUseULaw && length < (int)(AUDIO_SAMPLES_LENGTH_BYTES / 2U))
13981398
return;
13991399

14001400
if (length > 0) {
@@ -1438,10 +1438,10 @@ void HostBridge::processUDPAudio()
14381438
m_udpNetPktSeq, lastRxSeq);
14391439
}
14401440

1441-
m_udpNetPktSeq = m_udpNetPktSeq;
1441+
m_udpNetLastPktSeq = m_udpNetPktSeq;
14421442
}
14431443
else {
1444-
if (m_udpNetPktSeq < m_udpNetPktSeq) {
1444+
if (m_udpNetPktSeq < m_udpNetLastPktSeq) {
14451445
LogWarning(LOG_NET, "audio out-of-order; got %u, expected %u",
14461446
m_udpNetPktSeq, lastRxSeq);
14471447
}

0 commit comments

Comments
 (0)