diff options
author | Robert Moore <Robert.Moore@intel.com> | 2023-03-24 11:48:40 -0700 |
---|---|---|
committer | Robert Moore <Robert.Moore@intel.com> | 2023-03-24 11:48:40 -0700 |
commit | f98909b7928cac8c5328e4852ad5a7ea671204fb (patch) | |
tree | 6e6d215d85dacc679660713964c02c589f26ca20 /source/components | |
parent | 41b40f8412f9587cccac88f4520cb6ede512e5ae (diff) | |
download | acpica-f98909b7928cac8c5328e4852ad5a7ea671204fb.tar.gz |
Fixes for ACPI_FLEX_ARRAY, to eliminate warnings on MSVC
Saket Dumbre.
Diffstat (limited to 'source/components')
-rw-r--r-- | source/components/disassembler/dmresrcl.c | 2 | ||||
-rw-r--r-- | source/components/resources/rsaddr.c | 4 | ||||
-rw-r--r-- | source/components/resources/rscreate.c | 8 | ||||
-rw-r--r-- | source/components/resources/rsdumpinfo.c | 8 | ||||
-rw-r--r-- | source/components/resources/rsirq.c | 12 |
5 files changed, 17 insertions, 17 deletions
diff --git a/source/components/disassembler/dmresrcl.c b/source/components/disassembler/dmresrcl.c index 75cafe5da..88d19036a 100644 --- a/source/components/disassembler/dmresrcl.c +++ b/source/components/disassembler/dmresrcl.c @@ -1112,7 +1112,7 @@ AcpiDmInterruptDescriptor ( { AcpiDmIndent (Level + 1); AcpiOsPrintf ("0x%8.8X,\n", - (UINT32) Resource->ExtendedIrq.Interrupts[i]); + (UINT32) Resource->ExtendedIrq.u.Interrupts[i]); } AcpiDmIndent (Level); diff --git a/source/components/resources/rsaddr.c b/source/components/resources/rsaddr.c index 46f38bc7b..beee83803 100644 --- a/source/components/resources/rsaddr.c +++ b/source/components/resources/rsaddr.c @@ -431,13 +431,13 @@ AcpiRsGetAddressCommon ( ACPI_RESOURCE *Resource, AML_RESOURCE *Aml) { - ACPI_FUNCTION_ENTRY (); - /* Avoid undefined behavior: member access within misaligned address */ AML_RESOURCE_ADDRESS Address; memcpy(&Address, Aml, sizeof(Address)); + ACPI_FUNCTION_ENTRY(); + /* Validate the Resource Type */ if ((Address.ResourceType > 2) && diff --git a/source/components/resources/rscreate.c b/source/components/resources/rscreate.c index da0967ee8..583abe1a7 100644 --- a/source/components/resources/rscreate.c +++ b/source/components/resources/rscreate.c @@ -475,9 +475,9 @@ AcpiRsCreatePciRoutingTable ( /* Use *remaining* length of the buffer as max for pathname */ PathBuffer.Length = OutputBuffer->Length - - (UINT32) ((UINT8 *) UserPrt->Source - + (UINT32) ((UINT8 *) UserPrt->u.Source - (UINT8 *) OutputBuffer->Pointer); - PathBuffer.Pointer = UserPrt->Source; + PathBuffer.Pointer = UserPrt->u.Source; Status = AcpiNsHandleToPathname ( (ACPI_HANDLE) Node, &PathBuffer, FALSE); @@ -488,12 +488,12 @@ AcpiRsCreatePciRoutingTable ( /* +1 to include null terminator */ - UserPrt->Length += (UINT32) strlen (UserPrt->Source) + 1; + UserPrt->Length += (UINT32) strlen (UserPrt->u.Source) + 1; break; case ACPI_TYPE_STRING: - strcpy (UserPrt->Source, ObjDesc->String.Pointer); + strcpy (UserPrt->u.Source, ObjDesc->String.Pointer); /* * Add to the Length field the length of the string diff --git a/source/components/resources/rsdumpinfo.c b/source/components/resources/rsdumpinfo.c index f15b7b981..2801e0d77 100644 --- a/source/components/resources/rsdumpinfo.c +++ b/source/components/resources/rsdumpinfo.c @@ -182,7 +182,7 @@ ACPI_RSDUMP_INFO AcpiRsDumpIrq[7] = {ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET (Irq.Polarity), "Polarity", AcpiGbl_LlDecode}, {ACPI_RSD_2BITFLAG, ACPI_RSD_OFFSET (Irq.Shareable), "Sharing", AcpiGbl_ShrDecode}, {ACPI_RSD_UINT8 , ACPI_RSD_OFFSET (Irq.InterruptCount), "Interrupt Count", NULL}, - {ACPI_RSD_SHORTLIST,ACPI_RSD_OFFSET (Irq.Interrupts[0]), "Interrupt List", NULL} + {ACPI_RSD_SHORTLIST,ACPI_RSD_OFFSET (Irq.u.Interrupts[0]), "Interrupt List", NULL} }; ACPI_RSDUMP_INFO AcpiRsDumpDma[6] = @@ -192,7 +192,7 @@ ACPI_RSDUMP_INFO AcpiRsDumpDma[6] = {ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET (Dma.BusMaster), "Mastering", AcpiGbl_BmDecode}, {ACPI_RSD_2BITFLAG, ACPI_RSD_OFFSET (Dma.Transfer), "Transfer Type", AcpiGbl_SizDecode}, {ACPI_RSD_UINT8, ACPI_RSD_OFFSET (Dma.ChannelCount), "Channel Count", NULL}, - {ACPI_RSD_SHORTLIST,ACPI_RSD_OFFSET (Dma.Channels[0]), "Channel List", NULL} + {ACPI_RSD_SHORTLIST,ACPI_RSD_OFFSET (Dma.u.Channels[0]), "Channel List", NULL} }; ACPI_RSDUMP_INFO AcpiRsDumpStartDpf[4] = @@ -327,7 +327,7 @@ ACPI_RSDUMP_INFO AcpiRsDumpExtIrq[8] = {ACPI_RSD_2BITFLAG, ACPI_RSD_OFFSET (ExtendedIrq.Shareable), "Sharing", AcpiGbl_ShrDecode}, {ACPI_RSD_SOURCE, ACPI_RSD_OFFSET (ExtendedIrq.ResourceSource), NULL, NULL}, {ACPI_RSD_UINT8, ACPI_RSD_OFFSET (ExtendedIrq.InterruptCount), "Interrupt Count", NULL}, - {ACPI_RSD_DWORDLIST,ACPI_RSD_OFFSET (ExtendedIrq.Interrupts[0]), "Interrupt List", NULL} + {ACPI_RSD_DWORDLIST,ACPI_RSD_OFFSET (ExtendedIrq.u.Interrupts[0]), "Interrupt List", NULL} }; ACPI_RSDUMP_INFO AcpiRsDumpGenericReg[6] = @@ -555,7 +555,7 @@ ACPI_RSDUMP_INFO AcpiRsDumpPrt[5] = {ACPI_RSD_TITLE, ACPI_RSD_TABLE_SIZE (AcpiRsDumpPrt), NULL, NULL}, {ACPI_RSD_UINT64, ACPI_PRT_OFFSET (Address), "Address", NULL}, {ACPI_RSD_UINT32, ACPI_PRT_OFFSET (Pin), "Pin", NULL}, - {ACPI_RSD_STRING, ACPI_PRT_OFFSET (Source[0]), "Source", NULL}, + {ACPI_RSD_STRING, ACPI_PRT_OFFSET (u.Source[0]), "Source", NULL}, {ACPI_RSD_UINT32, ACPI_PRT_OFFSET (SourceIndex), "Source Index", NULL} }; diff --git a/source/components/resources/rsirq.c b/source/components/resources/rsirq.c index c2d306aa2..10256c50b 100644 --- a/source/components/resources/rsirq.c +++ b/source/components/resources/rsirq.c @@ -171,7 +171,7 @@ ACPI_RSCONVERT_INFO AcpiRsGetIrq[9] = /* Get the IRQ mask (bytes 1:2) */ - {ACPI_RSC_BITMASK16,ACPI_RS_OFFSET (Data.Irq.Interrupts[0]), + {ACPI_RSC_BITMASK16,ACPI_RS_OFFSET (Data.Irq.u.Interrupts[0]), AML_OFFSET (Irq.IrqMask), ACPI_RS_OFFSET (Data.Irq.InterruptCount)}, @@ -227,7 +227,7 @@ ACPI_RSCONVERT_INFO AcpiRsSetIrq[14] = /* Convert interrupt list to 16-bit IRQ bitmask */ - {ACPI_RSC_BITMASK16,ACPI_RS_OFFSET (Data.Irq.Interrupts[0]), + {ACPI_RSC_BITMASK16,ACPI_RS_OFFSET (Data.Irq.u.Interrupts[0]), AML_OFFSET (Irq.IrqMask), ACPI_RS_OFFSET (Data.Irq.InterruptCount)}, @@ -345,14 +345,14 @@ ACPI_RSCONVERT_INFO AcpiRsConvertExtIrq[10] = /* Copy every IRQ in the table, each is 32 bits */ - {ACPI_RSC_MOVE32, ACPI_RS_OFFSET (Data.ExtendedIrq.Interrupts[0]), - AML_OFFSET (ExtendedIrq.Interrupts[0]), + {ACPI_RSC_MOVE32, ACPI_RS_OFFSET (Data.ExtendedIrq.u.Interrupts[0]), + AML_OFFSET (ExtendedIrq.u.Interrupts[0]), 0}, /* Optional ResourceSource (Index and String) */ {ACPI_RSC_SOURCEX, ACPI_RS_OFFSET (Data.ExtendedIrq.ResourceSource), - ACPI_RS_OFFSET (Data.ExtendedIrq.Interrupts[0]), + ACPI_RS_OFFSET (Data.ExtendedIrq.u.Interrupts[0]), sizeof (AML_RESOURCE_EXTENDED_IRQ)} }; @@ -389,7 +389,7 @@ ACPI_RSCONVERT_INFO AcpiRsConvertDma[6] = /* DMA channel mask bits */ - {ACPI_RSC_BITMASK, ACPI_RS_OFFSET (Data.Dma.Channels[0]), + {ACPI_RSC_BITMASK, ACPI_RS_OFFSET (Data.Dma.u.Channels[0]), AML_OFFSET (Dma.DmaChannelMask), ACPI_RS_OFFSET (Data.Dma.ChannelCount)} }; |