From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by mx.groups.io with SMTP id smtpd.web10.62.1601573156368877431 for ; Thu, 01 Oct 2020 10:25:56 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@intel.onmicrosoft.com header.s=selector2-intel-onmicrosoft-com header.b=O1863o8v; spf=pass (domain: intel.com, ip: 192.55.52.136, mailfrom: chasel.chiu@intel.com) IronPort-SDR: h1dbqAK9C39+W9FFvRSfv/7PrVb8GPhiX0t6y9I5oIjtfLdgOxDnwDv7558pDdX9hTL2oPOEB/ fqGroN/JOlCA== X-IronPort-AV: E=McAfee;i="6000,8403,9761"; a="142187352" X-IronPort-AV: E=Sophos;i="5.77,324,1596524400"; d="scan'208";a="142187352" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Oct 2020 10:25:55 -0700 IronPort-SDR: /Gx2nZJsLgUXu0AiQ5nvsdaaFfPcBziaFZQoIrJb8kVHQx4QHIgP3Mj/vCZgFLUtIeoiXJczPQ L9Uw2Iiwvklg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.77,324,1596524400"; d="scan'208";a="385610442" Received: from orsmsx606.amr.corp.intel.com ([10.22.229.19]) by orsmga001.jf.intel.com with ESMTP; 01 Oct 2020 10:25:55 -0700 Received: from orsmsx601.amr.corp.intel.com (10.22.229.14) by ORSMSX606.amr.corp.intel.com (10.22.229.19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Thu, 1 Oct 2020 10:25:55 -0700 Received: from ORSEDG602.ED.cps.intel.com (10.7.248.7) by orsmsx601.amr.corp.intel.com (10.22.229.14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5 via Frontend Transport; Thu, 1 Oct 2020 10:25:55 -0700 Received: from NAM11-DM6-obe.outbound.protection.outlook.com (104.47.57.171) by edgegateway.intel.com (134.134.137.103) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.1713.5; Thu, 1 Oct 2020 10:25:33 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=SYi4Fzo3ZPdh0Ob+F4XpcLZ6kKOXeQF4GWrvcLgvGGs+DrLq6Eou55+6dVb9IakgwPhnPFzbQANYl6oCgDJievOBlPqzsuLFlYvT6Yyikr80RxoFJyqg829lxjQgtacoa+6di0ZoJYHtjVOYHa6wlIZDzyT6d6mwk+ZlZP9rUG0kiJCVGnpRxFkJkhiu33vBzvYbOd6HAHjnLuSbpuZQD2+9Ad5z4IzxTmSilRJyEg22R3JdXOlpRyfpkMRfzjKtfO42rlZgEKKaHkcTqtSYW8clMAm1D42hrhzCB5KSeYNRGj3ea9z6QgJtw2x5Rv+SL0Iqz875UghVuFDLe3msiw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=/1g0n3OqL3TwQjfNEzLyv8y75M6kvG/HQ+bUYihkMf4=; b=HTR1V0dT/W0R7nuMzwx8W01rREF1ZrnkHZRu1EUUFN9/g3iytXIEK0XXKV/9dsXflEvcouLIq8biHyJoQhIyOy0ZiIdW0qYn6lttH/ps2t+Vyzu1D/Hjrt66FYj37vS2F2Jd+/IIohK5+Kk+umiqC26bccY107iYhsz20aZa1FpbAI7LIGg7fAIDkBWt4uKLQ2C9+ybE1c6/i/8D2ZypqEcEjnTvbKjrbuw3johPmlgNuNWx4P1JV/EScoMWSt4hUfzckTeshTuZwtV7lHPr8RXSvQ2njbDgKzn10eDjihBj6ttXkVzlCSSLs0pWPaZow1adAx3+PMLdxzilG87Xzw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.onmicrosoft.com; s=selector2-intel-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=/1g0n3OqL3TwQjfNEzLyv8y75M6kvG/HQ+bUYihkMf4=; b=O1863o8v4ZYs32Eg8Kk+2ttCReEuA65lZ1faPLcQ04uCNNtXyP/bMvT0kjR02LRqn103/REYQeI72Nrs7JeuaiyyYAWNdhYM18KZiojj9Dy3aMj4xJ866G2jO4kO29zkOGNBh0+ogXPBDw47Py/gD+WB+s5OVB6nYlYBBVXI3oM= Received: from SN6PR11MB2814.namprd11.prod.outlook.com (2603:10b6:805:55::15) by SN6PR11MB2559.namprd11.prod.outlook.com (2603:10b6:805:57::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3370.16; Thu, 1 Oct 2020 17:25:31 +0000 Received: from SN6PR11MB2814.namprd11.prod.outlook.com ([fe80::4540:a6b5:b0bc:9d82]) by SN6PR11MB2814.namprd11.prod.outlook.com ([fe80::4540:a6b5:b0bc:9d82%4]) with mapi id 15.20.3433.035; Thu, 1 Oct 2020 17:25:31 +0000 From: "Chiu, Chasel" To: "Desimone, Nathaniel L" , "devel@edk2.groups.io" CC: Liming Gao , "Dong, Eric" Subject: Re: [edk2-platforms] [PATCH V1 2/2] MinPlatformPkg: Coding style cleanups in CompressLib Thread-Topic: [edk2-platforms] [PATCH V1 2/2] MinPlatformPkg: Coding style cleanups in CompressLib Thread-Index: AQHWlr7bJBjqW6AhdEiIR6qqNUYuE6mDAjOQ Date: Thu, 1 Oct 2020 17:25:31 +0000 Message-ID: References: <20200930001529.2212-1-nathaniel.l.desimone@intel.com> <20200930001529.2212-3-nathaniel.l.desimone@intel.com> In-Reply-To: <20200930001529.2212-3-nathaniel.l.desimone@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-reaction: no-action dlp-version: 11.5.1.3 authentication-results: intel.com; dkim=none (message not signed) header.d=none;intel.com; dmarc=none action=none header.from=intel.com; x-originating-ip: [220.129.247.212] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 11db62c8-9dbf-496b-e683-08d8662effbf x-ms-traffictypediagnostic: SN6PR11MB2559: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:1227; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 5JzAs1d/y7wXDzKwclljeGWhrjP8XjebPNqMrIKnkPVoPcGtX528tRhL29FCaOooI+cFcs/IRPViS0bYEtVIGNpYhkuEbnow7X4C/YcfeFWzh+Zna78L/gRsEcLnoXpShi/ERXut6ukEQXjJh6WqjfHK+Vzw1vc+5hpxARoTpqge4JX7ZtYF3AHrXhCxQCm1ycSPUv3cOGwQXzXHheW8JP+IyTm+KWTvXHu20NHBq3E8t+fRDC/4Qg5a74nl2ZPt2c8axJVaNhMyjj5DtOqS4Y+iRDZxFMkAj9yxuK0C4Tpw2Nnh9Xybte6kToGpOkZeB+JKFRalsOedOLM10GCB5LfWUlI1uQtPqMRjCo1cGDecOX3kW1Xq9bNCWXWme3kZmrWzzHCUcjzRdileUxK2mePMo56P6Y6akTzrvIS5D0lNkIjq/IfA5eiV7QYsJvhQ x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SN6PR11MB2814.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(4636009)(39860400002)(376002)(396003)(136003)(346002)(366004)(64756008)(66556008)(30864003)(26005)(66446008)(8676002)(52536014)(110136005)(83380400001)(478600001)(33656002)(76116006)(4326008)(55016002)(66476007)(107886003)(66946007)(186003)(2906002)(7696005)(53546011)(316002)(6506007)(5660300002)(71200400001)(9686003)(8936002)(86362001)(54906003)(14943795004);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata: 3Yt2xSuTQG9yCkhl+e/tVseGR76/JRXHFPIYX9KjlWn47fFzgG9mQ1arGVh/8bAsRLHmDicdqioi/lzTX4CwlBQPd1H/MAqzfcFZDV2MLQUbZZhC6dt3ZJCZFAjIEPVJ7l71CPBVrz4y6GqQ84pbhvZ3tGEZKQozqZYh2Cq7uxOekkgkMKXmbmI9MUDWtZWxgT/PaaQVXv7pVDtt6DlnCPHj8LtzuHVEDwkpWEdgHG0xMoEQWq1ZjSqBBQbe6euo4LbFHO1/H04p5yiQTeAW9FPd2yqhMq9G+bwvn04ZXPN02ZoElrm2inqtiz8OwCXin56Lb/2kDIhnMEeQ9TLdnCPx1sUdz4xeFMfF4gpk7rgH6bAGxZtYqgScbZ2E78QhxctnOd5/YovqrnmHVDEYQ1nWBVlhlwhWOtW8xJzEY3TYSpMf0ShW7XrvJy7Mtg1aOecCz24ErRDQsyikFrhA5YzGx5sTgxcSgPBukMyiIluBsnjeNqZLFR174YTItfnB/o81O5uZccPjiwyDTJUTEwGI2oIqAiNCKZAsIlByPiPf/fiT6V/E/LmkqVYFJMqMcIZR+fiQb0vJznwpOHq9yWqg2JJHNcqWLBtqUjY58Vb1jhAvH0vd48tbiUdKCtl/2iIpldtIoXnmxSqGdMTWKg== MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: SN6PR11MB2814.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 11db62c8-9dbf-496b-e683-08d8662effbf X-MS-Exchange-CrossTenant-originalarrivaltime: 01 Oct 2020 17:25:31.7131 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: q3rTmAl5I3KuSXQteBPnNC48g1JxALFDyBOg/+lq46cQvZ38DDHA4G6hUAhktkgXM3mr3Q44rZJhRQGLYd6W0g== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN6PR11MB2559 Return-Path: chasel.chiu@intel.com X-OriginatorOrg: intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Chasel Chiu > -----Original Message----- > From: Nate DeSimone > Sent: Wednesday, September 30, 2020 8:15 AM > To: devel@edk2.groups.io > Cc: Chiu, Chasel ; Liming Gao > ; Dong, Eric > Subject: [edk2-platforms] [PATCH V1 2/2] MinPlatformPkg: Coding style > cleanups in CompressLib >=20 > Signed-off-by: Nate DeSimone > Cc: Chasel Chiu > Cc: Nate DeSimone > Cc: Liming Gao > Cc: Eric Dong > --- > .../Library/CompressLib/CompressLib.c | 177 +++++++++--------- > .../Library/CompressLib/CompressLib.inf | 4 +- > 2 files changed, 95 insertions(+), 86 deletions(-) >=20 > diff --git a/Platform/Intel/MinPlatformPkg/Library/CompressLib/CompressLi= b.c > b/Platform/Intel/MinPlatformPkg/Library/CompressLib/CompressLib.c > index 537eb3b693..a9aeea32c1 100644 > --- a/Platform/Intel/MinPlatformPkg/Library/CompressLib/CompressLib.c > +++ b/Platform/Intel/MinPlatformPkg/Library/CompressLib/CompressLib.c > @@ -7,7 +7,7 @@ > This sequence is further divided into Blocks and Huffman codings > are applied to each Block. >=20 > - Copyright (c) 2007 - 2014, Intel Corporation. All rights reserved.
> + Copyright (c) 2007 - 2020, Intel Corporation. All rights > + reserved.
> SPDX-License-Identifier: BSD-2-Clause-Patent >=20 > **/ > @@ -31,7 +31,6 @@ > // Macro Definitions > // > typedef INT16 NODE; > -#define UINT8_MAX 0xff > #define UINT8_BIT 8 > #define THRESHOLD 3 > #define INIT_CRC 0 > @@ -42,7 +41,7 @@ typedef INT16 NODE; > #define PERC_FLAG 0x8000U > #define CODE_BIT 16 > #define NIL 0 > -#define MAX_HASH_VAL (3 * WNDSIZ + (WNDSIZ / 512 + 1) * UINT8_MAX) > +#define MAX_HASH_VAL (3 * WNDSIZ + (WNDSIZ / 512 + 1) * MAX_UINT8) > #define HASH(LoopVar7, LoopVar5) ((LoopVar7) + ((LoopVar5) << (WN= DBIT > - 9)) + WNDSIZ * 2) > #define CRCPOLY 0xA001 > #define UPDATE_CRC(LoopVar5) mCrc =3D mCrcTable[(mCrc ^ (LoopVar5)) = & > 0xFF] ^ (mCrc >> UINT8_BIT) > @@ -50,7 +49,7 @@ typedef INT16 NODE; > // > // C: the Char&Len Set; P: the Position Set; T: the exTra Set // > -#define NC (UINT8_MAX + MAXMATCH + 2 - THRESHOLD) > +#define NC (MAX_UINT8 + MAXMATCH + 2 - THRESHOLD) > #define CBIT 9 > #define NP (WNDBIT + 1) > #define PBIT 4 > @@ -66,13 +65,13 @@ typedef INT16 NODE; > // >=20 > /** > - Put a dword to output stream > + Put a dword to output stream. >=20 > @param[in] Data The dword to put. > **/ > VOID > EFIAPI > -PutDword( > +PutDword ( > IN UINT32 Data > ); >=20 > @@ -110,7 +109,7 @@ STATIC UINT16 *mSortPtr; STATIC UINT16 > mLenCnt[17]; STATIC UINT16 mLeft[2 * NC - 1]; STATIC UINT16 mRight[2 * = NC > - 1]; -STATIC UINT16 mCrcTable[UINT8_MAX + 1]; > +STATIC UINT16 mCrcTable[MAX_UINT8 + 1]; > STATIC UINT16 mCFreq[2 * NC - 1]; > STATIC UINT16 mCCode[NC]; > STATIC UINT16 mPFreq[2 * NP - 1]; > @@ -142,7 +141,7 @@ MakeCrcTable ( >=20 > UINT32 LoopVar4; >=20 > - for (LoopVar1 =3D 0; LoopVar1 <=3D UINT8_MAX; LoopVar1++) { > + for (LoopVar1 =3D 0; LoopVar1 <=3D MAX_UINT8; LoopVar1++) { > LoopVar4 =3D LoopVar1; > for (LoopVar2 =3D 0; LoopVar2 < UINT8_BIT; LoopVar2++) { > if ((LoopVar4 & 1) !=3D 0) { > @@ -186,7 +185,7 @@ PutDword ( >=20 > /** > Allocate memory spaces for data structures used in compression process= . > - > + > @retval EFI_SUCCESS Memory was allocated successfully. > @retval EFI_OUT_OF_RESOURCES A memory allocation failed. > **/ > @@ -197,9 +196,9 @@ AllocateMemory ( > ) > { > mText =3D AllocateZeroPool (WNDSIZ * 2 + MAXMATCH); > - mLevel =3D AllocateZeroPool ((WNDSIZ + UINT8_MAX + 1) * sizeof (*= mLevel)); > - mChildCount =3D AllocateZeroPool ((WNDSIZ + UINT8_MAX + 1) * sizeof > (*mChildCount)); > - mPosition =3D AllocateZeroPool ((WNDSIZ + UINT8_MAX + 1) * sizeof > (*mPosition)); > + mLevel =3D AllocateZeroPool ((WNDSIZ + MAX_UINT8 + 1) * sizeof (*= mLevel)); > + mChildCount =3D AllocateZeroPool ((WNDSIZ + MAX_UINT8 + 1) * sizeof > (*mChildCount)); > + mPosition =3D AllocateZeroPool ((WNDSIZ + MAX_UINT8 + 1) * sizeof > (*mPosition)); > mParent =3D AllocateZeroPool (WNDSIZ * 2 * sizeof (*mParent)); > mPrev =3D AllocateZeroPool (WNDSIZ * 2 * sizeof (*mPrev)); > mNext =3D AllocateZeroPool ((MAX_HASH_VAL + 1) * sizeof (*mNext)= ); > @@ -251,8 +250,8 @@ InitSlide ( > { > NODE LoopVar1; >=20 > - SetMem (mLevel + WNDSIZ, (UINT8_MAX + 1) * sizeof (UINT8), 1); > - SetMem (mPosition + WNDSIZ, (UINT8_MAX + 1) * sizeof (NODE), 0); > + SetMem (mLevel + WNDSIZ, (MAX_UINT8 + 1) * sizeof (UINT8), 1); > + SetMem (mPosition + WNDSIZ, (MAX_UINT8 + 1) * sizeof (NODE), 0); >=20 > SetMem (mParent + WNDSIZ, WNDSIZ * sizeof (NODE), 0); >=20 > @@ -284,7 +283,7 @@ Child ( > { > NODE LoopVar4; >=20 > - LoopVar4 =3D mNext[HASH (LoopVar6, LoopVar5)]; > + LoopVar4 =3D mNext[HASH (LoopVar6, LoopVar5)]; > mParent[NIL] =3D LoopVar6; /* sentinel */ > while (mParent[LoopVar4] !=3D LoopVar6) { > LoopVar4 =3D mNext[LoopVar4]; > @@ -299,6 +298,7 @@ Child ( > @param[in] LoopVar6 The parent node. > @param[in] LoopVar5 The edge character. > @param[in] LoopVar4 The child node. > + > **/ > VOID > EFIAPI > @@ -326,6 +326,7 @@ MakeChild ( > Split a node. >=20 > @param[in] Old The node to split. > + > **/ > VOID > EFIAPI > @@ -340,12 +341,12 @@ Split ( > New =3D mAvail; > mAvail =3D mNext[New]; > mChildCount[New] =3D 0; > - LoopVar10 =3D mPrev[Old]; > + LoopVar10 =3D mPrev[Old]; > mPrev[New] =3D LoopVar10; > - mNext[LoopVar10] =3D New; > - LoopVar10 =3D mNext[Old]; > + mNext[LoopVar10] =3D New; > + LoopVar10 =3D mNext[Old]; > mNext[New] =3D LoopVar10; > - mPrev[LoopVar10] =3D New; > + mPrev[LoopVar10] =3D New; > mParent[New] =3D mParent[Old]; > mLevel[New] =3D (UINT8) mMatchLen; > mPosition[New] =3D mPos; > @@ -414,7 +415,7 @@ InsertNode ( > if (LoopVar4 =3D=3D NIL) { > MakeChild (LoopVar6, LoopVar5, mPos); > mMatchLen =3D 1; > - return ; > + return; > } >=20 > mMatchLen =3D 2; > @@ -426,10 +427,10 @@ InsertNode ( > // > for (;;) { > if (LoopVar4 >=3D WNDSIZ) { > - LoopVar2 =3D MAXMATCH; > + LoopVar2 =3D MAXMATCH; > mMatchPos =3D LoopVar4; > } else { > - LoopVar2 =3D mLevel[LoopVar4]; > + LoopVar2 =3D mLevel[LoopVar4]; > mMatchPos =3D (NODE) (mPosition[LoopVar4] & ~PERC_FLAG); > } >=20 > @@ -437,12 +438,12 @@ InsertNode ( > mMatchPos -=3D WNDSIZ; > } >=20 > - TempString3 =3D &mText[mPos + mMatchLen]; > - TempString2 =3D &mText[mMatchPos + mMatchLen]; > + TempString3 =3D &mText[mPos + mMatchLen]; > + TempString2 =3D &mText[mMatchPos + mMatchLen]; > while (mMatchLen < LoopVar2) { > if (*TempString3 !=3D *TempString2) { > Split (LoopVar4); > - return ; > + return; > } >=20 > mMatchLen++; > @@ -459,20 +460,20 @@ InsertNode ( > LoopVar4 =3D Child (LoopVar6, *TempString3); > if (LoopVar4 =3D=3D NIL) { > MakeChild (LoopVar6, *TempString3, mPos); > - return ; > + return; > } >=20 > mMatchLen++; > } >=20 > LoopVar10 =3D mPrev[LoopVar4]; > - mPrev[mPos] =3D LoopVar10; > + mPrev[mPos] =3D LoopVar10; > mNext[LoopVar10] =3D mPos; > LoopVar10 =3D mNext[LoopVar4]; > - mNext[mPos] =3D LoopVar10; > + mNext[mPos] =3D LoopVar10; > mPrev[LoopVar10] =3D mPos; > - mParent[mPos] =3D LoopVar6; > - mParent[LoopVar4] =3D NIL; > + mParent[mPos] =3D LoopVar6; > + mParent[LoopVar4] =3D NIL; >=20 > // > // Special usage of 'next' > @@ -503,22 +504,22 @@ DeleteNode ( > NODE LoopVar9; >=20 > if (mParent[mPos] =3D=3D NIL) { > - return ; > + return; > } >=20 > LoopVar4 =3D mPrev[mPos]; > - LoopVar11 =3D mNext[mPos]; > + LoopVar11 =3D mNext[mPos]; > mNext[LoopVar4] =3D LoopVar11; > - mPrev[LoopVar11] =3D LoopVar4; > + mPrev[LoopVar11] =3D LoopVar4; > LoopVar4 =3D mParent[mPos]; > - mParent[mPos] =3D NIL; > + mParent[mPos] =3D NIL; > if (LoopVar4 >=3D WNDSIZ) { > - return ; > + return; > } >=20 > mChildCount[LoopVar4]--; > if (mChildCount[LoopVar4] > 1) { > - return ; > + return; > } >=20 > LoopVar10 =3D (NODE) (mPosition[LoopVar4] & ~PERC_FLAG); @@ -529,7 > +530,7 @@ DeleteNode ( > LoopVar11 =3D LoopVar10; > LoopVar6 =3D mParent[LoopVar4]; > LoopVar9 =3D mPosition[LoopVar6]; > - while ((LoopVar9 & PERC_FLAG) !=3D 0){ > + while ((LoopVar9 & PERC_FLAG) !=3D 0) { > LoopVar9 &=3D ~PERC_FLAG; > if (LoopVar9 >=3D mPos) { > LoopVar9 -=3D WNDSIZ; > @@ -558,9 +559,9 @@ DeleteNode ( >=20 > LoopVar11 =3D Child (LoopVar4, mText[LoopVar10 + mLevel[Loop= Var4]]); > LoopVar10 =3D mPrev[LoopVar11]; > - LoopVar9 =3D mNext[LoopVar11]; > + LoopVar9 =3D mNext[LoopVar11]; > mNext[LoopVar10] =3D LoopVar9; > - mPrev[LoopVar9] =3D LoopVar10; > + mPrev[LoopVar9] =3D LoopVar10; > LoopVar10 =3D mPrev[LoopVar4]; > mNext[LoopVar10] =3D LoopVar11; > mPrev[LoopVar11] =3D LoopVar10; > @@ -568,9 +569,9 @@ DeleteNode ( > mPrev[LoopVar10] =3D LoopVar11; > mNext[LoopVar11] =3D LoopVar10; > mParent[LoopVar11] =3D mParent[LoopVar4]; > - mParent[LoopVar4] =3D NIL; > - mNext[LoopVar4] =3D mAvail; > - mAvail =3D LoopVar4; > + mParent[LoopVar4] =3D NIL; > + mNext[LoopVar4] =3D mAvail; > + mAvail =3D LoopVar4; > } >=20 > /** > @@ -580,6 +581,7 @@ DeleteNode ( > @param[in] LoopVar8 The number of bytes to read. >=20 > @return The number of bytes actually read. > + > **/ > INT32 > EFIAPI > @@ -613,6 +615,7 @@ FreadCrc ( >=20 > @retval TRUE The operation was successful. > @retval FALSE The operation failed due to insufficient memory. > + > **/ > BOOLEAN > EFIAPI > @@ -647,12 +650,13 @@ GetNextMatch ( > /** > Send entry LoopVar1 down the queue. >=20 > - @param[in] LoopVar1 The index of the item to move. > + @param[in] Index The index of the item to move. > + > **/ > VOID > EFIAPI > DownHeap ( > - IN INT32 i > + IN INT32 Index > ) > { > INT32 LoopVar1; > @@ -660,10 +664,10 @@ DownHeap ( > INT32 LoopVar2; >=20 > // > - // priority queue: send i-th entry down heap > + // priority queue: send Index-th entry down heap > // > - LoopVar2 =3D mHeap[i]; > - LoopVar1 =3D 2 * i; > + LoopVar2 =3D mHeap[Index]; > + LoopVar1 =3D 2 * Index; > while (LoopVar1 <=3D mHeapSize) { > if (LoopVar1 < mHeapSize && mFreq[mHeap[LoopVar1]] > > mFreq[mHeap[LoopVar1 + 1]]) { > LoopVar1++; > @@ -673,18 +677,19 @@ DownHeap ( > break; > } >=20 > - mHeap[i] =3D mHeap[LoopVar1]; > - i =3D LoopVar1; > - LoopVar1 =3D 2 * i; > + mHeap[Index] =3D mHeap[LoopVar1]; > + Index =3D LoopVar1; > + LoopVar1 =3D 2 * Index; > } >=20 > - mHeap[i] =3D (INT16) LoopVar2; > + mHeap[Index] =3D (INT16) LoopVar2; > } >=20 > /** > Count the number of each code length for a Huffman tree. >=20 > @param[in] LoopVar1 The top node. > + > **/ > VOID > EFIAPI > @@ -758,17 +763,18 @@ MakeLen ( >=20 > /** > Assign code to each symbol based on the code length array. > - > + > @param[in] LoopVar8 The number of symbols. > @param[in] Len The code length array. > @param[out] Code The stores codes for each symbol. > + > **/ > VOID > EFIAPI > MakeCode ( > IN INT32 LoopVar8, > - IN UINT8 Len[ ], > - OUT UINT16 Code[ ] > + IN UINT8 Len[], > + OUT UINT16 Code[] > ) > { > INT32 LoopVar1; > @@ -783,7 +789,7 @@ MakeCode ( > Code[LoopVar1] =3D Start[Len[LoopVar1]]++; > } > } > - > + > /** > Generates Huffman codes given a frequency distribution of symbols. >=20 > @@ -793,14 +799,15 @@ MakeCode ( > @param[out] CodeParm The code for each symbol. >=20 > @return The root of the Huffman tree. > + > **/ > INT32 > EFIAPI > MakeTree ( > IN INT32 NParm, > - IN UINT16 FreqParm[ ], > - OUT UINT8 LenParm[ ], > - OUT UINT16 CodeParm[ ] > + IN UINT16 FreqParm[], > + OUT UINT8 LenParm[], > + OUT UINT16 CodeParm[] > ) > { > INT32 LoopVar1; > @@ -815,11 +822,11 @@ MakeTree ( > // make tree, calculate len[], return root > // > mTempInt32 =3D NParm; > - mFreq =3D FreqParm; > - mLen =3D LenParm; > - Avail =3D mTempInt32; > - mHeapSize =3D 0; > - mHeap[1] =3D 0; > + mFreq =3D FreqParm; > + mLen =3D LenParm; > + Avail =3D mTempInt32; > + mHeapSize =3D 0; > + mHeap[1] =3D 0; > for (LoopVar1 =3D 0; LoopVar1 < mTempInt32; LoopVar1++) { > mLen[LoopVar1] =3D 0; > if ((mFreq[LoopVar1]) !=3D 0) { > @@ -856,7 +863,7 @@ MakeTree ( >=20 > LoopVar3 =3D Avail++; > mFreq[LoopVar3] =3D (UINT16) (mFreq[LoopVar1] + mFreq[LoopVar2]); > - mHeap[1] =3D (INT16) LoopVar3; > + mHeap[1] =3D (INT16) LoopVar3; > DownHeap (1); > mLeft[LoopVar3] =3D (UINT16) LoopVar1; > mRight[LoopVar3] =3D (UINT16) LoopVar2; @@ -877,6 +884,7 @@ MakeTree= ( >=20 > @param[in] LoopVar8 The rightmost LoopVar8 bits of the data is used. > @param[in] x The data. > + > **/ > VOID > EFIAPI > @@ -891,7 +899,7 @@ PutBits ( > mSubBitBuf |=3D x << (mBitCount -=3D LoopVar8); > } else { >=20 > - Temp =3D (UINT8)(mSubBitBuf | (x >> (LoopVar8 -=3D mBitCount))); > + Temp =3D (UINT8) (mSubBitBuf | (x >> (LoopVar8 -=3D mBitCount))); > if (mDst < mDstUpperLimit) { > *mDst++ =3D Temp; > } > @@ -901,7 +909,7 @@ PutBits ( > mSubBitBuf =3D x << (mBitCount =3D UINT8_BIT - LoopVar8); > } else { >=20 > - Temp =3D (UINT8)(x >> (LoopVar8 - UINT8_BIT)); > + Temp =3D (UINT8) (x >> (LoopVar8 - UINT8_BIT)); > if (mDst < mDstUpperLimit) { > *mDst++ =3D Temp; > } > @@ -950,7 +958,7 @@ EncodeP ( >=20 > PutBits (mPTLen[LoopVar5], mPTCode[LoopVar5]); > if (LoopVar5 > 1) { > - PutBits(LoopVar5 - 1, LoopVar7 & (0xFFFFU >> (17 - LoopVar5))); > + PutBits (LoopVar5 - 1, LoopVar7 & (0xFFFFU >> (17 - LoopVar5))); > } > } >=20 > @@ -1057,6 +1065,7 @@ WritePTLen ( >=20 > /** > Outputs the code length array for Char&Length Set. > + > **/ > VOID > EFIAPI > @@ -1136,8 +1145,8 @@ SendBlock ( > UINT32 Size; > Flags =3D 0; >=20 > - Root =3D MakeTree (NC, mCFreq, mCLen, mCCode); > - Size =3D mCFreq[Root]; > + Root =3D MakeTree (NC, mCFreq, mCLen, mCCode); Size =3D mCFreq[Root]; > PutBits (16, Size); > if (Root >=3D NC) { > CountTFreq (); > @@ -1172,8 +1181,8 @@ SendBlock ( > } else { > Flags <<=3D 1; > } > - if ((Flags & (1U << (UINT8_BIT - 1))) !=3D 0){ > - EncodeC(mBuf[Pos++] + (1U << UINT8_BIT)); > + if ((Flags & (1U << (UINT8_BIT - 1))) !=3D 0) { > + EncodeC (mBuf[Pos++] + (1U << UINT8_BIT)); > LoopVar3 =3D mBuf[Pos++] << UINT8_BIT; > LoopVar3 +=3D mBuf[Pos++]; >=20 > @@ -1209,7 +1218,7 @@ HufEncodeStart ( > /** > Outputs an Original Character or a Pointer. >=20 > - @param[in] LoopVar5 The original character or the 'String Length' = element > of > + @param[in] LoopVar5 The original character or the 'String Length' = element > of > a Pointer. > @param[in] LoopVar7 The 'Position' field of a Pointer. > **/ > @@ -1235,11 +1244,11 @@ CompressOutput ( > mBuf[mOutputPos++] =3D (UINT8) LoopVar5; > mCFreq[LoopVar5]++; > if (LoopVar5 >=3D (1U << UINT8_BIT)) { > - mBuf[CPos] =3D (UINT8)(mBuf[CPos]|mOutputMask); > - mBuf[mOutputPos++] =3D (UINT8)(LoopVar7 >> UINT8_BIT); > + mBuf[CPos] =3D (UINT8) (mBuf[CPos]|mOutputMask); > + mBuf[mOutputPos++] =3D (UINT8) (LoopVar7 >> UINT8_BIT); > mBuf[mOutputPos++] =3D (UINT8) LoopVar7; > - LoopVar5 =3D 0; > - while (LoopVar7!=3D0) { > + LoopVar5 =3D 0; > + while (LoopVar7 !=3D 0) { > LoopVar7 >>=3D 1; > LoopVar5++; > } > @@ -1301,8 +1310,8 @@ Encode ( > } >=20 > while (mRemainder > 0) { > - LastMatchLen =3D mMatchLen; > - LastMatchPos =3D mMatchPos; > + LastMatchLen =3D mMatchLen; > + LastMatchPos =3D mMatchPos; > if (!GetNextMatch ()) { > Status =3D EFI_OUT_OF_RESOURCES; > } > @@ -1315,14 +1324,14 @@ Encode ( > // Not enough benefits are gained by outputting a pointer, > // so just output the original character > // > - CompressOutput(mText[mPos - 1], 0); > + CompressOutput (mText[mPos - 1], 0); > } else { > // > // Outputting a pointer is beneficial enough, do it. > // >=20 > - CompressOutput(LastMatchLen + (UINT8_MAX + 1 - THRESHOLD), > - (mPos - LastMatchPos - 2) & (WNDSIZ - 1)); > + CompressOutput (LastMatchLen + (MAX_UINT8 + 1 - THRESHOLD), > + (mPos - LastMatchPos - 2) & (WNDSIZ - 1)); > LastMatchLen--; > while (LastMatchLen > 0) { > if (!GetNextMatch ()) { > @@ -1381,15 +1390,15 @@ Compress ( > mSrc =3D SrcBuffer; > mSrcUpperLimit =3D mSrc + SrcSize; > mDst =3D DstBuffer; > - mDstUpperLimit =3D mDst +*DstSize; > + mDstUpperLimit =3D mDst + *DstSize; >=20 > PutDword (0L); > PutDword (0L); >=20 > MakeCrcTable (); >=20 > - mOrigSize =3D mCompSize =3D 0; > - mCrc =3D INIT_CRC; > + mOrigSize =3D mCompSize =3D 0; > + mCrc =3D INIT_CRC; >=20 > // > // Compress it > diff --git > a/Platform/Intel/MinPlatformPkg/Library/CompressLib/CompressLib.inf > b/Platform/Intel/MinPlatformPkg/Library/CompressLib/CompressLib.inf > index 6a8ac3c588..4e069246d0 100644 > --- a/Platform/Intel/MinPlatformPkg/Library/CompressLib/CompressLib.inf > +++ b/Platform/Intel/MinPlatformPkg/Library/CompressLib/CompressLib.inf > @@ -1,7 +1,7 @@ > ## @file > -# UEFI Decompress Library implementation. > +# UEFI Compression Library implementation. > # > -# Copyright (c) 2007 - 2014, Intel Corporation. All rights reserved. > +# Copyright (c) 2007 - 2020, Intel Corporation. All rights > +reserved.
> # > # SPDX-License-Identifier: BSD-2-Clause-Patent # > -- > 2.27.0.windows.1