public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [PATCH v2 1/3] MdeModulePkg/PartitionDxe: Initialize the array after declaration
@ 2017-09-11  6:17 Dandan Bi
  2017-09-11  6:17 ` [PATCH v2 2/3] MdeModulePkg/UdfDxe: " Dandan Bi
  2017-09-11  6:17 ` [PATCH v2 3/3] MdeModulePkg/UdfDxe: Add type cast to fix build failure in VS tools Dandan Bi
  0 siblings, 2 replies; 7+ messages in thread
From: Dandan Bi @ 2017-09-11  6:17 UTC (permalink / raw)
  To: edk2-devel

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

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
---
 MdeModulePkg/Universal/Disk/PartitionDxe/Udf.c | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)

diff --git a/MdeModulePkg/Universal/Disk/PartitionDxe/Udf.c b/MdeModulePkg/Universal/Disk/PartitionDxe/Udf.c
index 3347b48..7856b5d 100644
--- a/MdeModulePkg/Universal/Disk/PartitionDxe/Udf.c
+++ b/MdeModulePkg/Universal/Disk/PartitionDxe/Udf.c
@@ -46,15 +46,22 @@ FindAnchorVolumeDescriptorPointer (
   IN   EFI_DISK_IO_PROTOCOL                  *DiskIo,
   OUT  UDF_ANCHOR_VOLUME_DESCRIPTOR_POINTER  *AnchorPoint
   )
 {
   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,
       BlockIo->Media->MediaId,
       MultU64x32 (DescriptorLBAs[Index], BlockSize),
-- 
1.9.5.msysgit.1



^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2017-09-13  4:05 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-09-11  6:17 [PATCH v2 1/3] MdeModulePkg/PartitionDxe: Initialize the array after declaration Dandan Bi
2017-09-11  6:17 ` [PATCH v2 2/3] MdeModulePkg/UdfDxe: " Dandan Bi
2017-09-11  6:17 ` [PATCH v2 3/3] MdeModulePkg/UdfDxe: Add type cast to fix build failure in VS tools Dandan Bi
2017-09-12  9:39   ` Zeng, Star
2017-09-12 13:02     ` Paulo Alcantara
2017-09-13  3:31       ` Zeng, Star
2017-09-13  4:06         ` Paulo Alcantara

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox