ref: 917d41bd47217d890cb3414d65477cafa9f2f332
parent: 82b70b34fe3ca03af1e7f79aa92d85e6917454d1
author: Martin Storsjö <martin@martin.st>
date: Thu Nov 27 06:31:13 EST 2014
Add casts when converting pointer differences to integers This fixes warnings when building with MSVC in 64 bit mode.
--- a/codec/decoder/core/src/au_parser.cpp
+++ b/codec/decoder/core/src/au_parser.cpp
@@ -1053,7 +1053,7 @@
pCtx->iErrorCode |= dsOutOfMemory;
return pCtx->iErrorCode;
}
- DecInitBitsForEncoding (&sSubsetSpsBs, pBsBuf, pBs->pEndBuf - pBs->pStartBuf);
+ DecInitBitsForEncoding (&sSubsetSpsBs, pBsBuf, (int32_t) (pBs->pEndBuf - pBs->pStartBuf));
DecBsWriteBits (&sSubsetSpsBs, 8, 77); //profile_idc, forced to Main profile
DecBsWriteOneBit (&sSubsetSpsBs, pSps->bConstraintSet0Flag); // constraint_set0_flag
DecBsWriteOneBit (&sSubsetSpsBs, pSps->bConstraintSet1Flag); // constraint_set1_flag
@@ -1093,9 +1093,9 @@
}
DecBsWriteOneBit (&sSubsetSpsBs, 0); //vui_parameters_present_flag
DecBsRbspTrailingBits (&sSubsetSpsBs); //finished, rbsp trailing bit
- int32_t iRbspSize = sSubsetSpsBs.pCurBuf - sSubsetSpsBs.pStartBuf;
+ int32_t iRbspSize = (int32_t) (sSubsetSpsBs.pCurBuf - sSubsetSpsBs.pStartBuf);
RBSP2EBSP (pSpsBs->pSpsBsBuf + 5, sSubsetSpsBs.pStartBuf, iRbspSize);
- pSpsBs->uiSpsBsLen = sSubsetSpsBs.pCurBuf - sSubsetSpsBs.pStartBuf + 5;
+ pSpsBs->uiSpsBsLen = (uint16_t) (sSubsetSpsBs.pCurBuf - sSubsetSpsBs.pStartBuf + 5);
if (pBsBuf) {
WelsFree (pBsBuf, "pBsBuf for parse only usage");
}