]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Library/LzmaCustomDecompressLib/Sdk/C/LzFind.c
MdeModulePkg: strip trailing whitespace
[mirror_edk2.git] / MdeModulePkg / Library / LzmaCustomDecompressLib / Sdk / C / LzFind.c
index 5128fc9518b865d81cc5a27a71b34ddb723b3f0a..8765cbebfc9b8e6436fb491b671969f8425b17b4 100644 (file)
@@ -75,7 +75,7 @@ static void MatchFinder_ReadBlock(CMatchFinder *p)
       p->streamEndWasReached = 1;\r
     return;\r
   }\r
-  \r
+\r
   for (;;)\r
   {\r
     Byte *dest = p->buffer + (p->streamPos - p->pos);\r
@@ -182,24 +182,24 @@ int MatchFinder_Create(CMatchFinder *p, UInt32 historySize,
     ISzAllocPtr alloc)\r
 {\r
   UInt32 sizeReserv;\r
-  \r
+\r
   if (historySize > kMaxHistorySize)\r
   {\r
     MatchFinder_Free(p, alloc);\r
     return 0;\r
   }\r
-  \r
+\r
   sizeReserv = historySize >> 1;\r
        if (historySize >= ((UInt32)3 << 30)) sizeReserv = historySize >> 3;\r
   else if (historySize >= ((UInt32)2 << 30)) sizeReserv = historySize >> 2;\r
-  \r
+\r
   sizeReserv += (keepAddBufferBefore + matchMaxLen + keepAddBufferAfter) / 2 + (1 << 19);\r
 \r
   p->keepSizeBefore = historySize + keepAddBufferBefore + 1;\r
   p->keepSizeAfter = matchMaxLen + keepAddBufferAfter;\r
-  \r
+\r
   /* we need one additional byte, since we use MoveBlock after pos++ and before dictionary using */\r
-  \r
+\r
   if (LzInWindow_Create(p, sizeReserv, alloc))\r
   {\r
     UInt32 newCyclicBufferSize = historySize + 1;\r
@@ -245,7 +245,7 @@ int MatchFinder_Create(CMatchFinder *p, UInt32 historySize,
       p->historySize = historySize;\r
       p->hashSizeSum = hs;\r
       p->cyclicBufferSize = newCyclicBufferSize;\r
-      \r
+\r
       numSons = newCyclicBufferSize;\r
       if (p->btMode)\r
         numSons <<= 1;\r
@@ -253,11 +253,11 @@ int MatchFinder_Create(CMatchFinder *p, UInt32 historySize,
 \r
       if (p->hash && p->numRefs == newSize)\r
         return 1;\r
-      \r
+\r
       MatchFinder_FreeThisClassMemory(p, alloc);\r
       p->numRefs = newSize;\r
       p->hash = AllocRefs(newSize, alloc);\r
-      \r
+\r
       if (p->hash)\r
       {\r
         p->son = p->hash + p->hashSizeSum;\r
@@ -274,11 +274,11 @@ static void MatchFinder_SetLimits(CMatchFinder *p)
 {\r
   UInt32 limit = kMaxValForNormalize - p->pos;\r
   UInt32 limit2 = p->cyclicBufferSize - p->cyclicBufferPos;\r
-  \r
+\r
   if (limit2 < limit)\r
     limit = limit2;\r
   limit2 = p->streamPos - p->pos;\r
-  \r
+\r
   if (limit2 <= p->keepSizeAfter)\r
   {\r
     if (limit2 > 0)\r
@@ -286,10 +286,10 @@ static void MatchFinder_SetLimits(CMatchFinder *p)
   }\r
   else\r
     limit2 -= p->keepSizeAfter;\r
-  \r
+\r
   if (limit2 < limit)\r
     limit = limit2;\r
-  \r
+\r
   {\r
     UInt32 lenLimit = p->streamPos - p->pos;\r
     if (lenLimit > p->matchMaxLen)\r
@@ -328,10 +328,10 @@ void MatchFinder_Init_3(CMatchFinder *p, int readData)
   p->streamPos = p->cyclicBufferSize;\r
   p->result = SZ_OK;\r
   p->streamEndWasReached = 0;\r
-  \r
+\r
   if (readData)\r
     MatchFinder_ReadBlock(p);\r
-  \r
+\r
   MatchFinder_SetLimits(p);\r
 }\r
 \r
@@ -343,7 +343,7 @@ void MatchFinder_Init(CMatchFinder *p)
   MatchFinder_Init_3(p, True);\r
 }\r
 \r
-  \r
+\r
 static UInt32 MatchFinder_GetSubValue(CMatchFinder *p)\r
 {\r
   return (p->pos - p->historySize - 1) & kNormalizeMask;\r
@@ -586,7 +586,7 @@ static UInt32 Bt3_MatchFinder_GetMatches(CMatchFinder *p, UInt32 *distances)
   d2 = pos - hash[h2];\r
 \r
   curMatch = (hash + kFix3HashSize)[hv];\r
-  \r
+\r
   hash[h2] = pos;\r
   (hash + kFix3HashSize)[hv] = pos;\r
 \r
@@ -605,7 +605,7 @@ static UInt32 Bt3_MatchFinder_GetMatches(CMatchFinder *p, UInt32 *distances)
       MOVE_POS_RET;\r
     }\r
   }\r
-  \r
+\r
   GET_MATCHES_FOOTER(offset, maxLen)\r
 }\r
 \r
@@ -631,14 +631,14 @@ static UInt32 Bt4_MatchFinder_GetMatches(CMatchFinder *p, UInt32 *distances)
 \r
   maxLen = 0;\r
   offset = 0;\r
-  \r
+\r
   if (d2 < p->cyclicBufferSize && *(cur - d2) == *cur)\r
   {\r
     distances[0] = maxLen = 2;\r
     distances[1] = d2 - 1;\r
     offset = 2;\r
   }\r
-  \r
+\r
   if (d2 != d3 && d3 < p->cyclicBufferSize && *(cur - d3) == *cur)\r
   {\r
     maxLen = 3;\r
@@ -646,7 +646,7 @@ static UInt32 Bt4_MatchFinder_GetMatches(CMatchFinder *p, UInt32 *distances)
     offset += 2;\r
     d2 = d3;\r
   }\r
-  \r
+\r
   if (offset != 0)\r
   {\r
     UPDATE_maxLen\r
@@ -657,10 +657,10 @@ static UInt32 Bt4_MatchFinder_GetMatches(CMatchFinder *p, UInt32 *distances)
       MOVE_POS_RET;\r
     }\r
   }\r
-  \r
+\r
   if (maxLen < 3)\r
     maxLen = 3;\r
-  \r
+\r
   GET_MATCHES_FOOTER(offset, maxLen)\r
 }\r
 \r
@@ -712,7 +712,7 @@ static UInt32 Bt5_MatchFinder_GetMatches(CMatchFinder *p, UInt32 *distances)
     offset = 2;\r
     d2 = d3;\r
   }\r
-  \r
+\r
   if (d2 != d4 && d4 < p->cyclicBufferSize\r
       && *(cur - d4) == *cur\r
       && *(cur - d4 + 3) == *(cur + 3))\r
@@ -722,7 +722,7 @@ static UInt32 Bt5_MatchFinder_GetMatches(CMatchFinder *p, UInt32 *distances)
     offset += 2;\r
     d2 = d4;\r
   }\r
-  \r
+\r
   if (offset != 0)\r
   {\r
     UPDATE_maxLen\r
@@ -736,7 +736,7 @@ static UInt32 Bt5_MatchFinder_GetMatches(CMatchFinder *p, UInt32 *distances)
 \r
   if (maxLen < 4)\r
     maxLen = 4;\r
-  \r
+\r
   GET_MATCHES_FOOTER(offset, maxLen)\r
 }\r
 */\r
@@ -751,10 +751,10 @@ static UInt32 Hc4_MatchFinder_GetMatches(CMatchFinder *p, UInt32 *distances)
 \r
   hash = p->hash;\r
   pos = p->pos;\r
-  \r
+\r
   d2 = pos - hash[                h2];\r
   d3 = pos - (hash + kFix3HashSize)[h3];\r
-  \r
+\r
   curMatch = (hash + kFix4HashSize)[hv];\r
 \r
   hash[                h2] = pos;\r
@@ -770,7 +770,7 @@ static UInt32 Hc4_MatchFinder_GetMatches(CMatchFinder *p, UInt32 *distances)
     distances[1] = d2 - 1;\r
     offset = 2;\r
   }\r
-  \r
+\r
   if (d2 != d3 && d3 < p->cyclicBufferSize && *(cur - d3) == *cur)\r
   {\r
     maxLen = 3;\r
@@ -778,7 +778,7 @@ static UInt32 Hc4_MatchFinder_GetMatches(CMatchFinder *p, UInt32 *distances)
     offset += 2;\r
     d2 = d3;\r
   }\r
-  \r
+\r
   if (offset != 0)\r
   {\r
     UPDATE_maxLen\r
@@ -789,7 +789,7 @@ static UInt32 Hc4_MatchFinder_GetMatches(CMatchFinder *p, UInt32 *distances)
       MOVE_POS_RET;\r
     }\r
   }\r
-  \r
+\r
   if (maxLen < 3)\r
     maxLen = 3;\r
 \r
@@ -809,7 +809,7 @@ static UInt32 Hc5_MatchFinder_GetMatches(CMatchFinder *p, UInt32 *distances)
 \r
   hash = p->hash;\r
   pos = p->pos;\r
-  \r
+\r
   d2 = pos - hash[                h2];\r
   d3 = pos - (hash + kFix3HashSize)[h3];\r
   d4 = pos - (hash + kFix4HashSize)[h4];\r
@@ -846,7 +846,7 @@ static UInt32 Hc5_MatchFinder_GetMatches(CMatchFinder *p, UInt32 *distances)
     offset = 2;\r
     d2 = d3;\r
   }\r
-  \r
+\r
   if (d2 != d4 && d4 < p->cyclicBufferSize\r
       && *(cur - d4) == *cur\r
       && *(cur - d4 + 3) == *(cur + 3))\r
@@ -856,7 +856,7 @@ static UInt32 Hc5_MatchFinder_GetMatches(CMatchFinder *p, UInt32 *distances)
     offset += 2;\r
     d2 = d4;\r
   }\r
-  \r
+\r
   if (offset != 0)\r
   {\r
     UPDATE_maxLen\r
@@ -867,7 +867,7 @@ static UInt32 Hc5_MatchFinder_GetMatches(CMatchFinder *p, UInt32 *distances)
       MOVE_POS_RET;\r
     }\r
   }\r
-  \r
+\r
   if (maxLen < 4)\r
     maxLen = 4;\r
 \r