From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) (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 867B320958BCF for ; Sun, 10 Sep 2017 23:14:15 -0700 (PDT) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 10 Sep 2017 23:17:10 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.42,376,1500966000"; d="scan'208";a="133925021" Received: from shwdeopenpsi114.ccr.corp.intel.com ([10.239.157.135]) by orsmga002.jf.intel.com with ESMTP; 10 Sep 2017 23:17:09 -0700 From: Dandan Bi To: edk2-devel@lists.01.org Date: Mon, 11 Sep 2017 14:17:01 +0800 Message-Id: <1505110623-381040-1-git-send-email-dandan.bi@intel.com> X-Mailer: git-send-email 1.9.5.msysgit.1 Subject: [PATCH v2 1/3] MdeModulePkg/PartitionDxe: Initialize the array after declaration X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Sep 2017 06:14:15 -0000 Initialize the array DescriptorLBAs[] after declaration to fix non-constant aggregate initializer warning in VS tool chains. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Dandan Bi --- MdeModulePkg/Universal/Disk/PartitionDxe/Udf.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/MdeModulePkg/Universal/Disk/PartitionDxe/Udf.c b/MdeModulePkg/Universal/Disk/PartitionDxe/Udf.c index 3347b48..7856b5d 100644 --- a/MdeModulePkg/Universal/Disk/PartitionDxe/Udf.c +++ b/MdeModulePkg/Universal/Disk/PartitionDxe/Udf.c @@ -46,15 +46,22 @@ FindAnchorVolumeDescriptorPointer ( IN EFI_DISK_IO_PROTOCOL *DiskIo, OUT UDF_ANCHOR_VOLUME_DESCRIPTOR_POINTER *AnchorPoint ) { EFI_STATUS Status; - UINT32 BlockSize = BlockIo->Media->BlockSize; - EFI_LBA EndLBA = BlockIo->Media->LastBlock; - EFI_LBA DescriptorLBAs[] = { 256, EndLBA - 256, EndLBA, 512 }; + UINT32 BlockSize; + EFI_LBA EndLBA; + EFI_LBA DescriptorLBAs[4]; UINTN Index; + BlockSize = BlockIo->Media->BlockSize; + EndLBA = BlockIo->Media->LastBlock; + DescriptorLBAs[0] = 256; + DescriptorLBAs[1] = EndLBA - 256; + DescriptorLBAs[2] = EndLBA; + DescriptorLBAs[3] = 512; + for (Index = 0; Index < ARRAY_SIZE (DescriptorLBAs); Index++) { Status = DiskIo->ReadDisk ( DiskIo, BlockIo->Media->MediaId, MultU64x32 (DescriptorLBAs[Index], BlockSize), -- 1.9.5.msysgit.1