]> git.proxmox.com Git - mirror_edk2.git/commitdiff
MdeModulePkg BrotliLib: Rename function with the specific lib name
authorLiming Gao <liming.gao@intel.com>
Tue, 13 Mar 2018 07:58:21 +0000 (15:58 +0800)
committerLiming Gao <liming.gao@intel.com>
Fri, 16 Mar 2018 06:34:43 +0000 (14:34 +0800)
This change is to avoid the function conflict.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Liming Gao <liming.gao@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
MdeModulePkg/Library/BrotliCustomDecompressLib/BrotliDecompress.c
MdeModulePkg/Library/BrotliCustomDecompressLib/BrotliDecompressLibInternal.h
MdeModulePkg/Library/BrotliCustomDecompressLib/dec/decode.c
MdeModulePkg/Library/BrotliCustomDecompressLib/dec/state.c

index a30392148f94dcb1f573cdbd03189d61c62d054e..4b10b409761cd74ac03c8868ab85be2fc867ee35 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   Brotli Decompress interfaces\r
 \r
 /** @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
   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
   Dummy malloc function for compiler.\r
 **/\r
 VOID *\r
-malloc (\r
+BrDummyMalloc (\r
   IN size_t    Size\r
   )\r
 {\r
   IN size_t    Size\r
   )\r
 {\r
@@ -29,7 +29,7 @@ malloc (
   Dummy free function for compiler.\r
 **/\r
 VOID\r
   Dummy free function for compiler.\r
 **/\r
 VOID\r
-free (\r
+BrDummyFree (\r
   IN VOID *    Ptr\r
   )\r
 {\r
   IN VOID *    Ptr\r
   )\r
 {\r
@@ -198,7 +198,7 @@ BrotliDecompress (
   @return The size of the uncompressed buffer.\r
 **/\r
 UINT64\r
   @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
   IN UINT8 *  EncodedData,\r
   IN UINT8    StartOffset,\r
   IN UINT8    EndOffset\r
@@ -259,10 +259,10 @@ BrotliUefiDecompressGetInfo (
   ASSERT(SourceSize >= BROTLI_SCRATCH_MAX);\r
 \r
   MaxOffset = BROTLI_DECODE_MAX;\r
   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
   *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
   *ScratchSize = (UINT32)GetSize;\r
   return EFI_SUCCESS;\r
 }\r
@@ -305,7 +305,7 @@ BrotliUefiDecompress (
   UINT8          MaxOffset;\r
 \r
   MaxOffset = BROTLI_SCRATCH_MAX;\r
   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
 \r
   BroBuff.Buff     = Scratch;\r
   BroBuff.BuffSize = (UINTN)GetSize;\r
index c2d84a80af7d27410bc6353ad97859d8fd41d71e..0aca7636aa8933ebb49799c3d49c4c15d69da31a 100644 (file)
@@ -3,7 +3,7 @@
 \r
   Allows BROTLI code to build under UEFI (edk2) build environment\r
 \r
 \r
   Allows BROTLI code to build under UEFI (edk2) build environment\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
   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
@@ -41,12 +41,12 @@ typedef struct
 #define memset(dest,ch,count)       SetMem(dest,(UINTN)(count),(UINT8)(ch))\r
 \r
 VOID *\r
 #define memset(dest,ch,count)       SetMem(dest,(UINTN)(count),(UINT8)(ch))\r
 \r
 VOID *\r
-malloc (\r
+BrDummyMalloc (\r
   IN size_t   Size\r
   );\r
 \r
 VOID\r
   IN size_t   Size\r
   );\r
 \r
 VOID\r
-free (\r
+BrDummyFree (\r
   IN VOID *   Ptr\r
   );\r
 \r
   IN VOID *   Ptr\r
   );\r
 \r
index 6557ba67d56b6fb043a3bc30e3391b72e3a2ec64..3bee3e71fe0340c6680b30597d86a89c98ed04d1 100644 (file)
@@ -56,7 +56,7 @@ BrotliDecoderState* BrotliDecoderCreateInstance(
     brotli_alloc_func alloc_func, brotli_free_func free_func, void* opaque) {\r
   BrotliDecoderState* state = 0;\r
   if (!alloc_func && !free_func) {\r
     brotli_alloc_func alloc_func, brotli_free_func free_func, void* opaque) {\r
   BrotliDecoderState* state = 0;\r
   if (!alloc_func && !free_func) {\r
-    state = (BrotliDecoderState*)malloc(sizeof(BrotliDecoderState));\r
+    state = (BrotliDecoderState*)BrDummyMalloc(sizeof(BrotliDecoderState));\r
   } else if (alloc_func && free_func) {\r
     state = (BrotliDecoderState*)alloc_func(opaque, sizeof(BrotliDecoderState));\r
   }\r
   } else if (alloc_func && free_func) {\r
     state = (BrotliDecoderState*)alloc_func(opaque, sizeof(BrotliDecoderState));\r
   }\r
index e7e5e3cc72f6d0ae99e6f97abbf752ba5b00014d..dbe4a363e30ae24f1f2a1b5a8de2aae1ee2bb7cb 100644 (file)
@@ -18,12 +18,12 @@ extern "C" {
 \r
 static void* DefaultAllocFunc(void* opaque, size_t size) {\r
   BROTLI_UNUSED(opaque);\r
 \r
 static void* DefaultAllocFunc(void* opaque, size_t size) {\r
   BROTLI_UNUSED(opaque);\r
-  return malloc(size);\r
+  return BrDummyMalloc(size);\r
 }\r
 \r
 static void DefaultFreeFunc(void* opaque, void* address) {\r
   BROTLI_UNUSED(opaque);\r
 }\r
 \r
 static void DefaultFreeFunc(void* opaque, void* address) {\r
   BROTLI_UNUSED(opaque);\r
-  free(address);\r
+  BrDummyFree(address);\r
 }\r
 \r
 void BrotliDecoderStateInit(BrotliDecoderState* s) {\r
 }\r
 \r
 void BrotliDecoderStateInit(BrotliDecoderState* s) {\r