]> git.proxmox.com Git - mirror_edk2.git/commitdiff
MdeModulePkg/UdfDxe: Initialize the array after declaration
authorBi, Dandan <dandan.bi@intel.com>
Tue, 12 Sep 2017 08:56:15 +0000 (16:56 +0800)
committerStar Zeng <star.zeng@intel.com>
Tue, 12 Sep 2017 09:22:06 +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/UdfDxe/FileSystemOperations.c

index 5c5b5e3765af95444f37ade204e2bf1910e6a76c..904262a2ba5cec52d2c840779e986fe228686de1 100644 (file)
@@ -22,11 +22,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