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 7B5631A1F2B for ; Wed, 26 Oct 2016 12:06:02 -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 134F661B9A; Wed, 26 Oct 2016 19:06:02 +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 u9QJ5705025834; Wed, 26 Oct 2016 15:06:00 -0400 From: Laszlo Ersek To: edk2-devel-01 Cc: Dandan Bi , Eric Dong , Feng Tian , Star Zeng Date: Wed, 26 Oct 2016 21:04:46 +0200 Message-Id: <20161026190504.9888-30-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.39]); Wed, 26 Oct 2016 19:06:02 +0000 (UTC) Subject: [PATCH 29/47] MdeModulePkg/DisplayEngineDxe: 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:02 -0000 Cc: Dandan Bi Cc: Eric Dong Cc: Feng Tian Cc: Star Zeng Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek --- MdeModulePkg/Universal/DisplayEngineDxe/FormDisplay.c | 4 ++-- MdeModulePkg/Universal/DisplayEngineDxe/InputHandler.c | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/MdeModulePkg/Universal/DisplayEngineDxe/FormDisplay.c b/MdeModulePkg/Universal/DisplayEngineDxe/FormDisplay.c index 8531d0ee06c6..b37c1cc2e4aa 100644 --- a/MdeModulePkg/Universal/DisplayEngineDxe/FormDisplay.c +++ b/MdeModulePkg/Universal/DisplayEngineDxe/FormDisplay.c @@ -49,7 +49,7 @@ SCAN_CODE_TO_SCREEN_OPERATION gScanCodeToOperation[] = { } }; -UINTN mScanCodeNumber = sizeof (gScanCodeToOperation) / sizeof (gScanCodeToOperation[0]); +UINTN mScanCodeNumber = ARRAY_SIZE (gScanCodeToOperation); SCREEN_OPERATION_T0_CONTROL_FLAG gScreenOperationToControlFlag[] = { { @@ -3248,7 +3248,7 @@ UiDisplayMenu ( } for (Index = 0; - Index < sizeof (gScreenOperationToControlFlag) / sizeof (gScreenOperationToControlFlag[0]); + Index < ARRAY_SIZE (gScreenOperationToControlFlag); Index++ ) { if (ScreenOperation == gScreenOperationToControlFlag[Index].ScreenOperation) { diff --git a/MdeModulePkg/Universal/DisplayEngineDxe/InputHandler.c b/MdeModulePkg/Universal/DisplayEngineDxe/InputHandler.c index 8e7b735c7063..400b93427caa 100644 --- a/MdeModulePkg/Universal/DisplayEngineDxe/InputHandler.c +++ b/MdeModulePkg/Universal/DisplayEngineDxe/InputHandler.c @@ -1070,14 +1070,14 @@ EnterCarriageReturn: if (ValidateFail) { UpdateStatusBar (INPUT_ERROR, TRUE); - ASSERT (Count < sizeof (PreviousNumber) / sizeof (PreviousNumber[0])); + ASSERT (Count < ARRAY_SIZE (PreviousNumber)); EditValue = PreviousNumber[Count]; break; } } else { if (EditValue > Maximum) { UpdateStatusBar (INPUT_ERROR, TRUE); - ASSERT (Count < sizeof (PreviousNumber) / sizeof (PreviousNumber[0])); + ASSERT (Count < ARRAY_SIZE (PreviousNumber)); EditValue = PreviousNumber[Count]; break; } @@ -1086,7 +1086,7 @@ EnterCarriageReturn: UpdateStatusBar (INPUT_ERROR, FALSE); Count++; - ASSERT (Count < (sizeof (PreviousNumber) / sizeof (PreviousNumber[0]))); + ASSERT (Count < (ARRAY_SIZE (PreviousNumber))); PreviousNumber[Count] = EditValue; gST->ConOut->SetAttribute (gST->ConOut, GetHighlightTextColor ()); -- 2.9.2