]> git.proxmox.com Git - mirror_edk2.git/commitdiff
MdeModulePkg/PartitionDxe: Initialize the array after declaration
authorDandan Bi <dandan.bi@intel.com>
Tue, 12 Sep 2017 08:56:16 +0000 (16:56 +0800)
committerStar Zeng <star.zeng@intel.com>
Tue, 12 Sep 2017 09:22:07 +0000 (17:22 +0800)
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>
MdeModulePkg/Universal/Disk/PartitionDxe/Udf.c

index c1d44809bfd2cf952a5ce5848d6b188dd1113fc0..3174ab2b4bdbdf68b8545008cc2bc59182e81d9a 100644 (file)
@@ -48,11 +48,18 @@ FindAnchorVolumeDescriptorPointer (
   )\r
 {\r
   EFI_STATUS  Status;\r
-  UINT32      BlockSize = BlockIo->Media->BlockSize;\r
-  EFI_LBA     EndLBA = BlockIo->Media->LastBlock;\r
-  EFI_LBA     DescriptorLBAs[] = { 256, EndLBA - 256, EndLBA, 512 };\r
+  UINT32      BlockSize;\r
+  EFI_LBA     EndLBA;\r
+  EFI_LBA     DescriptorLBAs[4];\r
   UINTN       Index;\r
 \r
+  BlockSize = BlockIo->Media->BlockSize;\r
+  EndLBA = BlockIo->Media->LastBlock;\r
+  DescriptorLBAs[0] = 256;\r
+  DescriptorLBAs[1] = EndLBA - 256;\r
+  DescriptorLBAs[2] = EndLBA;\r
+  DescriptorLBAs[3] = 512;\r
+\r
   for (Index = 0; Index < ARRAY_SIZE (DescriptorLBAs); Index++) {\r
     Status = DiskIo->ReadDisk (\r
       DiskIo,\r