From nobody Thu Apr 18 19:23:53 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+48275+1787277+3901457@groups.io; helo=web01.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+48275+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1569815557; cv=none; d=zoho.com; s=zohoarc; b=TDocwcme6f9FrHK0l5WLahVdvFhAKwMh/awsZwgf3MrGbMInZ50sq4WxKgvNALgfFKnTILx3bPnLBQBHoZ7zOnxvaYBxFdyuPOjHv3aRZJurkToRpIbhbBnXIFgiN62MY6KAJaSM11tJ3arb7ESh0hjc0kd+E1mGwhUgxm76Dog= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1569815557; h=Cc:Date:From:List-Id:List-Unsubscribe:Message-ID:Reply-To:Sender:Subject:To:ARC-Authentication-Results; bh=1KIQh2d/n8uTKkF7lV6y6hoySns8EXSpuwHh4N9lVu8=; b=fA8ndI/f44LHbhPrWxw0b+LRqKKIKqZ6wGmJ9WMVI0mxy+4jfBi308QstFZILMx55kBs3XU9a4fLErwkdNnL1tZyCndG5wSQaEmVXrf77n3dumrqfR9jFiMOZRpj/BzfjS0bniOVk7cqwmAVtsQf3xvFFaHFpA4Ln0H2qR3uTTo= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=pass; spf=pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+48275+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) header.from= Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1569815557078939.5264000062538; Sun, 29 Sep 2019 20:52:37 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id aaaaYY1788612xaaaaaaaaaa; Sun, 29 Sep 2019 20:52:36 -0700 X-Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by groups.io with SMTP; Sun, 29 Sep 2019 20:52:35 -0700 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 29 Sep 2019 20:52:35 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,565,1559545200"; d="scan'208";a="195199234" X-Received: from shenglei-dev.ccr.corp.intel.com ([10.239.158.52]) by orsmga006.jf.intel.com with ESMTP; 29 Sep 2019 20:52:33 -0700 From: "Zhang, Shenglei" To: devel@edk2.groups.io Cc: Bob Feng , Liming Gao Subject: [edk2-devel] [PATCH] BaseTools/LzmaCompress: Fix the option "d" dictionary size Date: Mon, 30 Sep 2019 11:52:28 +0800 Message-Id: <20190930035228.72296-1-shenglei.zhang@intel.com> Precedence: Bulk List-Unsubscribe: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,shenglei.zhang@intel.com X-Gm-Message-State: aaaaaaaaaaaaaaaaaaaaaaaax1787277AA= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1569815556; bh=Bu8PCFi655AgX3TgjLm5BqBdfBE2ZGtBYGNBk504m2E=; h=Cc:Date:From:Reply-To:Subject:To; b=r2hcmmGzBFhYZ/Won5Cjf832dFBnmZ/NTI1XCP3Gd3iQ92kK070oOlZhf+0rctpkuHx B7KtvwG3W4OpG+uOf2E6ekZY7ox+Lj5APC5D4YYw82388Php/yo6CNU8AVEcfqcHPL+pU lY9eYGI0yOrDkNVhuh5ysVsCRw3vPslOCko= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" 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 Reviewed-by: Liming Gao --- 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/Sou= rce/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 paramete= r value"; static Bool mQuietMode =3D False; static CONVERTER_TYPE mConType =3D NoConverter; =20 -UINT64 mDictionarySize =3D 31; +UINT64 mDictionarySize =3D 28; UINT64 mCompressionMode =3D 2; =20 #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, default= : 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 { --=20 2.18.0.windows.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#48275): https://edk2.groups.io/g/devel/message/48275 Mute This Topic: https://groups.io/mt/34341275/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-