MdeModulePkg/PartitionDxe: Initialize the array after declaration

Initialize the array DescriptorLBAs[] after declaration to fix
non-constant aggregate initializer warning in VS tool chains.

Cc: Eric Dong <eric.dong@intel.com>
Cc: Paulo Alcantara <pcacjr@zytor.com>
Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
Reviewed-by: Paulo Alcantara <pcacjr@zytor.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
This commit is contained in:
Dandan Bi 2017-09-12 16:56:16 +08:00 committed by Star Zeng
parent b434f75327
commit c05cae55eb
1 changed files with 10 additions and 3 deletions

View File

@ -48,11 +48,18 @@ FindAnchorVolumeDescriptorPointer (
) )
{ {
EFI_STATUS Status; EFI_STATUS Status;
UINT32 BlockSize = BlockIo->Media->BlockSize; UINT32 BlockSize;
EFI_LBA EndLBA = BlockIo->Media->LastBlock; EFI_LBA EndLBA;
EFI_LBA DescriptorLBAs[] = { 256, EndLBA - 256, EndLBA, 512 }; EFI_LBA DescriptorLBAs[4];
UINTN Index; 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++) { for (Index = 0; Index < ARRAY_SIZE (DescriptorLBAs); Index++) {
Status = DiskIo->ReadDisk ( Status = DiskIo->ReadDisk (
DiskIo, DiskIo,