VirtualBox

Changeset 90141 in vbox


Ignore:
Timestamp:
Jul 9, 2021 10:41:57 PM (4 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
145643
Message:

DevHdaCodec: Corrected some member names. bugref:9890

Location:
trunk/src/VBox/Devices/Audio
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • TabularUnified trunk/src/VBox/Devices/Audio/DevHdaCodec.cpp

    r90139 r90141  
    798798    pThis->fInReset = false;
    799799
    800 #define STAC9220WIDGET(type) memcpy(&pThis->au8##type##s, &g_abStac9220##type##s, sizeof(uint8_t) * RT_ELEMENTS(g_abStac9220##type##s));
     800#define STAC9220WIDGET(a_Type) do { \
     801            AssertCompile(RT_ELEMENTS(g_abStac9220##a_Type##s) <= RT_ELEMENTS(pThis->ab##a_Type##s)); \
     802            memcpy(&pThis->ab##a_Type##s, &g_abStac9220##a_Type##s, sizeof(uint8_t) * RT_ELEMENTS(g_abStac9220##a_Type##s)); \
     803        } while (0)
    801804    STAC9220WIDGET(Port);
    802805    STAC9220WIDGET(Dac);
     
    849852
    850853/*
    851  * Some generic predicate functions.
    852  */
     854 * Some generic predicate functions.
     855 */
     856/** @todo r=bird: we could use memchr here if we knew the array always ended with zeros */
    853857#define HDA_CODEC_IS_NODE_OF_TYPE_FUNC(a_Type) \
    854858    DECLINLINE(bool) hdaCodecIs##a_Type##Node(PHDACODECR3 pThis, uint8_t idNode) \
    855859    { \
    856         Assert(pThis->au8##a_Type##s); \
    857         for (uintptr_t i = 0; i < RT_ELEMENTS(pThis->au8##a_Type##s) && pThis->au8##a_Type##s[i] != 0; i++) \
    858             if (pThis->au8##a_Type##s[i] == idNode) \
     860        Assert(pThis->ab##a_Type##s); \
     861        for (uintptr_t i = 0; i < RT_ELEMENTS(pThis->ab##a_Type##s) && pThis->ab##a_Type##s[i] != 0; i++) \
     862            if (pThis->ab##a_Type##s[i] == idNode) \
    859863                return true; \
    860864        return false; \
     
    15641568        } while (0)
    15651569
    1566         PROPAGATE_PWR_STATE(pThis->au8Dacs,       dac);
    1567         PROPAGATE_PWR_STATE(pThis->au8Adcs,       adc);
    1568         PROPAGATE_PWR_STATE(pThis->au8DigInPins,  digin);
    1569         PROPAGATE_PWR_STATE(pThis->au8DigOutPins, digout);
    1570         PROPAGATE_PWR_STATE(pThis->au8SpdifIns,   spdifin);
    1571         PROPAGATE_PWR_STATE(pThis->au8SpdifOuts,  spdifout);
    1572         PROPAGATE_PWR_STATE(pThis->au8Reserveds,  reserved);
     1570        PROPAGATE_PWR_STATE(pThis->abDacs,       dac);
     1571        PROPAGATE_PWR_STATE(pThis->abAdcs,       adc);
     1572        PROPAGATE_PWR_STATE(pThis->abDigInPins,  digin);
     1573        PROPAGATE_PWR_STATE(pThis->abDigOutPins, digout);
     1574        PROPAGATE_PWR_STATE(pThis->abSpdifIns,   spdifin);
     1575        PROPAGATE_PWR_STATE(pThis->abSpdifOuts,  spdifout);
     1576        PROPAGATE_PWR_STATE(pThis->abReserveds,  reserved);
    15731577
    15741578#undef PROPAGATE_PWR_STATE
     
    16591663        {
    16601664            /* now we're powered on AFG and may propogate power states on nodes */
    1661             const uint8_t *pu8NodeIndex = &pThis->au8Dacs[0];
     1665            const uint8_t *pu8NodeIndex = &pThis->abDacs[0];
    16621666            while (*(++pu8NodeIndex))
    16631667                codecPropogatePowerState(&pThis->aNodes[*pu8NodeIndex].dac.u32F05_param);
    16641668
    1665             pu8NodeIndex = &pThis->au8Adcs[0];
     1669            pu8NodeIndex = &pThis->abAdcs[0];
    16661670            while (*(++pu8NodeIndex))
    16671671                codecPropogatePowerState(&pThis->aNodes[*pu8NodeIndex].adc.u32F05_param);
    16681672
    1669             pu8NodeIndex = &pThis->au8DigInPins[0];
     1673            pu8NodeIndex = &pThis->abDigInPins[0];
    16701674            while (*(++pu8NodeIndex))
    16711675                codecPropogatePowerState(&pThis->aNodes[*pu8NodeIndex].digin.u32F05_param);
     
    23292333    uint8_t         uLevel;
    23302334    /** Pointer to codec state. */
    2331     PHDACODECR3       pThis;
     2335    PHDACODECR3     pThis;
    23322336} CODECDEBUG;
    23332337/** Pointer to the debug info item printing state for the codec. */
  • TabularUnified trunk/src/VBox/Devices/Audio/DevHdaCodec.h

    r90140 r90141  
    816816    uint8_t     abPadding1[CODEC_NODES_MAX - 20];
    817817
    818     uint8_t     au8Ports[CODEC_NODES_MAX];
    819     uint8_t     au8Dacs[CODEC_NODES_MAX];
    820     uint8_t     au8AdcVols[CODEC_NODES_MAX];
    821     uint8_t     au8Adcs[CODEC_NODES_MAX];
    822     uint8_t     au8AdcMuxs[CODEC_NODES_MAX];
    823     uint8_t     au8Pcbeeps[CODEC_NODES_MAX];
    824     uint8_t     au8SpdifIns[CODEC_NODES_MAX];
    825     uint8_t     au8SpdifOuts[CODEC_NODES_MAX];
    826     uint8_t     au8DigInPins[CODEC_NODES_MAX];
    827     uint8_t     au8DigOutPins[CODEC_NODES_MAX];
    828     uint8_t     au8Cds[CODEC_NODES_MAX];
    829     uint8_t     au8VolKnobs[CODEC_NODES_MAX];
    830     uint8_t     au8Reserveds[CODEC_NODES_MAX];
     818    uint8_t     abPorts[CODEC_NODES_MAX];
     819    uint8_t     abDacs[CODEC_NODES_MAX];
     820    uint8_t     abAdcVols[CODEC_NODES_MAX];
     821    uint8_t     abAdcs[CODEC_NODES_MAX];
     822    uint8_t     abAdcMuxs[CODEC_NODES_MAX];
     823    uint8_t     abPcbeeps[CODEC_NODES_MAX];
     824    uint8_t     abSpdifIns[CODEC_NODES_MAX];
     825    uint8_t     abSpdifOuts[CODEC_NODES_MAX];
     826    uint8_t     abDigInPins[CODEC_NODES_MAX];
     827    uint8_t     abDigOutPins[CODEC_NODES_MAX];
     828    uint8_t     abCds[CODEC_NODES_MAX];
     829    uint8_t     abVolKnobs[CODEC_NODES_MAX];
     830    uint8_t     abReserveds[CODEC_NODES_MAX];
    831831
    832832    /** Safty zero padding before the nodes start. */
     
    839839} HDACODECR3;
    840840AssertCompile(RT_IS_POWER_OF_TWO(CODEC_NODES_MAX));
    841 AssertCompileMemberAlignment(HDACODECR3, au8Ports, CODEC_NODES_MAX);
     841AssertCompileMemberAlignment(HDACODECR3, abPorts, CODEC_NODES_MAX);
    842842AssertCompileMemberAlignment(HDACODECR3, aNodes, 64);
    843843AssertCompileSizeAlignment(HDACODECR3, 8);
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette