diff options
author | Rakesh Raghava <rakeshraghava@google.com> | 2022-12-11 10:58:03 +0000 |
---|---|---|
committer | Rakesh Raghava <rakeshraghava@google.com> | 2022-12-11 17:24:50 +0000 |
commit | 6fd3373454ff5a82dbf7b5a7a7b833032367ff52 (patch) | |
tree | b4f85a633c62f6eb3fd1e0a524c7785d4803c72b /service/src/com/android/telephony/imsmedia/lib/libimsmedia/protocol/rtp/core/RtcpReportBlock.cpp | |
parent | 5e5a289406dd8fcd45adfccea9c1f5768e8ef03c (diff) | |
download | ImsMedia-6fd3373454ff5a82dbf7b5a7a7b833032367ff52.tar.gz |
Fix RtpStack static analysis Cppcheck - cstyleCast
Remove C-style casting
Bug: 260845223
Test: VoLte/Video Call Test with device
atest ImsMediaNativeTests
Verified RTCP packets sent and received
Change-Id: I29467c8ecace0710969cae9e5856bbba655857c6
Diffstat (limited to 'service/src/com/android/telephony/imsmedia/lib/libimsmedia/protocol/rtp/core/RtcpReportBlock.cpp')
-rw-r--r-- | service/src/com/android/telephony/imsmedia/lib/libimsmedia/protocol/rtp/core/RtcpReportBlock.cpp | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/service/src/com/android/telephony/imsmedia/lib/libimsmedia/protocol/rtp/core/RtcpReportBlock.cpp b/service/src/com/android/telephony/imsmedia/lib/libimsmedia/protocol/rtp/core/RtcpReportBlock.cpp index 5ffcfc97..554ac70e 100644 --- a/service/src/com/android/telephony/imsmedia/lib/libimsmedia/protocol/rtp/core/RtcpReportBlock.cpp +++ b/service/src/com/android/telephony/imsmedia/lib/libimsmedia/protocol/rtp/core/RtcpReportBlock.cpp @@ -102,10 +102,10 @@ RtpDt_UInt32 RtcpReportBlock::getDelayLastSR() eRtp_Bool RtcpReportBlock::decodeReportBlock(IN RtpDt_UChar* pcRepBlkBuf) { // SSRC - m_uiSsrc = RtpOsUtil::Ntohl(*((RtpDt_UInt32*)pcRepBlkBuf)); + m_uiSsrc = RtpOsUtil::Ntohl(*(reinterpret_cast<RtpDt_UInt32*>(pcRepBlkBuf))); pcRepBlkBuf = pcRepBlkBuf + RTP_WORD_SIZE; - RtpDt_UInt32 uiTemp4Data = RtpOsUtil::Ntohl(*((RtpDt_UInt32*)pcRepBlkBuf)); + RtpDt_UInt32 uiTemp4Data = RtpOsUtil::Ntohl(*(reinterpret_cast<RtpDt_UInt32*>(pcRepBlkBuf))); pcRepBlkBuf = pcRepBlkBuf + RTP_WORD_SIZE; // cumulative number of packets lost (3 bytes) @@ -115,19 +115,19 @@ eRtp_Bool RtcpReportBlock::decodeReportBlock(IN RtpDt_UChar* pcRepBlkBuf) m_ucFracLost = (RtpDt_UChar)(uiTemp4Data & 0x000000FF); // extended highest sequence number received - m_uiExtHighSeqRcv = RtpOsUtil::Ntohl(*((RtpDt_UInt32*)pcRepBlkBuf)); + m_uiExtHighSeqRcv = RtpOsUtil::Ntohl(*(reinterpret_cast<RtpDt_UInt32*>(pcRepBlkBuf))); pcRepBlkBuf = pcRepBlkBuf + RTP_WORD_SIZE; // interarrival jitter - m_uiJitter = RtpOsUtil::Ntohl(*((RtpDt_UInt32*)pcRepBlkBuf)); + m_uiJitter = RtpOsUtil::Ntohl(*(reinterpret_cast<RtpDt_UInt32*>(pcRepBlkBuf))); pcRepBlkBuf = pcRepBlkBuf + RTP_WORD_SIZE; // last SR - m_uiLastSR = RtpOsUtil::Ntohl(*((RtpDt_UInt32*)pcRepBlkBuf)); + m_uiLastSR = RtpOsUtil::Ntohl(*(reinterpret_cast<RtpDt_UInt32*>(pcRepBlkBuf))); pcRepBlkBuf = pcRepBlkBuf + RTP_WORD_SIZE; // delay since last SR - m_uiDelayLastSR = RtpOsUtil::Ntohl(*((RtpDt_UInt32*)pcRepBlkBuf)); + m_uiDelayLastSR = RtpOsUtil::Ntohl(*(reinterpret_cast<RtpDt_UInt32*>(pcRepBlkBuf))); pcRepBlkBuf = pcRepBlkBuf + RTP_WORD_SIZE; return eRTP_SUCCESS; @@ -140,7 +140,7 @@ eRtp_Bool RtcpReportBlock::formReportBlock(OUT RtpBuffer* pobjRtcpPktBuf) pucBuffer = pucBuffer + uiCurPos; // m_uiSsrc - *(RtpDt_UInt32*)pucBuffer = RtpOsUtil::Ntohl(m_uiSsrc); + *(reinterpret_cast<RtpDt_UInt32*>(pucBuffer)) = RtpOsUtil::Ntohl(m_uiSsrc); pucBuffer = pucBuffer + RTP_WORD_SIZE; uiCurPos = uiCurPos + RTP_WORD_SIZE; @@ -151,27 +151,27 @@ eRtp_Bool RtcpReportBlock::formReportBlock(OUT RtpBuffer* pobjRtcpPktBuf) // consider only 24-bits of uiCumNumPktLost uiTempData = uiTempData | (m_uiCumNumPktLost & 0X00FFFFFF); - *(RtpDt_UInt32*)pucBuffer = RtpOsUtil::Ntohl(uiTempData); + *(reinterpret_cast<RtpDt_UInt32*>(pucBuffer)) = RtpOsUtil::Ntohl(uiTempData); pucBuffer = pucBuffer + RTP_WORD_SIZE; uiCurPos = uiCurPos + RTP_WORD_SIZE; // m_uiExtHighSeqRcv - *(RtpDt_UInt32*)pucBuffer = RtpOsUtil::Ntohl(m_uiExtHighSeqRcv); + *(reinterpret_cast<RtpDt_UInt32*>(pucBuffer)) = RtpOsUtil::Ntohl(m_uiExtHighSeqRcv); pucBuffer = pucBuffer + RTP_WORD_SIZE; uiCurPos = uiCurPos + RTP_WORD_SIZE; // m_uiJitter - *(RtpDt_UInt32*)pucBuffer = RtpOsUtil::Ntohl(m_uiJitter); + *(reinterpret_cast<RtpDt_UInt32*>(pucBuffer)) = RtpOsUtil::Ntohl(m_uiJitter); pucBuffer = pucBuffer + RTP_WORD_SIZE; uiCurPos = uiCurPos + RTP_WORD_SIZE; // m_uiLastSR - *(RtpDt_UInt32*)pucBuffer = RtpOsUtil::Ntohl(m_uiLastSR); + *(reinterpret_cast<RtpDt_UInt32*>(pucBuffer)) = RtpOsUtil::Ntohl(m_uiLastSR); pucBuffer = pucBuffer + RTP_WORD_SIZE; uiCurPos = uiCurPos + RTP_WORD_SIZE; // m_uiDelayLastSR - *(RtpDt_UInt32*)pucBuffer = RtpOsUtil::Ntohl(m_uiDelayLastSR); + *(reinterpret_cast<RtpDt_UInt32*>(pucBuffer)) = RtpOsUtil::Ntohl(m_uiDelayLastSR); uiCurPos = uiCurPos + RTP_WORD_SIZE; pobjRtcpPktBuf->setLength(uiCurPos); |