From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=134.134.136.24; helo=mga09.intel.com; envelope-from=star.zeng@intel.com; receiver=edk2-devel@lists.01.org Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 5B082223FCF30 for ; Thu, 15 Mar 2018 23:04:00 -0700 (PDT) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 15 Mar 2018 23:10:24 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.48,313,1517904000"; d="scan'208";a="208729418" Received: from fmsmsx108.amr.corp.intel.com ([10.18.124.206]) by orsmga005.jf.intel.com with ESMTP; 15 Mar 2018 23:10:24 -0700 Received: from fmsmsx120.amr.corp.intel.com (10.18.124.208) by FMSMSX108.amr.corp.intel.com (10.18.124.206) with Microsoft SMTP Server (TLS) id 14.3.319.2; Thu, 15 Mar 2018 23:10:24 -0700 Received: from shsmsx103.ccr.corp.intel.com (10.239.4.69) by fmsmsx120.amr.corp.intel.com (10.18.124.208) with Microsoft SMTP Server (TLS) id 14.3.319.2; Thu, 15 Mar 2018 23:10:24 -0700 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.80]) by SHSMSX103.ccr.corp.intel.com ([169.254.4.235]) with mapi id 14.03.0319.002; Fri, 16 Mar 2018 14:10:22 +0800 From: "Zeng, Star" To: "Gao, Liming" , "edk2-devel@lists.01.org" CC: "Zeng, Star" Thread-Topic: [Patch] MdeModulePkg BrotliLib: Rename function with the specific lib name Thread-Index: AQHTuqEiEO0XMzMZPUeGDCzlgL8B56PSZY5w Date: Fri, 16 Mar 2018 06:10:20 +0000 Message-ID: <0C09AFA07DD0434D9E2A0C6AEB0483103BA6A69C@shsmsx102.ccr.corp.intel.com> References: <1520927901-9724-1-git-send-email-liming.gao@intel.com> In-Reply-To: <1520927901-9724-1-git-send-email-liming.gao@intel.com> Accept-Language: zh-CN, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Subject: Re: [Patch] MdeModulePkg BrotliLib: Rename function with the specific lib name X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Mar 2018 06:04:00 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Star Zeng Thanks, Star -----Original Message----- From: Gao, Liming=20 Sent: Tuesday, March 13, 2018 3:58 PM To: edk2-devel@lists.01.org Cc: Zeng, Star Subject: [Patch] MdeModulePkg BrotliLib: Rename function with the specific = lib name This change is to avoid the function conflict. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Liming Gao Cc: Star Zeng --- .../Library/BrotliCustomDecompressLib/BrotliDecompress.c | 14 +++++++---= ---- .../BrotliDecompressLibInternal.h | 6 +++--- .../Library/BrotliCustomDecompressLib/dec/decode.c | 2 +- MdeModulePkg/Library/BrotliCustomDecompressLib/dec/state.c | 4 ++-- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/MdeModulePkg/Library/BrotliCustomDecompressLib/BrotliDecompres= s.c b/MdeModulePkg/Library/BrotliCustomDecompressLib/BrotliDecompress.c index a303921..4b10b40 100644 --- a/MdeModulePkg/Library/BrotliCustomDecompressLib/BrotliDecompress.c +++ b/MdeModulePkg/Library/BrotliCustomDecompressLib/BrotliDecompress.c @@ -1,7 +1,7 @@ /** @file Brotli Decompress interfaces =20 - Copyright (c) 2017, Intel Corporation. All rights reserved.
+ Copyright (c) 2017 - 2018, Intel Corporation. All rights=20 + reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BS= D License which accompanies this distribution. The full text of the license may b= e found at @@ -17,7 +17,7 @@ Dummy malloc function for compiler. **/ VOID * -malloc ( +BrDummyMalloc ( IN size_t Size ) { @@ -29,7 +29,7 @@ malloc ( Dummy free function for compiler. **/ VOID -free ( +BrDummyFree ( IN VOID * Ptr ) { @@ -198,7 +198,7 @@ BrotliDecompress ( @return The size of the uncompressed buffer. **/ UINT64 -GetDecodedSizeOfBuf( +BrGetDecodedSizeOfBuf( IN UINT8 * EncodedData, IN UINT8 StartOffset, IN UINT8 EndOffset @@ -259,10 +259,10 @@ BrotliUefiDecompressGetInfo ( ASSERT(SourceSize >=3D BROTLI_SCRATCH_MAX); =20 MaxOffset =3D BROTLI_DECODE_MAX; - GetSize =3D GetDecodedSizeOfBuf((UINT8 *)Source, MaxOffset - BROTLI_INFO= _SIZE, MaxOffset); + GetSize =3D BrGetDecodedSizeOfBuf((UINT8 *)Source, MaxOffset -=20 + BROTLI_INFO_SIZE, MaxOffset); *DestinationSize =3D (UINT32)GetSize; MaxOffset =3D BROTLI_SCRATCH_MAX; - GetSize =3D GetDecodedSizeOfBuf((UINT8 *)Source, MaxOffset - BROTLI_INFO= _SIZE, MaxOffset); + GetSize =3D BrGetDecodedSizeOfBuf((UINT8 *)Source, MaxOffset -=20 + BROTLI_INFO_SIZE, MaxOffset); *ScratchSize =3D (UINT32)GetSize; return EFI_SUCCESS; } @@ -305,7 +305,7 @@ BrotliUefiDecompress ( UINT8 MaxOffset; =20 MaxOffset =3D BROTLI_SCRATCH_MAX; - GetSize =3D GetDecodedSizeOfBuf((UINT8 *)Source, MaxOffset - BROTLI_INFO= _SIZE, MaxOffset); + GetSize =3D BrGetDecodedSizeOfBuf((UINT8 *)Source, MaxOffset -=20 + BROTLI_INFO_SIZE, MaxOffset); =20 BroBuff.Buff =3D Scratch; BroBuff.BuffSize =3D (UINTN)GetSize; diff --git a/MdeModulePkg/Library/BrotliCustomDecompressLib/BrotliDecompres= sLibInternal.h b/MdeModulePkg/Library/BrotliCustomDecompressLib/BrotliDecom= pressLibInternal.h index c2d84a8..0aca763 100644 --- a/MdeModulePkg/Library/BrotliCustomDecompressLib/BrotliDecompressLibInt= ernal.h +++ b/MdeModulePkg/Library/BrotliCustomDecompressLib/BrotliDecompressLib +++ Internal.h @@ -3,7 +3,7 @@ =20 Allows BROTLI code to build under UEFI (edk2) build environment =20 - Copyright (c) 2017, Intel Corporation. All rights reserved.
+ Copyright (c) 2017 - 2018, Intel Corporation. All rights=20 + reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BS= D License which accompanies this distribution. The full text of the license may b= e found at @@ -41,12 +41,12 @@ typedef struct #define memset(dest,ch,count) SetMem(dest,(UINTN)(count),(UINT8)(ch)= ) =20 VOID * -malloc ( +BrDummyMalloc ( IN size_t Size ); =20 VOID -free ( +BrDummyFree ( IN VOID * Ptr ); =20 diff --git a/MdeModulePkg/Library/BrotliCustomDecompressLib/dec/decode.c b/= MdeModulePkg/Library/BrotliCustomDecompressLib/dec/decode.c index 6557ba6..3bee3e7 100644 --- a/MdeModulePkg/Library/BrotliCustomDecompressLib/dec/decode.c +++ b/MdeModulePkg/Library/BrotliCustomDecompressLib/dec/decode.c @@ -56,7 +56,7 @@ BrotliDecoderState* BrotliDecoderCreateInstance( brotli_alloc_func alloc_func, brotli_free_func free_func, void* opaque= ) { BrotliDecoderState* state =3D 0; if (!alloc_func && !free_func) { - state =3D (BrotliDecoderState*)malloc(sizeof(BrotliDecoderState)); + state =3D=20 + (BrotliDecoderState*)BrDummyMalloc(sizeof(BrotliDecoderState)); } else if (alloc_func && free_func) { state =3D (BrotliDecoderState*)alloc_func(opaque, sizeof(BrotliDecoder= State)); } diff --git a/MdeModulePkg/Library/BrotliCustomDecompressLib/dec/state.c b/M= deModulePkg/Library/BrotliCustomDecompressLib/dec/state.c index e7e5e3c..dbe4a36 100644 --- a/MdeModulePkg/Library/BrotliCustomDecompressLib/dec/state.c +++ b/MdeModulePkg/Library/BrotliCustomDecompressLib/dec/state.c @@ -18,12 +18,12 @@ extern "C" { =20 static void* DefaultAllocFunc(void* opaque, size_t size) { BROTLI_UNUSED(opaque); - return malloc(size); + return BrDummyMalloc(size); } =20 static void DefaultFreeFunc(void* opaque, void* address) { BROTLI_UNUSED(opaque); - free(address); + BrDummyFree(address); } =20 void BrotliDecoderStateInit(BrotliDecoderState* s) { -- 2.8.0.windows.1