From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: intel.com, ip: 134.134.136.20, mailfrom: liming.gao@intel.com) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by groups.io with SMTP; Sun, 29 Sep 2019 22:17:28 -0700 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 29 Sep 2019 22:17:27 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,565,1559545200"; d="scan'208";a="197437280" Received: from fmsmsx106.amr.corp.intel.com ([10.18.124.204]) by FMSMGA003.fm.intel.com with ESMTP; 29 Sep 2019 22:17:27 -0700 Received: from fmsmsx601.amr.corp.intel.com (10.18.126.81) by FMSMSX106.amr.corp.intel.com (10.18.124.204) with Microsoft SMTP Server (TLS) id 14.3.439.0; Sun, 29 Sep 2019 22:17:27 -0700 Received: from fmsmsx601.amr.corp.intel.com (10.18.126.81) by fmsmsx601.amr.corp.intel.com (10.18.126.81) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Sun, 29 Sep 2019 22:17:26 -0700 Received: from shsmsx152.ccr.corp.intel.com (10.239.6.52) by fmsmsx601.amr.corp.intel.com (10.18.126.81) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.1.1713.5 via Frontend Transport; Sun, 29 Sep 2019 22:17:26 -0700 Received: from shsmsx104.ccr.corp.intel.com ([169.254.5.166]) by SHSMSX152.ccr.corp.intel.com ([169.254.6.98]) with mapi id 14.03.0439.000; Mon, 30 Sep 2019 13:17:18 +0800 From: "Liming Gao" To: "Zhang, Shenglei" , "devel@edk2.groups.io" CC: "Feng, Bob C" Subject: Re: [PATCH] BaseTools/LzmaCompress: Fix the option "d" dictionary size Thread-Topic: [PATCH] BaseTools/LzmaCompress: Fix the option "d" dictionary size Thread-Index: AQHVd0J+EgtS5f++dUWD4cZJlv3rKKdDrgZw Date: Mon, 30 Sep 2019 05:17:17 +0000 Message-ID: <4A89E2EF3DFEDB4C8BFDE51014F606A14E50E51C@SHSMSX104.ccr.corp.intel.com> References: <20190930035228.72296-1-shenglei.zhang@intel.com> In-Reply-To: <20190930035228.72296-1-shenglei.zhang@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Return-Path: liming.gao@intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Liming Gao >-----Original Message----- >From: Zhang, Shenglei >Sent: Monday, September 30, 2019 11:52 AM >To: devel@edk2.groups.io >Cc: Feng, Bob C ; Gao, Liming >Subject: [PATCH] BaseTools/LzmaCompress: Fix the option "d" dictionary siz= e > >The range of dictionary size is set from [0,30] to [0,27]. >And update the help information for this. >The previous logic for processing the parameter dict size is incorrect. >Now fix the logic. >The option "d" is added at 6b80310f34199d1f62e45e40fa902734735091fa. >(https://bugzilla.tianocore.org/show_bug.cgi?id=3D2077) > >Cc: Bob Feng >Cc: Liming Gao >Signed-off-by: Shenglei Zhang >--- > BaseTools/Source/C/LzmaCompress/LzmaCompress.c | 12 ++++++++---- > 1 file changed, 8 insertions(+), 4 deletions(-) > >diff --git a/BaseTools/Source/C/LzmaCompress/LzmaCompress.c >b/BaseTools/Source/C/LzmaCompress/LzmaCompress.c >index 856fcf9ffb17..bebdb9aa84a1 100644 >--- a/BaseTools/Source/C/LzmaCompress/LzmaCompress.c >+++ b/BaseTools/Source/C/LzmaCompress/LzmaCompress.c >@@ -42,7 +42,7 @@ const char *kInvalidParamValMessage =3D "Invalid >parameter value"; > static Bool mQuietMode =3D False; > static CONVERTER_TYPE mConType =3D NoConverter; > >-UINT64 mDictionarySize =3D 31; >+UINT64 mDictionarySize =3D 28; > UINT64 mCompressionMode =3D 2; > > #define UTILITY_NAME "LzmaCompress" >@@ -64,7 +64,7 @@ void PrintHelp(char *buffer) > " -q, --quiet: reduce output messages\n" > " --debug [0-9]: set debug level\n" > " -a: set compression mode 0 =3D fast, 1 =3D normal, defaul= t: 1 (normal)\n" >- " d: sets Dictionary size - [0, 30], default: 23 (8MB)\n" >+ " d: sets Dictionary size - [0, 27], default: 24 (16MB)\n" > " --version: display the program version and exit\n" > " -h, --help: display this help text\n" > ); >@@ -298,8 +298,12 @@ int main2(int numArgs, const char *args[], char *rs) > } > } else if (strcmp(args[param], "d") =3D=3D 0) { > AsciiStringToUint64(args[param + 1],FALSE,&mDictionarySize); >- if (mDictionarySize <=3D 30){ >- props.dictSize =3D (UINT32)mDictionarySize; >+ if (mDictionarySize <=3D 27) { >+ if (mDictionarySize =3D=3D 0) { >+ props.dictSize =3D 0; >+ } else { >+ props.dictSize =3D (1 << mDictionarySize); >+ } > param++; > continue; > } else { >-- >2.18.0.windows.1