VirtualBox

Changeset 90791 in vbox


Ignore:
Timestamp:
Aug 23, 2021 10:28:24 AM (3 years ago)
Author:
vboxsync
Message:

Devices: More VALID_PTR -> RT_VALID_PTR/AssertPtr.

Location:
trunk/src/VBox/Devices
Files:
13 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Graphics/HGSMI/HGSMIHost.cpp

    r85121 r90791  
    15541554        {
    15551555            pIns->pVM            = pVM;
    1556             pIns->pszName        = VALID_PTR(pszName) ? pszName : "";
     1556            pIns->pszName        = RT_VALID_PTR(pszName) ? pszName : "";
    15571557
    15581558            hgsmiHostHeapSetupUninitialized(&pIns->hostHeap);
  • trunk/src/VBox/Devices/Network/DrvIntNet.cpp

    r90330 r90791  
    17841784        return PDMDrvHlpVMSetError(pDrvIns, rc, RT_SRC_POS,
    17851785                                   N_("Failed to get ring-3 buffer for the newly created interface to '%s'"), pThis->szNetwork);
    1786     AssertRelease(VALID_PTR(GetBufferPtrsReq.pRing3Buf));
     1786    AssertRelease(RT_VALID_PTR(GetBufferPtrsReq.pRing3Buf));
    17871787    pThis->pBufR3 = GetBufferPtrsReq.pRing3Buf;
    17881788    pThis->pBufR0 = GetBufferPtrsReq.pRing0Buf;
  • trunk/src/VBox/Devices/Storage/DevAHCI.cpp

    r87773 r90791  
    51785178    /* Query the media interface. */
    51795179    pAhciPortR3->pDrvMedia = PDMIBASE_QUERY_INTERFACE(pAhciPortR3->pDrvBase, PDMIMEDIA);
    5180     AssertMsgReturn(VALID_PTR(pAhciPortR3->pDrvMedia),
     5180    AssertMsgReturn(RT_VALID_PTR(pAhciPortR3->pDrvMedia),
    51815181                    ("AHCI configuration error: LUN#%d misses the basic media interface!\n", pAhciPort->iLUN),
    51825182                    VERR_PDM_MISSING_INTERFACE);
     
    51845184    /* Get the extended media interface. */
    51855185    pAhciPortR3->pDrvMediaEx = PDMIBASE_QUERY_INTERFACE(pAhciPortR3->pDrvBase, PDMIMEDIAEX);
    5186     AssertMsgReturn(VALID_PTR(pAhciPortR3->pDrvMediaEx),
     5186    AssertMsgReturn(RT_VALID_PTR(pAhciPortR3->pDrvMediaEx),
    51875187                    ("AHCI configuration error: LUN#%d misses the extended media interface!\n", pAhciPort->iLUN),
    51885188                    VERR_PDM_MISSING_INTERFACE);
  • trunk/src/VBox/Devices/Storage/DevBusLogic.cpp

    r90445 r90791  
    40624062        /* Query the media interface. */
    40634063        pDevice->pDrvMedia = PDMIBASE_QUERY_INTERFACE(pDevice->pDrvBase, PDMIMEDIA);
    4064         AssertMsgReturn(VALID_PTR(pDevice->pDrvMedia),
     4064        AssertMsgReturn(RT_VALID_PTR(pDevice->pDrvMedia),
    40654065                        ("BusLogic configuration error: LUN#%d misses the basic media interface!\n", pDevice->iLUN),
    40664066                        VERR_PDM_MISSING_INTERFACE);
     
    40684068        /* Get the extended media interface. */
    40694069        pDevice->pDrvMediaEx = PDMIBASE_QUERY_INTERFACE(pDevice->pDrvBase, PDMIMEDIAEX);
    4070         AssertMsgReturn(VALID_PTR(pDevice->pDrvMediaEx),
     4070        AssertMsgReturn(RT_VALID_PTR(pDevice->pDrvMediaEx),
    40714071                        ("BusLogic configuration error: LUN#%d misses the extended media interface!\n", pDevice->iLUN),
    40724072                        VERR_PDM_MISSING_INTERFACE);
     
    43374337            /* Query the media interface. */
    43384338            pDevice->pDrvMedia = PDMIBASE_QUERY_INTERFACE(pDevice->pDrvBase, PDMIMEDIA);
    4339             AssertMsgReturn(VALID_PTR(pDevice->pDrvMedia),
     4339            AssertMsgReturn(RT_VALID_PTR(pDevice->pDrvMedia),
    43404340                            ("Buslogic configuration error: LUN#%d misses the basic media interface!\n", pDevice->iLUN),
    43414341                            VERR_PDM_MISSING_INTERFACE);
     
    43434343            /* Get the extended media interface. */
    43444344            pDevice->pDrvMediaEx = PDMIBASE_QUERY_INTERFACE(pDevice->pDrvBase, PDMIMEDIAEX);
    4345             AssertMsgReturn(VALID_PTR(pDevice->pDrvMediaEx),
     4345            AssertMsgReturn(RT_VALID_PTR(pDevice->pDrvMediaEx),
    43464346                            ("Buslogic configuration error: LUN#%d misses the extended media interface!\n", pDevice->iLUN),
    43474347                            VERR_PDM_MISSING_INTERFACE);
  • trunk/src/VBox/Devices/Storage/DevLsiLogicSCSI.cpp

    r90445 r90791  
    48864886        /* Query the media interface. */
    48874887        pDevice->pDrvMedia = PDMIBASE_QUERY_INTERFACE(pDevice->pDrvBase, PDMIMEDIA);
    4888         AssertMsgReturn(VALID_PTR(pDevice->pDrvMedia),
     4888        AssertMsgReturn(RT_VALID_PTR(pDevice->pDrvMedia),
    48894889                        ("LsiLogic configuration error: LUN#%d misses the basic media interface!\n", pDevice->iLUN),
    48904890                        VERR_PDM_MISSING_INTERFACE);
     
    48924892        /* Get the extended media interface. */
    48934893        pDevice->pDrvMediaEx = PDMIBASE_QUERY_INTERFACE(pDevice->pDrvBase, PDMIMEDIAEX);
    4894         AssertMsgReturn(VALID_PTR(pDevice->pDrvMediaEx),
     4894        AssertMsgReturn(RT_VALID_PTR(pDevice->pDrvMediaEx),
    48954895                        ("LsiLogic configuration error: LUN#%d misses the extended media interface!\n", pDevice->iLUN),
    48964896                        VERR_PDM_MISSING_INTERFACE);
     
    52805280            /* Query the media interface. */
    52815281            pDevice->pDrvMedia = PDMIBASE_QUERY_INTERFACE(pDevice->pDrvBase, PDMIMEDIA);
    5282             AssertMsgReturn(VALID_PTR(pDevice->pDrvMedia),
     5282            AssertMsgReturn(RT_VALID_PTR(pDevice->pDrvMedia),
    52835283                            ("LsiLogic configuration error: LUN#%d misses the basic media interface!\n", pDevice->iLUN),
    52845284                            VERR_PDM_MISSING_INTERFACE);
     
    52865286            /* Get the extended media interface. */
    52875287            pDevice->pDrvMediaEx = PDMIBASE_QUERY_INTERFACE(pDevice->pDrvBase, PDMIMEDIAEX);
    5288             AssertMsgReturn(VALID_PTR(pDevice->pDrvMediaEx),
     5288            AssertMsgReturn(RT_VALID_PTR(pDevice->pDrvMediaEx),
    52895289                            ("LsiLogic configuration error: LUN#%d misses the extended media interface!\n", pDevice->iLUN),
    52905290                            VERR_PDM_MISSING_INTERFACE);
  • trunk/src/VBox/Devices/Storage/DevVirtioSCSI.cpp

    r88827 r90791  
    21512151        pTarget->fPresent = true;
    21522152        pTarget->pDrvMedia = PDMIBASE_QUERY_INTERFACE(pTarget->pDrvBase, PDMIMEDIA);
    2153         AssertMsgReturn(VALID_PTR(pTarget->pDrvMedia),
     2153        AssertMsgReturn(RT_VALID_PTR(pTarget->pDrvMedia),
    21542154                        ("virtio-scsi configuration error: LUN#%d missing basic media interface!\n", uTarget),
    21552155                        VERR_PDM_MISSING_INTERFACE);
     
    21572157        /* Get the extended media interface. */
    21582158        pTarget->pDrvMediaEx = PDMIBASE_QUERY_INTERFACE(pTarget->pDrvBase, PDMIMEDIAEX);
    2159         AssertMsgReturn(VALID_PTR(pTarget->pDrvMediaEx),
     2159        AssertMsgReturn(RT_VALID_PTR(pTarget->pDrvMediaEx),
    21602160                        ("virtio-scsi configuration error: LUN#%d missing extended media interface!\n", uTarget),
    21612161                        VERR_PDM_MISSING_INTERFACE);
    21622162
    21632163        rc = pTarget->pDrvMediaEx->pfnIoReqAllocSizeSet(pTarget->pDrvMediaEx, sizeof(VIRTIOSCSIREQ));
    2164         AssertMsgReturn(VALID_PTR(pTarget->pDrvMediaEx),
     2164        AssertMsgReturn(RT_VALID_PTR(pTarget->pDrvMediaEx),
    21652165                        ("virtio-scsi configuration error: LUN#%u: Failed to set I/O request size!\n", uTarget),
    21662166                        rc);
     
    25512551
    25522552            pTarget->pDrvMedia = PDMIBASE_QUERY_INTERFACE(pTarget->pDrvBase, PDMIMEDIA);
    2553             AssertMsgReturn(VALID_PTR(pTarget->pDrvMedia),
     2553            AssertMsgReturn(RT_VALID_PTR(pTarget->pDrvMedia),
    25542554                            ("virtio-scsi configuration error: LUN#%d missing basic media interface!\n", uTarget),
    25552555                            VERR_PDM_MISSING_INTERFACE);
    25562556            /* Get the extended media interface. */
    25572557            pTarget->pDrvMediaEx = PDMIBASE_QUERY_INTERFACE(pTarget->pDrvBase, PDMIMEDIAEX);
    2558             AssertMsgReturn(VALID_PTR(pTarget->pDrvMediaEx),
     2558            AssertMsgReturn(RT_VALID_PTR(pTarget->pDrvMediaEx),
    25592559                            ("virtio-scsi configuration error: LUN#%d missing extended media interface!\n", uTarget),
    25602560                            VERR_PDM_MISSING_INTERFACE);
    25612561
    25622562            rc = pTarget->pDrvMediaEx->pfnIoReqAllocSizeSet(pTarget->pDrvMediaEx, sizeof(VIRTIOSCSIREQ));
    2563             AssertMsgReturn(VALID_PTR(pTarget->pDrvMediaEx),
     2563            AssertMsgReturn(RT_VALID_PTR(pTarget->pDrvMediaEx),
    25642564                            ("virtio-scsi configuration error: LUN#%u: Failed to set I/O request size!\n", uTarget),
    25652565                            rc);
  • trunk/src/VBox/Devices/Storage/DrvHostDVD.cpp

    r82968 r90791  
    408408     */
    409409    if (   *pu8ScsiSts == SCSI_STATUS_CHECK_CONDITION
    410         && VALID_PTR(pabSense)
     410        && RT_VALID_PTR(pabSense)
    411411        && cbSense > 0)
    412412    {
  • trunk/src/VBox/Devices/Storage/DrvSCSI.cpp

    r82968 r90791  
    12291229     */
    12301230    pThis->pDrvMedia = PDMIBASE_QUERY_INTERFACE(pThis->pDrvBase, PDMIMEDIA);
    1231     AssertMsgReturn(VALID_PTR(pThis->pDrvMedia), ("VSCSI configuration error: No media interface!\n"),
     1231    AssertMsgReturn(RT_VALID_PTR(pThis->pDrvMedia), ("VSCSI configuration error: No media interface!\n"),
    12321232                    VERR_PDM_MISSING_INTERFACE);
    12331233
    12341234    /* Query the extended media interface. */
    12351235    pThis->pDrvMediaEx = PDMIBASE_QUERY_INTERFACE(pThis->pDrvBase, PDMIMEDIAEX);
    1236     AssertMsgReturn(VALID_PTR(pThis->pDrvMediaEx), ("VSCSI configuration error: No extended media interface!\n"),
     1236    AssertMsgReturn(RT_VALID_PTR(pThis->pDrvMediaEx), ("VSCSI configuration error: No extended media interface!\n"),
    12371237                    VERR_PDM_MISSING_INTERFACE);
    12381238
     
    14311431     */
    14321432    pThis->pDrvMedia = PDMIBASE_QUERY_INTERFACE(pThis->pDrvBase, PDMIMEDIA);
    1433     AssertMsgReturn(VALID_PTR(pThis->pDrvMedia), ("VSCSI configuration error: No media interface!\n"),
     1433    AssertMsgReturn(RT_VALID_PTR(pThis->pDrvMedia), ("VSCSI configuration error: No media interface!\n"),
    14341434                    VERR_PDM_MISSING_INTERFACE);
    14351435
    14361436    /* Query the extended media interface. */
    14371437    pThis->pDrvMediaEx = PDMIBASE_QUERY_INTERFACE(pThis->pDrvBase, PDMIMEDIAEX);
    1438     AssertMsgReturn(VALID_PTR(pThis->pDrvMediaEx), ("VSCSI configuration error: No extended media interface!\n"),
     1438    AssertMsgReturn(RT_VALID_PTR(pThis->pDrvMediaEx), ("VSCSI configuration error: No extended media interface!\n"),
    14391439                    VERR_PDM_MISSING_INTERFACE);
    14401440
  • trunk/src/VBox/Devices/Storage/DrvVD.cpp

    r82968 r90791  
    27212721        void *pvBuf = RTSgBufGetNextSegment(pIoReq->ReadWrite.pSgBuf, &cbReqIo);
    27222722
    2723         Assert(cbReqIo > 0 && VALID_PTR(pvBuf));
     2723        Assert(cbReqIo > 0 && RT_VALID_PTR(pvBuf));
    27242724        rc = VDRead(pThis->pDisk, pIoReq->ReadWrite.offStart, pvBuf, cbReqIo);
    27252725        if (RT_SUCCESS(rc))
     
    27702770        void *pvBuf = RTSgBufGetNextSegment(pIoReq->ReadWrite.pSgBuf, &cbReqIo);
    27712771
    2772         Assert(cbReqIo > 0 && VALID_PTR(pvBuf));
     2772        Assert(cbReqIo > 0 && RT_VALID_PTR(pvBuf));
    27732773        rc = VDWrite(pThis->pDisk, pIoReq->ReadWrite.offStart, pvBuf, cbReqIo);
    27742774        if (RT_SUCCESS(rc))
  • trunk/src/VBox/Devices/Storage/UsbMsd.cpp

    r87119 r90791  
    12591259    PUSBMSD pThis = PDMINS_2_DATA(pUsbIns, PUSBMSD);
    12601260
    1261     if (   VALID_PTR(pThis->pReq)
     1261    if (   RT_VALID_PTR(pThis->pReq)
    12621262        && pThis->pReq->enmState == USBMSDREQSTATE_EXECUTING)
    12631263        return false;
  • trunk/src/VBox/Devices/USB/VUSBInternal.h

    r90049 r90791  
    617617#ifdef VBOX_STRICT
    618618# define vusbUrbAssert(pUrb) do { \
    619     AssertMsg(VALID_PTR((pUrb)),  ("%p\n", (pUrb))); \
     619    AssertPtr((pUrb)); \
    620620    AssertMsg((pUrb)->u32Magic == VUSBURB_MAGIC, ("%#x", (pUrb)->u32Magic)); \
    621621    AssertMsg((pUrb)->enmState > VUSBURBSTATE_INVALID && (pUrb)->enmState < VUSBURBSTATE_END, \
  • trunk/src/VBox/Devices/USB/darwin/USBProxyDevice-darwin.cpp

    r87419 r90791  
    450450
    451451    IOReturn irc = (*pIf->ppIfI)->LowLatencyCreateBuffer(pIf->ppIfI, &pNew->pvBuffer, 8192 * RT_ELEMENTS(pNew->aBuffers), enmLLType);
    452     if (irc == kIOReturnSuccess != VALID_PTR(pNew->pvBuffer))
     452    if ((irc == kIOReturnSuccess) != RT_VALID_PTR(pNew->pvBuffer))
    453453    {
    454454        AssertPtr(pNew->pvBuffer);
     
    458458    {
    459459        irc = (*pIf->ppIfI)->LowLatencyCreateBuffer(pIf->ppIfI, &pNew->pvFrames, PAGE_SIZE, kUSBLowLatencyFrameListBuffer);
    460         if (irc == kIOReturnSuccess != VALID_PTR(pNew->pvFrames))
     460        if ((irc == kIOReturnSuccess) != RT_VALID_PTR(pNew->pvFrames))
    461461        {
    462462            AssertPtr(pNew->pvFrames);
  • trunk/src/VBox/Devices/VirtIO/VirtioCore.h

    r86407 r90791  
    652652{
    653653    AssertPtr(pGcSgBuf);
    654     Assert((cSegs > 0 && VALID_PTR(paSegs)) || (!cSegs && !paSegs));
     654    Assert((cSegs > 0 && RT_VALID_PTR(paSegs)) || (!cSegs && !paSegs));
    655655    Assert(cSegs < (~(unsigned)0 >> 1));
    656656
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