VirtualBox

Changeset 88057 in vbox


Ignore:
Timestamp:
Mar 9, 2021 3:11:22 PM (4 years ago)
Author:
vboxsync
Message:

Audio: enums must have an 'END' entry for validation purposes. bugref:9890

Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/VBox/vmm/pdmaudioifs.h

    r88056 r88057  
    281281    /** 32-bit, signed. */
    282282    PDMAUDIOFMT_S32,
     283    /** End of valid values. */
     284    PDMAUDIOFMT_END,
    283285    /** Hack to blow the type up to 32-bit. */
    284286    PDMAUDIOFMT_32BIT_HACK = 0x7fffffff
     
    300302    /** Duplex handling. */
    301303    PDMAUDIODIR_DUPLEX,
     304    /** End of valid values. */
     305    PDMAUDIODIR_END,
    302306    /** Hack to blow the type up to 32-bit. */
    303307    PDMAUDIODIR_32BIT_HACK = 0x7fffffff
     
    395399} PDMAUDIOHOSTDEV;
    396400AssertCompileSizeAlignment(PDMAUDIOHOSTDEV, 16);
    397 /** Pointer to audio device info (enum result). */
     401/** Pointer to audio device info (enumeration result). */
    398402typedef PDMAUDIOHOSTDEV *PPDMAUDIOHOSTDEV;
    399 /** Pointer to a const audio device info (enum result). */
     403/** Pointer to a const audio device info (enumeration result). */
    400404typedef PDMAUDIOHOSTDEV const *PCPDMAUDIOHOSTDEV;
    401405
     
    513517    /** Rear channel. */
    514518    PDMAUDIOPLAYBACKDST_REAR,
     519    /** End of valid values. */
     520    PDMAUDIOPLAYBACKDST_END,
    515521    /** Hack to blow the type up to 32-bit. */
    516522    PDMAUDIOPLAYBACKDST_32BIT_HACK = 0x7fffffff
     
    539545    /** Phone-In. */
    540546    PDMAUDIORECSRC_PHONE,
     547    /** End of valid values. */
     548    PDMAUDIORECSRC_END,
    541549    /** Hack to blow the type up to 32-bit. */
    542550    PDMAUDIORECSRC_32BIT_HACK = 0x7fffffff
     
    579587     *  directly. Don't use this if you don't have to. */
    580588    PDMAUDIOSTREAMLAYOUT_RAW,
     589    /** End of valid values. */
     590    PDMAUDIOSTREAMLAYOUT_END,
    581591    /** Hack to blow the type up to 32-bit. */
    582592    PDMAUDIOSTREAMLAYOUT_32BIT_HACK = 0x7fffffff
     
    644654    /** Right height channel. */
    645655    PDMAUDIOSTREAMCHANNELID_RIGHT_HEIGHT,
     656    /** End of valid values. */
     657    PDMAUDIOSTREAMCHANNELID_END,
    646658    /** Hack to blow the type up to 32-bit. */
    647659    PDMAUDIOSTREAMCHANNELID_32BIT_HACK = 0x7fffffff
     
    812824    /** Microphone-In. */
    813825    PDMAUDIOMIXERCTL_MIC_IN,
     826    /** End of valid values. */
     827    PDMAUDIOMIXERCTL_END,
    814828    /** Hack to blow the type up to 32-bit. */
    815829    PDMAUDIOMIXERCTL_32BIT_HACK = 0x7fffffff
     
    846860     *  No supported by all backends. */
    847861    PDMAUDIOSTREAMCMD_DROP,
     862    /** End of valid values. */
     863    PDMAUDIOSTREAMCMD_END,
    848864    /** Hack to blow the type up to 32-bit. */
    849865    PDMAUDIOSTREAMCMD_32BIT_HACK = 0x7fffffff
     
    10561072/**
    10571073 * Audio file types.
     1074 * @todo r=bird: This does not really belong here.
    10581075 */
    10591076typedef enum PDMAUDIOFILETYPE
  • trunk/include/VBox/vmm/pdmaudioinline.h

    r88052 r88057  
    7777
    7878        /* no default */
     79        case PDMAUDIODIR_END:
    7980        case PDMAUDIODIR_INVALID:
    8081        case PDMAUDIODIR_32BIT_HACK:
     
    102103        case PDMAUDIOMIXERCTL_MIC_IN:        return "Microphone-In";
    103104        /* no default */
     105        case PDMAUDIOMIXERCTL_END:
    104106        case PDMAUDIOMIXERCTL_INVALID:
    105107        case PDMAUDIOMIXERCTL_32BIT_HACK:
     
    125127        /* no default */
    126128        case PDMAUDIOPLAYBACKDST_INVALID:
     129        case PDMAUDIOPLAYBACKDST_END:
    127130        case PDMAUDIOPLAYBACKDST_32BIT_HACK:
    128131            break;
     
    149152        case PDMAUDIORECSRC_PHONE:   return "Phone";
    150153        /* no default */
     154        case PDMAUDIORECSRC_END:
    151155        case PDMAUDIORECSRC_32BIT_HACK:
    152156            break;
     
    177181        /* no default */
    178182        case PDMAUDIOFMT_INVALID:
     183        case PDMAUDIOFMT_END:
    179184        case PDMAUDIOFMT_32BIT_HACK:
    180185            break;
     
    207212        /* no default */
    208213        case PDMAUDIOFMT_INVALID:
     214        case PDMAUDIOFMT_END:
    209215        case PDMAUDIOFMT_32BIT_HACK:
    210216            break;
     
    232238        /* no default */
    233239        case PDMAUDIOFMT_INVALID:
     240        case PDMAUDIOFMT_END:
    234241        case PDMAUDIOFMT_32BIT_HACK:
    235242            break;
     
    296303{
    297304    AssertPtrReturn(pCfg, false);
    298     AssertMsgReturn(pCfg->enmDir    >= PDMAUDIODIR_UNKNOWN          && pCfg->enmDir    <= PDMAUDIODIR_DUPLEX,
     305    AssertMsgReturn(pCfg->enmDir    >= PDMAUDIODIR_UNKNOWN          && pCfg->enmDir    < PDMAUDIODIR_END,
    299306                    ("%d\n", pCfg->enmDir), false);
    300     AssertMsgReturn(pCfg->enmLayout >= PDMAUDIOSTREAMLAYOUT_UNKNOWN && pCfg->enmLayout <= PDMAUDIOSTREAMLAYOUT_RAW,
     307    AssertMsgReturn(pCfg->enmLayout >= PDMAUDIOSTREAMLAYOUT_UNKNOWN && pCfg->enmLayout < PDMAUDIOSTREAMLAYOUT_END,
    301308                    ("%d\n", pCfg->enmLayout), false);
    302309    return PDMAudioPropsAreValid(&pCfg->Props);
     
    380387        case PDMAUDIOSTREAMCMD_DRAIN:   return "Drain";
    381388        case PDMAUDIOSTREAMCMD_DROP:    return "Drop";
     389        case PDMAUDIOSTREAMCMD_END:
    382390        case PDMAUDIOSTREAMCMD_32BIT_HACK:
    383391            break;
  • trunk/src/VBox/Devices/Audio/DevIchAc97.cpp

    r88028 r88057  
    25712571        case PDMAUDIORECSRC_LINE:    return AC97_REC_LINE_IN;
    25722572        case PDMAUDIORECSRC_PHONE:   return AC97_REC_PHONE;
    2573         default:
     2573        /* no default */
     2574        case PDMAUDIORECSRC_UNKNOWN:
     2575        case PDMAUDIORECSRC_END:
     2576        case PDMAUDIORECSRC_32BIT_HACK:
    25742577            break;
    25752578    }
  • trunk/src/VBox/Devices/Audio/DrvAudio.cpp

    r88055 r88057  
    419419            rc = drvAudioStreamControlInternalBackend(pThis, pStream, PDMAUDIOSTREAMCMD_DROP);
    420420            if (RT_SUCCESS(rc))
    421             {
    422421                drvAudioStreamDropInternal(pThis, pStream);
    423             }
    424422            break;
    425423        }
     
    16431641
    16441642                if (RT_LIKELY(pStream->Host.Cfg.enmLayout == PDMAUDIOSTREAMLAYOUT_NON_INTERLEAVED))
    1645                 {
    16461643                    rc = drvAudioStreamPlayNonInterleaved(pThis, pStream, cfToPlay, &cfPlayedTotal);
    1647                 }
    16481644                else if (pStream->Host.Cfg.enmLayout == PDMAUDIOSTREAMLAYOUT_RAW)
    1649                 {
    16501645                    rc = drvAudioStreamPlayRaw(pThis, pStream, cfToPlay, &cfPlayedTotal);
    1651                 }
    16521646                else
    16531647                    AssertFailedStmt(rc = VERR_NOT_IMPLEMENTED);
     
    19371931
    19381932        if (RT_LIKELY(pStream->Host.Cfg.enmLayout == PDMAUDIOSTREAMLAYOUT_NON_INTERLEAVED))
    1939         {
    19401933            rc = drvAudioStreamCaptureNonInterleaved(pThis, pStream, &cfCaptured);
    1941         }
    19421934        else if (pStream->Host.Cfg.enmLayout == PDMAUDIOSTREAMLAYOUT_RAW)
    1943         {
    19441935            rc = drvAudioStreamCaptureRaw(pThis, pStream, &cfCaptured);
    1945         }
    19461936        else
    19471937            AssertFailedStmt(rc = VERR_NOT_IMPLEMENTED);
Note: See TracChangeset for help on using the changeset viewer.

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