From b434f7532770714b1683b73cd54b8a38d5674251 Mon Sep 17 00:00:00 2001 From: "Bi, Dandan" Date: Tue, 12 Sep 2017 16:56:15 +0800 Subject: [PATCH] MdeModulePkg/UdfDxe: 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 Cc: Paulo Alcantara Cc: Ruiyu Ni Cc: Star Zeng Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Dandan Bi Reviewed-by: Paulo Alcantara Reviewed-by: Star Zeng --- .../Universal/Disk/UdfDxe/FileSystemOperations.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/MdeModulePkg/Universal/Disk/UdfDxe/FileSystemOperations.c b/MdeModulePkg/Universal/Disk/UdfDxe/FileSystemOperations.c index 5c5b5e3765..904262a2ba 100644 --- a/MdeModulePkg/Universal/Disk/UdfDxe/FileSystemOperations.c +++ b/MdeModulePkg/Universal/Disk/UdfDxe/FileSystemOperations.c @@ -22,11 +22,18 @@ FindAnchorVolumeDescriptorPointer ( ) { 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,