Add casts to avoid warnings about comparison between signed and unsigned

This fixes warnings with gcc and msvc.
This commit is contained in:
Martin Storsjö
2014-11-03 11:02:27 +02:00
parent 0e9541247a
commit 8ffacf0918
2 changed files with 2 additions and 2 deletions

View File

@@ -418,7 +418,7 @@ int32_t ParseIntra4x4Mode (PWelsDecoderContext pCtx, PWelsNeighAvail pNeighAvail
iBestMode = kiPredMode;
} else {
WELS_READ_VERIFY (BsGetBits (pBs, 3, &uiCode));
iBestMode = uiCode + (uiCode >= kiPredMode);
iBestMode = uiCode + ((int32_t) uiCode >= kiPredMode);
}
}

View File

@@ -236,7 +236,7 @@ bool GomValidCheckSliceNum (const int32_t kiMbWidth, const int32_t kiMbHeight, u
iGomSize = kiMbWidth * GOM_ROW_MODE0_720P;
while (true) {
if (kiCountNumMb < iGomSize * iSliceNum) {
if (kiCountNumMb < iGomSize * (int32_t) iSliceNum) {
-- iSliceNum;
iSliceNum = iSliceNum - (iSliceNum & 0x01); // verfiy even num for multiple slices case
if (iSliceNum < 2) // for safe