ref: 57aae73d4c5cf1a664b9e08bcbb179ede4ddfde6
parent: 94a1d4426e26e01ee5170d2f3d404c124d329407
author: Martin Storsjö <[email protected]>
date: Thu Oct 23 10:20:38 EDT 2014
Add casts to avoid warnings about comparison between signed and unsigned
--- a/codec/encoder/plus/src/welsEncoderExt.cpp
+++ b/codec/encoder/plus/src/welsEncoderExt.cpp
@@ -599,8 +599,8 @@
int32_t iMaxDid = m_pEncContext->pSvcParam->iSpatialLayerNum - 1;
if ((0 != pStatistics->uWidth && 0 != pStatistics->uHeight)
- && (pStatistics->uWidth != m_pEncContext->pSvcParam->sDependencyLayers[iMaxDid].iActualWidth
- || pStatistics->uHeight != m_pEncContext->pSvcParam->sDependencyLayers[iMaxDid].iActualHeight)) {
+ && (pStatistics->uWidth != (unsigned int) m_pEncContext->pSvcParam->sDependencyLayers[iMaxDid].iActualWidth
+ || pStatistics->uHeight != (unsigned int) m_pEncContext->pSvcParam->sDependencyLayers[iMaxDid].iActualHeight)) {
pStatistics->uiResolutionChangeTimes ++;
}
pStatistics->uWidth = m_pEncContext->pSvcParam->sDependencyLayers[iMaxDid].iActualWidth;
--- a/test/encoder/EncUT_EncoderExt.cpp
+++ b/test/encoder/EncUT_EncoderExt.cpp
@@ -681,12 +681,12 @@
SEncoderStatistics sEncoderStatistics;
iResult = pPtrEnc->GetOption (ENCODER_OPTION_GET_STATISTICS, &sEncoderStatistics);
EXPECT_EQ (iResult, static_cast<int> (cmResultSuccess));
- EXPECT_EQ (sEncoderStatistics.uiInputFrameCount, 2);
- EXPECT_EQ (sEncoderStatistics.uIDRSentNum, 1);
- EXPECT_EQ (sEncoderStatistics.uiResolutionChangeTimes, 0);
+ EXPECT_EQ (sEncoderStatistics.uiInputFrameCount, static_cast<unsigned int> (2));
+ EXPECT_EQ (sEncoderStatistics.uIDRSentNum, static_cast<unsigned int> (1));
+ EXPECT_EQ (sEncoderStatistics.uiResolutionChangeTimes, static_cast<unsigned int> (0));
- EXPECT_EQ (sEncoderStatistics.uWidth, sEncParamBase.iPicWidth);
- EXPECT_EQ (sEncoderStatistics.uHeight, sEncParamBase.iPicHeight);
+ EXPECT_EQ (sEncoderStatistics.uWidth, static_cast<unsigned int> (sEncParamBase.iPicWidth));
+ EXPECT_EQ (sEncoderStatistics.uHeight, static_cast<unsigned int> (sEncParamBase.iPicHeight));
// try param change
// 1, get the existing
@@ -711,12 +711,12 @@
iResult = pPtrEnc->GetOption (ENCODER_OPTION_GET_STATISTICS, &sEncoderStatistics);
EXPECT_EQ (iResult, static_cast<int> (cmResultSuccess));
- EXPECT_EQ (sEncoderStatistics.uiInputFrameCount, 3);
- EXPECT_EQ (sEncoderStatistics.uIDRSentNum, 2);
- EXPECT_EQ (sEncoderStatistics.uiResolutionChangeTimes, knownResolutionChangeTimes);
+ EXPECT_EQ (sEncoderStatistics.uiInputFrameCount, static_cast<unsigned int> (3));
+ EXPECT_EQ (sEncoderStatistics.uIDRSentNum, static_cast<unsigned int> (2));
+ EXPECT_EQ (sEncoderStatistics.uiResolutionChangeTimes, static_cast<unsigned int> (knownResolutionChangeTimes));
- EXPECT_EQ (sEncoderStatistics.uWidth, sEncParamBase.iPicWidth);
- EXPECT_EQ (sEncoderStatistics.uHeight, sEncParamBase.iPicHeight);
+ EXPECT_EQ (sEncoderStatistics.uWidth, static_cast<unsigned int> (sEncParamBase.iPicWidth));
+ EXPECT_EQ (sEncoderStatistics.uHeight, static_cast<unsigned int> (sEncParamBase.iPicHeight));
// 4, change log interval
int32_t iInterval = 0;
@@ -740,4 +740,4 @@
// finish
pPtrEnc->Uninitialize();
-}
\ No newline at end of file
+}