]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Library/BrotliCustomDecompressLib/BrotliDecompress.c
MdeModulePkg BrotliLib: Rename function with the specific lib name
[mirror_edk2.git] / MdeModulePkg / Library / BrotliCustomDecompressLib / BrotliDecompress.c
index 2c2648a83d5899fa4d99aee10b5b49866a26dbfa..4b10b409761cd74ac03c8868ab85be2fc867ee35 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   Brotli Decompress interfaces\r
 \r
-  Copyright (c) 2017, Intel Corporation. All rights reserved.<BR>\r
+  Copyright (c) 2017 - 2018, 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
@@ -17,7 +17,7 @@
   Dummy malloc function for compiler.\r
 **/\r
 VOID *\r
-malloc (\r
+BrDummyMalloc (\r
   IN size_t    Size\r
   )\r
 {\r
@@ -29,7 +29,7 @@ malloc (
   Dummy free function for compiler.\r
 **/\r
 VOID\r
-free (\r
+BrDummyFree (\r
   IN VOID *    Ptr\r
   )\r
 {\r
@@ -126,6 +126,7 @@ BrotliDecompress (
   BrotliState *  BroState;\r
   VOID *         Temp;\r
 \r
+  TotalOut = 0;\r
   AvailableOut = FILE_BUFFER_SIZE;\r
   Result = BROTLI_RESULT_ERROR;\r
   BroState = BrotliCreateState(BrAlloc, BrFree, BuffInfo);\r
@@ -197,7 +198,7 @@ BrotliDecompress (
   @return The size of the uncompressed buffer.\r
 **/\r
 UINT64\r
-GetDecodedSizeOfBuf(\r
+BrGetDecodedSizeOfBuf(\r
   IN UINT8 *  EncodedData,\r
   IN UINT8    StartOffset,\r
   IN UINT8    EndOffset\r
@@ -258,10 +259,10 @@ BrotliUefiDecompressGetInfo (
   ASSERT(SourceSize >= BROTLI_SCRATCH_MAX);\r
 \r
   MaxOffset = BROTLI_DECODE_MAX;\r
-  GetSize = GetDecodedSizeOfBuf((UINT8 *)Source, MaxOffset - BROTLI_INFO_SIZE, MaxOffset);\r
+  GetSize = BrGetDecodedSizeOfBuf((UINT8 *)Source, MaxOffset - BROTLI_INFO_SIZE, MaxOffset);\r
   *DestinationSize = (UINT32)GetSize;\r
   MaxOffset = BROTLI_SCRATCH_MAX;\r
-  GetSize = GetDecodedSizeOfBuf((UINT8 *)Source, MaxOffset - BROTLI_INFO_SIZE, MaxOffset);\r
+  GetSize = BrGetDecodedSizeOfBuf((UINT8 *)Source, MaxOffset - BROTLI_INFO_SIZE, MaxOffset);\r
   *ScratchSize = (UINT32)GetSize;\r
   return EFI_SUCCESS;\r
 }\r
@@ -304,7 +305,7 @@ BrotliUefiDecompress (
   UINT8          MaxOffset;\r
 \r
   MaxOffset = BROTLI_SCRATCH_MAX;\r
-  GetSize = GetDecodedSizeOfBuf((UINT8 *)Source, MaxOffset - BROTLI_INFO_SIZE, MaxOffset);\r
+  GetSize = BrGetDecodedSizeOfBuf((UINT8 *)Source, MaxOffset - BROTLI_INFO_SIZE, MaxOffset);\r
 \r
   BroBuff.Buff     = Scratch;\r
   BroBuff.BuffSize = (UINTN)GetSize;\r