From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) (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 E6F611A1E46 for ; Wed, 26 Oct 2016 12:06:18 -0700 (PDT) Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 86E36C05A28C; Wed, 26 Oct 2016 19:06:18 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-116-27.phx2.redhat.com [10.3.116.27]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u9QJ570H025834; Wed, 26 Oct 2016 15:06:17 -0400 From: Laszlo Ersek To: edk2-devel-01 Cc: Jaben Carsey , Ruiyu Ni Date: Wed, 26 Oct 2016 21:04:58 +0200 Message-Id: <20161026190504.9888-42-lersek@redhat.com> In-Reply-To: <20161026190504.9888-1-lersek@redhat.com> References: <20161026190504.9888-1-lersek@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Wed, 26 Oct 2016 19:06:18 +0000 (UTC) Subject: [PATCH 41/47] ShellPkg/UefiDpLib: rebase to ARRAY_SIZE() X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Oct 2016 19:06:19 -0000 Cc: Jaben Carsey Cc: Ruiyu Ni Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek --- ShellPkg/Library/UefiDpLib/DpTrace.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/ShellPkg/Library/UefiDpLib/DpTrace.c b/ShellPkg/Library/UefiDpLib/DpTrace.c index f3f781fdb989..eca2ef309bbc 100644 --- a/ShellPkg/Library/UefiDpLib/DpTrace.c +++ b/ShellPkg/Library/UefiDpLib/DpTrace.c @@ -220,8 +220,8 @@ DumpAllTrace( ++Count; // Count the number of records printed // If Handle is non-zero, see if we can determine a name for the driver - AsciiStrToUnicodeStrS (Measurement.Module, mGaugeString, sizeof (mGaugeString) / sizeof (mGaugeString[0])); // Use Module by default - AsciiStrToUnicodeStrS (Measurement.Token, mUnicodeToken, sizeof (mUnicodeToken) / sizeof (mUnicodeToken[0])); + AsciiStrToUnicodeStrS (Measurement.Module, mGaugeString, ARRAY_SIZE (mGaugeString)); // Use Module by default + AsciiStrToUnicodeStrS (Measurement.Token, mUnicodeToken, ARRAY_SIZE (mUnicodeToken)); if (Measurement.Handle != NULL) { // See if the Handle is in the HandleBuffer for (TIndex = 0; TIndex < HandleCount; TIndex++) { @@ -595,7 +595,7 @@ ProcessHandles( continue; } mGaugeString[0] = 0; // Empty driver name by default - AsciiStrToUnicodeStrS (Measurement.Token, mUnicodeToken, sizeof (mUnicodeToken) / sizeof (mUnicodeToken[0])); + AsciiStrToUnicodeStrS (Measurement.Token, mUnicodeToken, ARRAY_SIZE (mUnicodeToken)); // See if the Handle is in the HandleBuffer for (Index = 0; Index < HandleCount; Index++) { if (Measurement.Handle == HandleBuffer[Index]) { @@ -776,8 +776,8 @@ ProcessGlobal( &Measurement.EndTimeStamp, &Measurement.Identifier)) != 0) { - AsciiStrToUnicodeStrS (Measurement.Module, mGaugeString, sizeof (mGaugeString) / sizeof (mGaugeString[0])); - AsciiStrToUnicodeStrS (Measurement.Token, mUnicodeToken, sizeof (mUnicodeToken) / sizeof (mUnicodeToken[0])); + AsciiStrToUnicodeStrS (Measurement.Module, mGaugeString, ARRAY_SIZE (mGaugeString)); + AsciiStrToUnicodeStrS (Measurement.Token, mUnicodeToken, ARRAY_SIZE (mUnicodeToken)); mGaugeString[25] = 0; mUnicodeToken[31] = 0; if ( ! ( IsPhase( &Measurement) || -- 2.9.2