diff options
author | Dandan Bi <dandan.bi@intel.com> | 2017-09-12 16:56:16 +0800 |
---|---|---|
committer | Star Zeng <star.zeng@intel.com> | 2017-09-12 17:22:07 +0800 |
commit | c05cae55ebd800308d04ff8f2eef948aaf567732 (patch) | |
tree | eb3b3863fd3f3a1db1abf9b808d0045c71d7ff5e /MdeModulePkg/Universal/Disk | |
parent | b434f7532770714b1683b73cd54b8a38d5674251 (diff) | |
download | edk2-c05cae55ebd800308d04ff8f2eef948aaf567732.tar.gz edk2-c05cae55ebd800308d04ff8f2eef948aaf567732.tar.bz2 edk2-c05cae55ebd800308d04ff8f2eef948aaf567732.zip |
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>
Diffstat (limited to 'MdeModulePkg/Universal/Disk')
-rw-r--r-- | MdeModulePkg/Universal/Disk/PartitionDxe/Udf.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/MdeModulePkg/Universal/Disk/PartitionDxe/Udf.c b/MdeModulePkg/Universal/Disk/PartitionDxe/Udf.c index c1d44809bf..3174ab2b4b 100644 --- a/MdeModulePkg/Universal/Disk/PartitionDxe/Udf.c +++ b/MdeModulePkg/Universal/Disk/PartitionDxe/Udf.c @@ -48,11 +48,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,
|