[warnigns] fix Wshorten-64-to-32

This commit is contained in:
akallabeth
2024-10-14 15:50:38 +02:00
parent f88eda3f11
commit 78acedb40e
138 changed files with 1307 additions and 869 deletions

View File

@@ -774,7 +774,10 @@ int mppc_compress(MPPC_CONTEXT* mppc, const BYTE* pSrcData, UINT32 SrcSize, BYTE
*pDstSize = ((bs->position + 7) / 8);
mppc->HistoryPtr = HistoryPtr;
mppc->HistoryOffset = HistoryPtr - HistoryBuffer;
const intptr_t diff = HistoryPtr - HistoryBuffer;
if (diff > UINT32_MAX)
return -1;
mppc->HistoryOffset = (UINT32)diff;
return 1;
}