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>
/** @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
Dummy malloc function for compiler.\r
**/\r
VOID *\r
Dummy malloc function for compiler.\r
**/\r
VOID *\r
Dummy free function for compiler.\r
**/\r
VOID\r
Dummy free function for compiler.\r
**/\r
VOID\r
@return The size of the uncompressed buffer.\r
**/\r
UINT64\r
@return The size of the uncompressed buffer.\r
**/\r
UINT64\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
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
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
\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
#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
IN size_t Size\r
);\r
\r
VOID\r
IN size_t Size\r
);\r
\r
VOID\r
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
\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 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
+ BrDummyFree(address);\r
}\r
\r
void BrotliDecoderStateInit(BrotliDecoderState* s) {\r
}\r
\r
void BrotliDecoderStateInit(BrotliDecoderState* s) {\r