]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdePkg/Library/BaseUefiDecompressLib/BaseUefiDecompressLib.c
Minor grammatical work--mostly adding periods. Items with ONLY period added did...
[mirror_edk2.git] / MdePkg / Library / BaseUefiDecompressLib / BaseUefiDecompressLib.c
index e3c5d0c45e2ea6543e009e47d3db0963c26c0975..cd5d8c8d8ba887bd4b6543bcae5abe2ad8fb8fdc 100644 (file)
@@ -1,11 +1,12 @@
 /** @file\r
   UEFI Decompress Library implementation refer to UEFI specification.\r
 \r
-  Copyright (c) 2006 - 2008, Intel Corporation\r
-  All rights reserved. This program and the accompanying materials\r
+  Copyright (c) 2006 - 2010, 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
   which accompanies this distribution.  The full text of the license may be found at\r
-  http://opensource.org/licenses/bsd-license.php\r
+  http://opensource.org/licenses/bsd-license.php.\r
 \r
   THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
   WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
@@ -116,9 +117,10 @@ GetBits (
 \r
   Creates Huffman Code mapping table for Extra Set, Char&Len Set\r
   and Position Set according to code length array.\r
+  If TableBits > 16, then ASSERT ().\r
 \r
   @param  Sd        The global scratch data\r
-  @param  NumOfChar Number of symbols in the symbol set\r
+  @param  NumOfChar The number of symbols in the symbol set\r
   @param  BitLen    Code length array\r
   @param  TableBits The width of the mapping table\r
   @param  Table     The table to be created.\r
@@ -151,6 +153,11 @@ MakeTable (
   UINT16  WordOfStart;\r
   UINT16  WordOfCount;\r
 \r
+  //\r
+  // The maximum mapping table width supported by this internal\r
+  // working function is 16.\r
+  //\r
+  ASSERT (TableBits <= 16);\r
 \r
   for (Index = 0; Index <= 16; Index++) {\r
     Count[Index] = 0;\r
@@ -305,8 +312,8 @@ DecodeP (
   generate the Huffman code mapping for them.\r
 \r
   @param  Sd      The global scratch data.\r
-  @param  nn      Number of symbols.\r
-  @param  nbit    Number of bits needed to represent nn.\r
+  @param  nn      The number of symbols.\r
+  @param  nbit    The number of bits needed to represent nn.\r
   @param  Special The special symbol that needs to be taken care of.\r
 \r
   @retval  0 OK.\r
@@ -337,9 +344,7 @@ ReadPTLen (
     //\r
     CharC = (UINT16) GetBits (Sd, nbit);\r
 \r
-    for (Index = 0; Index < 256; Index++) {\r
-      Sd->mPTTable[Index] = CharC;\r
-    }\r
+    SetMem16 (&Sd->mPTTable[0] , sizeof (Sd->mPTTable), CharC);\r
 \r
     SetMem (Sd->mPTLen, nn, 0);\r
 \r
@@ -418,10 +423,7 @@ ReadCLen (
     CharC = (UINT16) GetBits (Sd, CBIT);\r
 \r
     SetMem (Sd->mCLen, NC, 0);\r
-\r
-    for (Index = 0; Index < 4096; Index++) {\r
-      Sd->mCTable[Index] = CharC;\r
-    }\r
+    SetMem16 (&Sd->mCTable[0], sizeof (Sd->mCTable), CharC);\r
 \r
     return ;\r
   }\r