diff --git a/Tiano/EfiTianoCompress.c b/Tiano/EfiTianoCompress.c index 334e791..4f70fa5 100644 --- a/Tiano/EfiTianoCompress.c +++ b/Tiano/EfiTianoCompress.c @@ -260,7 +260,7 @@ STATIC NODE mPos, mMatchPos, mAvail, *mPosition, *mParent, *mPrev, *mNext = NU EFI_STATUS EfiCompress ( - IN VOID *SrcBuffer, + IN CONST VOID *SrcBuffer, IN UINT32 SrcSize, IN VOID *DstBuffer, IN OUT UINT32 *DstSize @@ -303,7 +303,7 @@ Returns: mNext = NULL; gPBIT = 4; - mSrc = SrcBuffer; + mSrc = (UINT8*)SrcBuffer; mSrcUpperLimit = mSrc + SrcSize; mDst = DstBuffer; mDstUpperLimit = mDst + *DstSize; @@ -355,7 +355,7 @@ Returns: EFI_STATUS TianoCompress( -IN VOID *SrcBuffer, +IN CONST VOID *SrcBuffer, IN UINT32 SrcSize, IN VOID *DstBuffer, IN OUT UINT32 *DstSize @@ -398,7 +398,7 @@ EFI_SUCCESS - Compression is successful. mNext = NULL; gPBIT = 5; - mSrc = SrcBuffer; + mSrc = (UINT8*)SrcBuffer; mSrcUpperLimit = mSrc + SrcSize; mDst = DstBuffer; mDstUpperLimit = mDst + *DstSize; @@ -596,20 +596,20 @@ Returns: (VOID) { NODE i; - for (i = WNDSIZ; i <= WNDSIZ + UINT8_MAX; i++) { + for (i = WNDSIZ; i <= (NODE)(WNDSIZ + UINT8_MAX); i++) { mLevel[i] = 1; mPosition[i] = NIL; /* sentinel */ } - for (i = WNDSIZ; i < WNDSIZ * 2; i++) { + for (i = WNDSIZ; i < (NODE)(WNDSIZ * 2); i++) { mParent[i] = NIL; } mAvail = 1; - for (i = 1; i < WNDSIZ - 1; i++) { + for (i = 1; i < (NODE)(WNDSIZ - 1); i++) { mNext[i] = (NODE)(i + 1); } mNext[WNDSIZ - 1] = NIL; - for (i = WNDSIZ * 2; i <= MAX_HASH_VAL; i++) { + for (i = WNDSIZ * 2; i <= (NODE)MAX_HASH_VAL; i++) { mNext[i] = NIL; } } @@ -762,7 +762,7 @@ Returns: (VOID) mPosition[t] = mPos; t = mParent[t]; } - if (t < WNDSIZ) { + if (t < (NODE)WNDSIZ) { mPosition[t] = (NODE)(mPos | PERC_FLAG); } } else { @@ -788,7 +788,7 @@ Returns: (VOID) // for ( ; ; ) { - if (r >= WNDSIZ) { + if (r >= (NODE)WNDSIZ) { j = MAXMATCH; mMatchPos = r; } else { @@ -864,7 +864,7 @@ Returns: (VOID) mPrev[s] = r; r = mParent[mPos]; mParent[mPos] = NIL; - if (r >= WNDSIZ || --mChildCount[r] > 1) { + if (r >= (NODE)WNDSIZ || --mChildCount[r] > 1) { return; } t = (NODE)(mPosition[r] & ~PERC_FLAG); @@ -884,7 +884,7 @@ Returns: (VOID) mPosition[q] = (INT16)(s | WNDSIZ); q = mParent[q]; } - if (q < WNDSIZ) { + if (q < (NODE)WNDSIZ) { if (u >= mPos) { u -= WNDSIZ; }