]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdePkg/Library/BaseUefiDecompressLib/BaseUefiDecompressLib.c
MdePkg: Clean up source files
[mirror_edk2.git] / MdePkg / Library / BaseUefiDecompressLib / BaseUefiDecompressLib.c
index e818543d925530ee9a9f66245c423c15b22bc2a6..dc89157c4efd47c2a1fac61757faf86f754c39a2 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   UEFI Decompress Library implementation refer to UEFI specification.\r
 \r
-  Copyright (c) 2006 - 2015, Intel Corporation. All rights reserved.<BR>\r
+  Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>\r
   Portions copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>\r
   This program and the accompanying materials\r
   are licensed and made available under the terms and conditions of the BSD License\r
@@ -71,7 +71,7 @@ FillBuf (
   // Calculate additional bit count read to update mBitCount\r
   //\r
   Sd->mBitCount = (UINT16) (Sd->mBitCount - NumOfBits);\r
-  \r
+\r
   //\r
   // Copy NumOfBits of bits from mSubBitBuf into mBitBuf\r
   //\r
@@ -101,7 +101,7 @@ GetBits (
 \r
   //\r
   // Pop NumOfBits of Bits from Left\r
-  //  \r
+  //\r
   OutBits = (UINT32) (Sd->mBitBuf >> (BITBUFSIZ - NumOfBits));\r
 \r
   //\r
@@ -166,7 +166,7 @@ MakeTable (
   for (Index = 0; Index < NumOfChar; Index++) {\r
     Count[BitLen[Index]]++;\r
   }\r
-  \r
+\r
   Start[0] = 0;\r
   Start[1] = 0;\r
 \r
@@ -182,7 +182,7 @@ MakeTable (
   }\r
 \r
   JuBits = (UINT16) (16 - TableBits);\r
-  \r
+\r
   Weight[0] = 0;\r
   for (Index = 1; Index <= TableBits; Index++) {\r
     Start[Index] >>= JuBits;\r
@@ -191,7 +191,7 @@ MakeTable (
 \r
   while (Index <= 16) {\r
     Weight[Index] = (UINT16) (1U << (16 - Index));\r
-    Index++;    \r
+    Index++;\r
   }\r
 \r
   Index = (UINT16) (Start[TableBits + 1] >> JuBits);\r
@@ -232,7 +232,7 @@ MakeTable (
           Sd->mRight[Avail] = Sd->mLeft[Avail] = 0;\r
           *Pointer = Avail++;\r
         }\r
-        \r
+\r
         if (*Pointer < (2 * NC - 1)) {\r
           if ((Index3 & Mask) != 0) {\r
             Pointer = &Sd->mRight[*Pointer];\r
@@ -335,7 +335,7 @@ ReadPTLen (
 \r
   ASSERT (nn <= NPT);\r
   //\r
-  // Read Extra Set Code Length Array size \r
+  // Read Extra Set Code Length Array size\r
   //\r
   Number = (UINT16) GetBits (Sd, nbit);\r
 \r
@@ -360,7 +360,7 @@ ReadPTLen (
 \r
     //\r
     // If a code length is less than 7, then it is encoded as a 3-bit\r
-    // value. Or it is encoded as a series of "1"s followed by a \r
+    // value. Or it is encoded as a series of "1"s followed by a\r
     // terminating "0". The number of "1"s = Code length - 4.\r
     //\r
     if (CharC == 7) {\r
@@ -370,15 +370,15 @@ ReadPTLen (
         CharC += 1;\r
       }\r
     }\r
-    \r
+\r
     FillBuf (Sd, (UINT16) ((CharC < 7) ? 3 : CharC - 3));\r
 \r
     Sd->mPTLen[Index++] = (UINT8) CharC;\r
\r
+\r
     //\r
-    // For Code&Len Set, \r
+    // For Code&Len Set,\r
     // After the third length of the code length concatenation,\r
-    // a 2-bit value is used to indicated the number of consecutive \r
+    // a 2-bit value is used to indicated the number of consecutive\r
     // zero lengths after the third length.\r
     //\r
     if (Index == Special) {\r
@@ -392,7 +392,7 @@ ReadPTLen (
   while (Index < nn && Index < NPT) {\r
     Sd->mPTLen[Index++] = 0;\r
   }\r
-  \r
+\r
   return MakeTable (Sd, nn, Sd->mPTLen, 8, Sd->mPTTable);\r
 }\r
 \r
@@ -504,7 +504,7 @@ DecodeC (
     //\r
     // Starting a new block\r
     // Read BlockSize from block header\r
-    // \r
+    //\r
     Sd->mBlockSize    = (UINT16) GetBits (Sd, 16);\r
 \r
     //\r
@@ -581,7 +581,7 @@ Decode (
   for (;;) {\r
     //\r
     // Get one code from mBitBuf\r
-    // \r
+    //\r
     CharC = DecodeC (Sd);\r
     if (Sd->mBadTableFlag != 0) {\r
       goto Done;\r
@@ -605,7 +605,7 @@ Decode (
       // Process a Pointer\r
       //\r
       CharC       = (UINT16) (CharC - (BIT8 - THRESHOLD));\r
\r
+\r
       //\r
       // Get string length\r
       //\r
@@ -636,18 +636,18 @@ Done:
 }\r
 \r
 /**\r
-  Given a compressed source buffer, this function retrieves the size of \r
-  the uncompressed buffer and the size of the scratch buffer required \r
+  Given a compressed source buffer, this function retrieves the size of\r
+  the uncompressed buffer and the size of the scratch buffer required\r
   to decompress the compressed source buffer.\r
 \r
-  Retrieves the size of the uncompressed buffer and the temporary scratch buffer \r
+  Retrieves the size of the uncompressed buffer and the temporary scratch buffer\r
   required to decompress the buffer specified by Source and SourceSize.\r
   If the size of the uncompressed buffer or the size of the scratch buffer cannot\r
-  be determined from the compressed data specified by Source and SourceData, \r
+  be determined from the compressed data specified by Source and SourceData,\r
   then RETURN_INVALID_PARAMETER is returned.  Otherwise, the size of the uncompressed\r
   buffer is returned in DestinationSize, the size of the scratch buffer is returned\r
   in ScratchSize, and RETURN_SUCCESS is returned.\r
-  This function does not have scratch buffer available to perform a thorough \r
+  This function does not have scratch buffer available to perform a thorough\r
   checking of the validity of the source data.  It just retrieves the "Original Size"\r
   field from the beginning bytes of the source data and output it as DestinationSize.\r
   And ScratchSize is specific to the decompression implementation.\r
@@ -662,16 +662,16 @@ Done:
                           that will be generated when the compressed buffer specified\r
                           by Source and SourceSize is decompressed.\r
   @param  ScratchSize     A pointer to the size, in bytes, of the scratch buffer that\r
-                          is required to decompress the compressed buffer specified \r
+                          is required to decompress the compressed buffer specified\r
                           by Source and SourceSize.\r
 \r
-  @retval  RETURN_SUCCESS The size of the uncompressed data was returned \r
-                          in DestinationSize, and the size of the scratch \r
+  @retval  RETURN_SUCCESS The size of the uncompressed data was returned\r
+                          in DestinationSize, and the size of the scratch\r
                           buffer was returned in ScratchSize.\r
-  @retval  RETURN_INVALID_PARAMETER \r
-                          The size of the uncompressed data or the size of \r
-                          the scratch buffer cannot be determined from \r
-                          the compressed data specified by Source \r
+  @retval  RETURN_INVALID_PARAMETER\r
+                          The size of the uncompressed data or the size of\r
+                          the scratch buffer cannot be determined from\r
+                          the compressed data specified by Source\r
                           and SourceSize.\r
 **/\r
 RETURN_STATUS\r
@@ -710,10 +710,10 @@ UefiDecompressGetInfo (
   Extracts decompressed data to its original form.\r
   This function is designed so that the decompression algorithm can be implemented\r
   without using any memory services.  As a result, this function is not allowed to\r
-  call any memory allocation services in its implementation.  It is the caller's \r
+  call any memory allocation services in its implementation.  It is the caller's\r
   responsibility to allocate and free the Destination and Scratch buffers.\r
-  If the compressed source data specified by Source is successfully decompressed \r
-  into Destination, then RETURN_SUCCESS is returned.  If the compressed source data \r
+  If the compressed source data specified by Source is successfully decompressed\r
+  into Destination, then RETURN_SUCCESS is returned.  If the compressed source data\r
   specified by Source is not in a valid compressed data format,\r
   then RETURN_INVALID_PARAMETER is returned.\r
 \r
@@ -724,13 +724,13 @@ UefiDecompressGetInfo (
   @param  Source      The source buffer containing the compressed data.\r
   @param  Destination The destination buffer to store the decompressed data.\r
   @param  Scratch     A temporary scratch buffer that is used to perform the decompression.\r
-                      This is an optional parameter that may be NULL if the \r
+                      This is an optional parameter that may be NULL if the\r
                       required scratch buffer size is 0.\r
-                     \r
-  @retval  RETURN_SUCCESS Decompression completed successfully, and \r
+\r
+  @retval  RETURN_SUCCESS Decompression completed successfully, and\r
                           the uncompressed buffer is returned in Destination.\r
-  @retval  RETURN_INVALID_PARAMETER \r
-                          The source buffer specified by Source is corrupted \r
+  @retval  RETURN_INVALID_PARAMETER\r
+                          The source buffer specified by Source is corrupted\r
                           (not in a valid compressed format).\r
 **/\r
 RETURN_STATUS\r