diff options
author | xli24 <xli24@6f19259b-4bc3-4df7-8a09-765794883524> | 2007-01-25 06:05:36 +0000 |
---|---|---|
committer | xli24 <xli24@6f19259b-4bc3-4df7-8a09-765794883524> | 2007-01-25 06:05:36 +0000 |
commit | 582510249f2fb1334e507b99421b9485f6b89159 (patch) | |
tree | cd9d7414885d26e79565cd12ec241af93dc600f2 /MdePkg/Library/BaseUefiDecompressLib/BaseUefiDecompressLib.c | |
parent | ba3a1cb5bb97ffdea980f188fbd14b08200aeac6 (diff) | |
download | edk2-platforms-582510249f2fb1334e507b99421b9485f6b89159.tar.xz |
Make MDE package pass intel IPF compiler with /W4 /WX switched on.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@2312 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdePkg/Library/BaseUefiDecompressLib/BaseUefiDecompressLib.c')
-rw-r--r-- | MdePkg/Library/BaseUefiDecompressLib/BaseUefiDecompressLib.c | 68 |
1 files changed, 11 insertions, 57 deletions
diff --git a/MdePkg/Library/BaseUefiDecompressLib/BaseUefiDecompressLib.c b/MdePkg/Library/BaseUefiDecompressLib/BaseUefiDecompressLib.c index a336417760..e70dc88ef1 100644 --- a/MdePkg/Library/BaseUefiDecompressLib/BaseUefiDecompressLib.c +++ b/MdePkg/Library/BaseUefiDecompressLib/BaseUefiDecompressLib.c @@ -14,59 +14,7 @@ **/
-//
-// Decompression algorithm begins here
-//
-#define BITBUFSIZ 32
-#define MAXMATCH 256
-#define THRESHOLD 3
-#define CODE_BIT 16
-#define BAD_TABLE - 1
-
-//
-// C: Char&Len Set; P: Position Set; T: exTra Set
-//
-#define NC (0xff + MAXMATCH + 2 - THRESHOLD)
-#define CBIT 9
-#define MAXPBIT 5
-#define TBIT 5
-#define MAXNP ((1U << MAXPBIT) - 1)
-#define NT (CODE_BIT + 3)
-#if NT > MAXNP
-#define NPT NT
-#else
-#define NPT MAXNP
-#endif
-
-typedef struct {
- UINT8 *mSrcBase; ///< Starting address of compressed data
- UINT8 *mDstBase; ///< Starting address of decompressed data
- UINT32 mOutBuf;
- UINT32 mInBuf;
-
- UINT16 mBitCount;
- UINT32 mBitBuf;
- UINT32 mSubBitBuf;
- UINT16 mBlockSize;
- UINT32 mCompSize;
- UINT32 mOrigSize;
-
- UINT16 mBadTableFlag;
-
- UINT16 mLeft[2 * NC - 1];
- UINT16 mRight[2 * NC - 1];
- UINT8 mCLen[NC];
- UINT8 mPTLen[NPT];
- UINT16 mCTable[4096];
- UINT16 mPTTable[256];
-
- ///
- /// The length of the field 'Position Set Code Length Array Size' in Block Header.
- /// For EFI 1.1 de/compression algorithm, mPBit = 4
- /// For Tiano de/compression algorithm, mPBit = 5
- ///
- UINT8 mPBit;
-} SCRATCH_DATA;
+#include "BaseUefiDecompressLibInternals.h"
/**
Read NumOfBit of bits from source into mBitBuf
@@ -195,6 +143,9 @@ MakeTable ( UINT16 Avail;
UINT16 NextCode;
UINT16 Mask;
+ UINT16 WordOfStart;
+ UINT16 WordOfCount;
+
for (Index = 1; Index <= 16; Index++) {
Count[Index] = 0;
@@ -207,7 +158,9 @@ MakeTable ( Start[1] = 0;
for (Index = 1; Index <= 16; Index++) {
- Start[Index + 1] = (UINT16) (Start[Index] + (Count[Index] << (16 - Index)));
+ WordOfStart = Start[Index];
+ WordOfCount = Count[Index];
+ Start[Index + 1] = (UINT16) (WordOfStart + (WordOfCount << (16 - Index)));
}
if (Start[17] != 0) {
@@ -627,7 +580,7 @@ Decode ( //
CharC = DecodeC (Sd);
if (Sd->mBadTableFlag != 0) {
- return ;
+ goto Done;
}
if (CharC < 256) {
@@ -635,7 +588,7 @@ Decode ( // Process an Original character
//
if (Sd->mOutBuf >= Sd->mOrigSize) {
- return ;
+ goto Done;
} else {
//
// Write orignal character into mDstBase
@@ -666,7 +619,7 @@ Decode ( while ((INT16) (BytesRemain) >= 0) {
Sd->mDstBase[Sd->mOutBuf++] = Sd->mDstBase[DataIdx++];
if (Sd->mOutBuf >= Sd->mOrigSize) {
- return ;
+ goto Done;
}
BytesRemain--;
@@ -674,6 +627,7 @@ Decode ( }
}
+Done:
return ;
}
|