]> git.proxmox.com Git - mirror_edk2.git/blobdiff - IntelFrameworkModulePkg/Library/LzmaCustomDecompressLib/LzmaDecompress.c
Update the copyright notice format
[mirror_edk2.git] / IntelFrameworkModulePkg / Library / LzmaCustomDecompressLib / LzmaDecompress.c
index dd08008258919b3e99767ffcf7c1fed3b502f6c1..e32b6a3025b07f39a485e62dfc8917293ab4e6e5 100644 (file)
@@ -1,8 +1,8 @@
 /** @file\r
   LZMA Decompress interfaces\r
 \r
-  Copyright (c) 2009, Intel Corporation<BR>\r
-  All rights reserved. This program and the accompanying materials\r
+  Copyright (c) 2009 - 2010, Intel Corporation. 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
@@ -41,7 +41,9 @@ SzAlloc (
   )\r
 {\r
   VOID *Addr;\r
-  ISzAllocWithData *Private = (ISzAllocWithData*) P;\r
+  ISzAllocWithData *Private;\r
+\r
+  Private = (ISzAllocWithData*) P;\r
 \r
   if (Private->BufferSize >= Size) {\r
     Addr = Private->Buffer;\r
@@ -162,6 +164,7 @@ LzmaUefiDecompressGetInfo (
   then RETURN_INVALID_PARAMETER is returned.\r
 \r
   @param  Source      The source buffer containing the compressed data.\r
+  @param  SourceSize  The size of source buffer.\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
@@ -182,17 +185,18 @@ LzmaUefiDecompress (
   IN OUT VOID    *Scratch\r
   )\r
 {\r
-  SRes        LzmaResult;\r
-  ELzmaStatus Status;\r
-  SizeT       DecodedBufSize;\r
-  SizeT       EncodedDataSize;\r
-  ISzAllocWithData AllocFuncs = {\r
-    { SzAlloc, SzFree },\r
-    Scratch,\r
-    SCRATCH_BUFFER_REQUEST_SIZE\r
-    };\r
-\r
-  DecodedBufSize = GetDecodedSizeOfBuf((UINT8*)Source);\r
+  SRes              LzmaResult;\r
+  ELzmaStatus       Status;\r
+  SizeT             DecodedBufSize;\r
+  SizeT             EncodedDataSize;\r
+  ISzAllocWithData  AllocFuncs;\r
+\r
+  AllocFuncs.Functions.Alloc  = SzAlloc;\r
+  AllocFuncs.Functions.Free   = SzFree;\r
+  AllocFuncs.Buffer           = Scratch;\r
+  AllocFuncs.BufferSize       = SCRATCH_BUFFER_REQUEST_SIZE;\r
+  \r
+  DecodedBufSize = (SizeT)GetDecodedSizeOfBuf((UINT8*)Source);\r
   EncodedDataSize = (SizeT) (SourceSize - LZMA_HEADER_SIZE);\r
 \r
   LzmaResult = LzmaDecode(\r
@@ -204,7 +208,7 @@ LzmaUefiDecompress (
     LZMA_PROPS_SIZE,\r
     LZMA_FINISH_END,\r
     &Status,\r
-    (ISzAlloc*) &AllocFuncs\r
+    &(AllocFuncs.Functions)\r
     );\r
 \r
   if (LzmaResult == SZ_OK) {\r