VirtualBox

Changeset 90794 in vbox


Ignore:
Timestamp:
Aug 23, 2021 1:16:11 PM (3 years ago)
Author:
vboxsync
Message:

*: More VALID_PTR -> RT_VALID_PTR/AssertPtr.

Location:
trunk/src/VBox
Files:
19 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/common/VBoxControl/testcase/tstVBoxControl.cpp

    r82968 r90794  
    8888    static char szValue[] = "Value";
    8989    static char szFlags[] = "TRANSIENT";
    90     if (VALID_PTR(ppszValue))
     90    if (ppszValue)
    9191        *ppszValue = szValue;
    92     if (VALID_PTR(pu64Timestamp))
     92    if (pu64Timestamp)
    9393        *pu64Timestamp = 12345;
    94     if (VALID_PTR(ppszFlags))
     94    if (ppszFlags)
    9595        *ppszFlags = szFlags;
    96     if (VALID_PTR(pcbBufActual))
     96    if (pcbBufActual)
    9797        *pcbBufActual = 256;
    9898    return VINF_SUCCESS;
     
    129129    static char szFlags[] = "TRANSIENT";
    130130    *ppHandle = &Handle;
    131     if (VALID_PTR(ppszName))
     131    if (ppszName)
    132132        *ppszName = szName;
    133     if (VALID_PTR(ppszValue))
     133    if (ppszValue)
    134134        *ppszValue = szValue;
    135     if (VALID_PTR(pu64Timestamp))
     135    if (pu64Timestamp)
    136136        *pu64Timestamp = 12345;
    137     if (VALID_PTR(ppszFlags))
     137    if (ppszFlags)
    138138        *ppszFlags = szFlags;
    139139    return VINF_SUCCESS;
     
    148148    RT_NOREF1(pHandle);
    149149    RTPrintf("Called enumerate next...\n");
    150     AssertReturn(VALID_PTR(ppszName) || VALID_PTR(ppszValue) || VALID_PTR(ppszFlags),
     150    AssertReturn(RT_VALID_PTR(ppszName) || RT_VALID_PTR(ppszValue) || RT_VALID_PTR(ppszFlags),
    151151                 VERR_INVALID_POINTER);
    152     if (VALID_PTR(ppszName))
     152    if (ppszName)
    153153        *ppszName = NULL;
    154     if (VALID_PTR(ppszValue))
     154    if (ppszValue)
    155155        *ppszValue = NULL;
    156     if (VALID_PTR(pu64Timestamp))
     156    if (pu64Timestamp)
    157157        *pu64Timestamp = 0;
    158     if (VALID_PTR(ppszFlags))
     158    if (ppszFlags)
    159159        *ppszFlags = NULL;
    160160    return VINF_SUCCESS;
     
    191191    static char szValue[] = "Value";
    192192    static char szFlags[] = "TRANSIENT";
    193     if (VALID_PTR(ppszName))
     193    if (ppszName)
    194194        *ppszName = szName;
    195     if (VALID_PTR(ppszValue))
     195    if (ppszValue)
    196196        *ppszValue = szValue;
    197     if (VALID_PTR(pu64Timestamp))
     197    if (pu64Timestamp)
    198198        *pu64Timestamp = 12345;
    199     if (VALID_PTR(ppszFlags))
     199    if (ppszFlags)
    200200        *ppszFlags = szFlags;
    201     if (VALID_PTR(pcbBufActual))
     201    if (pcbBufActual)
    202202        *pcbBufActual = 256;
    203203    return VINF_SUCCESS;
  • trunk/src/VBox/Additions/common/VBoxGuest/VBoxDev-haiku.c

    r82968 r90794  
    162162     * Close the session if it's still hanging on to the device...
    163163     */
    164     if (VALID_PTR(pSession))
     164    if (RT_VALID_PTR(pSession))
    165165    {
    166166        VGDrvCommonCloseSession(&g_DevExt, pSession);
     
    191191     * Validate the input.
    192192     */
    193     if (RT_UNLIKELY(!VALID_PTR(pSession)))
     193    if (RT_UNLIKELY(!RT_VALID_PTR(pSession)))
    194194        return EINVAL;
    195195
     
    233233            return EFAULT;
    234234        }
    235         if (RT_UNLIKELY(!VALID_PTR(pvBuf)))
     235        if (RT_UNLIKELY(!RT_VALID_PTR(pvBuf)))
    236236        {
    237237            RTMemTmpFree(pvBuf);
  • trunk/src/VBox/Additions/common/VBoxGuest/VBoxGuest-freebsd.c

    r82968 r90794  
    289289     * Close the session if it's still hanging on to the device...
    290290     */
    291     if (VALID_PTR(pSession))
     291    if (RT_VALID_PTR(pSession))
    292292    {
    293293        VGDrvCommonCloseSession(&g_DevExt, pSession);
     
    518518
    519519    PVBOXGUESTSESSION pSession = (PVBOXGUESTSESSION)pDev->si_drv1;
    520     if (RT_UNLIKELY(!VALID_PTR(pSession))) {
     520    if (RT_UNLIKELY(!RT_VALID_PTR(pSession))) {
    521521        Log(("vgdrvFreeBSDPoll: no state data for %s\n", devtoname(pDev)));
    522522        return (fEvents & (POLLHUP|POLLIN|POLLRDNORM|POLLOUT|POLLWRNORM));
  • trunk/src/VBox/Additions/linux/drm/indent.sed

    r85125 r90794  
    113113s/\bUINT32_C\b(\(.*\))/\1u/g
    114114s/!VALID_PTR(/WARN_ON(!/g
     115s/!RT_VALID_PTR(/WARN_ON(!/g
    115116s/\bRT_UNTRUSTED_VOLATILE_HOST\b//g
    116117s/\bRT_UNTRUSTED_VOLATILE_GUEST\b//g
  • trunk/src/VBox/Additions/os2/VBoxSF/VBoxSFInit.cpp

    r79113 r90794  
    8888     */
    8989    if (    g_VBoxGuestIDC.u32Version == VBGL_IOC_VERSION
    90         &&  VALID_PTR(g_VBoxGuestIDC.u32Session)
    91         &&  VALID_PTR(g_VBoxGuestIDC.pfnServiceEP))
     90        &&  RT_VALID_PTR(g_VBoxGuestIDC.u32Session)
     91        &&  RT_VALID_PTR(g_VBoxGuestIDC.pfnServiceEP))
    9292    {
    9393        int rc = RTR0Init(0);
  • trunk/src/VBox/Additions/x11/vboxvideo/VBoxVideoIPRT.h

    r85123 r90794  
    131131#define RT_UOFFSETOF(type, member) offsetof(type, member)
    132132#define RT_ZERO(Obj)        RT_BZERO(&(Obj), sizeof(Obj))
    133 #define VALID_PTR(ptr)    (   (uintptr_t)(ptr) + 0x1000U >= 0x2000U )
     133#define RT_VALID_PTR(ptr)  (   (uintptr_t)(ptr) + 0x1000U >= 0x2000U )
     134#define VALID_PTR(ptr)     RT_VALID_PTR(ptr)
    134135#ifndef INT16_C
    135136# define INT16_C(Value) (Value)
  • trunk/src/VBox/GuestHost/SharedClipboard/clipboard-x11.cpp

    r89947 r90794  
    495495{
    496496    AssertPtrReturn(pCtx, NIL_CLIPX11FORMAT);
    497     AssertReturn(VALID_PTR(paIdxFmtTargets) || cTargets == 0, NIL_CLIPX11FORMAT);
     497    AssertReturn(RT_VALID_PTR(paIdxFmtTargets) || cTargets == 0, NIL_CLIPX11FORMAT);
    498498
    499499    SHCLX11FMTIDX idxFmtText = NIL_CLIPX11FORMAT;
     
    530530{
    531531    AssertPtrReturn(pCtx, NIL_CLIPX11FORMAT);
    532     AssertReturn(VALID_PTR(paIdxFmtTargets) || cTargets == 0, NIL_CLIPX11FORMAT);
     532    AssertReturn(RT_VALID_PTR(paIdxFmtTargets) || cTargets == 0, NIL_CLIPX11FORMAT);
    533533
    534534    SHCLX11FMTIDX idxFmtBmp = NIL_CLIPX11FORMAT;
     
    564564{
    565565    AssertPtrReturn(pCtx, NIL_CLIPX11FORMAT);
    566     AssertReturn(VALID_PTR(paIdxFmtTargets) || cTargets == 0, NIL_CLIPX11FORMAT);
     566    AssertReturn(RT_VALID_PTR(paIdxFmtTargets) || cTargets == 0, NIL_CLIPX11FORMAT);
    567567
    568568    SHCLX11FMTIDX idxFmtHTML = NIL_CLIPX11FORMAT;
     
    599599{
    600600    AssertPtrReturn(pCtx, NIL_CLIPX11FORMAT);
    601     AssertReturn(VALID_PTR(paIdxFmtTargets) || cTargets == 0, NIL_CLIPX11FORMAT);
     601    AssertReturn(RT_VALID_PTR(paIdxFmtTargets) || cTargets == 0, NIL_CLIPX11FORMAT);
    602602
    603603    SHCLX11FMTIDX idxFmtURI = NIL_CLIPX11FORMAT;
  • trunk/src/VBox/HostServices/GuestControl/testcase/tstGuestControlSvc.cpp

    r82968 r90794  
    102102{
    103103    int rc = VINF_SUCCESS;
    104     if (!VALID_PTR(pTable->pfnHostCall))
     104    if (!RT_VALID_PTR(pTable->pfnHostCall))
    105105    {
    106106        RTTestPrintf(g_hTest, RTTESTLVL_FAILURE, "Invalid pfnHostCall() pointer\n");
  • trunk/src/VBox/Runtime/common/string/utf-16-latin-1.cpp

    r82968 r90794  
    185185     * Validate input.
    186186     */
    187     Assert(VALID_PTR(ppszString));
    188     Assert(VALID_PTR(pwszString));
     187    AssertPtr(ppszString);
     188    AssertPtr(pwszString);
    189189    *ppszString = NULL;
    190190
     
    364364     * Validate input.
    365365     */
    366     Assert(VALID_PTR(ppwszString));
    367     Assert(VALID_PTR(pszString));
     366    AssertPtr(ppwszString);
     367    AssertPtr(pszString);
    368368    *ppwszString = NULL;
    369369
     
    406406     * Validate input.
    407407     */
    408     Assert(VALID_PTR(pszString));
    409     Assert(VALID_PTR(ppwsz));
    410     Assert(!pcwc || VALID_PTR(pcwc));
     408    AssertPtr(pszString);
     409    AssertPtr(ppwsz);
     410    AssertPtrNull(pcwc);
    411411
    412412    /*
  • trunk/src/VBox/Runtime/common/string/utf-16.cpp

    r82968 r90794  
    740740     * Validate input.
    741741     */
    742     Assert(VALID_PTR(ppszString));
    743     Assert(VALID_PTR(pwszString));
     742    AssertPtr(ppszString);
     743    AssertPtr(pwszString);
    744744    *ppszString = NULL;
    745745
     
    787787     * Validate input.
    788788     */
    789     Assert(VALID_PTR(ppszString));
    790     Assert(VALID_PTR(pwszString));
     789    AssertPtr(ppszString);
     790    AssertPtr(pwszString);
    791791    *ppszString = NULL;
    792792
     
    826826     * Validate input.
    827827     */
    828     Assert(VALID_PTR(ppszString));
    829     Assert(VALID_PTR(pwszString));
     828    AssertPtr(ppszString);
     829    AssertPtr(pwszString);
    830830    *ppszString = NULL;
    831831
  • trunk/src/VBox/Runtime/common/string/utf-8.cpp

    r82968 r90794  
    447447     * Validate input.
    448448     */
    449     Assert(VALID_PTR(pszString));
    450     Assert(VALID_PTR(ppaCps));
     449    AssertPtr(pszString);
     450    AssertPtr(ppaCps);
    451451    *ppaCps = NULL;
    452452
     
    488488     * Validate input.
    489489     */
    490     Assert(VALID_PTR(pszString));
    491     Assert(VALID_PTR(ppaCps));
    492     Assert(!pcCps || VALID_PTR(pcCps));
     490    AssertPtr(pszString);
     491    AssertPtr(ppaCps);
     492    AssertPtrNull(pcCps);
    493493
    494494    /*
     
    10071007     * Validate input.
    10081008     */
    1009     Assert(VALID_PTR(ppwszString));
    1010     Assert(VALID_PTR(pszString));
     1009    AssertPtr(ppwszString);
     1010    AssertPtr(pszString);
    10111011    *ppwszString = NULL;
    10121012
     
    10481048     * Validate input.
    10491049     */
    1050     Assert(VALID_PTR(ppwszString));
    1051     Assert(VALID_PTR(pszString));
     1050    AssertPtr(ppwszString);
     1051    AssertPtr(pszString);
    10521052    *ppwszString = NULL;
    10531053
     
    10901090     * Validate input.
    10911091     */
    1092     Assert(VALID_PTR(pszString));
    1093     Assert(VALID_PTR(ppwsz));
    1094     Assert(!pcwc || VALID_PTR(pcwc));
     1092    AssertPtr(pszString);
     1093    AssertPtr(ppwsz);
     1094    AssertPtrNull(pcwc);
    10951095
    10961096    /*
     
    11551155     * Validate input.
    11561156     */
    1157     Assert(VALID_PTR(pszString));
    1158     Assert(VALID_PTR(ppwsz));
    1159     Assert(!pcwc || VALID_PTR(pcwc));
     1157    AssertPtr(pszString);
     1158    AssertPtr(ppwsz);
     1159    AssertPtrNull(pcwc);
    11601160
    11611161    /*
     
    13111311     * Validate input.
    13121312     */
    1313     Assert(VALID_PTR(ppszString));
    1314     Assert(VALID_PTR(pszString));
     1313    AssertPtr(ppszString);
     1314    AssertPtr(pszString);
    13151315    *ppszString = NULL;
    13161316
     
    13501350     * Validate input.
    13511351     */
    1352     Assert(VALID_PTR(pszString));
    1353     Assert(VALID_PTR(ppsz));
    1354     Assert(!pcch || VALID_PTR(pcch));
     1352    AssertPtr(pszString);
     1353    AssertPtr(ppsz);
     1354    AssertPtrNull(pcch);
    13551355
    13561356    /*
     
    15041504     * Validate input.
    15051505     */
    1506     Assert(VALID_PTR(ppszString));
    1507     Assert(VALID_PTR(pszString));
     1506    AssertPtr(ppszString);
     1507    AssertPtr(pszString);
    15081508    *ppszString = NULL;
    15091509
     
    15461546     * Validate input.
    15471547     */
    1548     Assert(VALID_PTR(pszString));
    1549     Assert(VALID_PTR(ppsz));
    1550     Assert(!pcch || VALID_PTR(pcch));
     1548    AssertPtr(pszString);
     1549    AssertPtr(ppsz);
     1550    AssertPtrNull(pcch);
    15511551
    15521552    /*
  • trunk/src/VBox/Runtime/r0drv/freebsd/timer-r0drv-freebsd.c

    r82968 r90794  
    158158DECLINLINE(bool) rtTimerIsValid(PRTTIMER pTimer)
    159159{
    160     AssertReturn(VALID_PTR(pTimer), false);
     160    AssertPtrReturn(pTimer, false);
    161161    AssertReturn(pTimer->u32Magic == RTTIMER_MAGIC, false);
    162162    return true;
  • trunk/src/VBox/Runtime/r0drv/linux/alloc-r0drv-linux.c

    r90577 r90794  
    402402     * validate input.
    403403     */
    404     Assert(VALID_PTR(pPhys));
     404    AssertPtr(pPhys);
    405405    Assert(cb > 0);
    406406
  • trunk/src/VBox/Runtime/r0drv/nt/alloc-r0drv-nt.cpp

    r82968 r90794  
    101101     * validate input.
    102102     */
    103     Assert(VALID_PTR(pPhys));
     103    AssertPtr(pPhys);
    104104    Assert(cb > 0);
    105105
  • trunk/src/VBox/Runtime/r0drv/os2/timer-r0drv-os2.cpp

    r82968 r90794  
    196196DECLINLINE(bool) rtTimerIsValid(PRTTIMER pTimer)
    197197{
    198     AssertReturn(VALID_PTR(pTimer), false);
     198    AssertPtrReturn(pTimer, false);
    199199    AssertReturn(pTimer->u32Magic == RTTIMER_MAGIC, false);
    200200    return true;
  • trunk/src/VBox/VMM/VMMR3/DBGFR3Bp.cpp

    r90310 r90794  
    11671167        DBGFBP hBp2 = DBGF_BP_INT3_L1_ENTRY_GET_BP_HND(u32Entry);
    11681168        PDBGFBPINT pBp2 = dbgfR3BpGetByHnd(pUVM, hBp2);
    1169         AssertStmt(VALID_PTR(pBp2), rc = VERR_DBGF_BP_IPE_7);
     1169        AssertStmt(RT_VALID_PTR(pBp2), rc = VERR_DBGF_BP_IPE_7);
    11701170        if (RT_SUCCESS(rc))
    11711171            rc = dbgfR3BpInt3L2BstCreate(pUVM, idxL1, u32Entry, hBp, GCPtr, hBp2, pBp2->Pub.u.Int3.GCPtr);
  • trunk/src/VBox/VMM/VMMR3/PGMDbg.cpp

    r90439 r90794  
    642642     * Validate and adjust the input a bit.
    643643     */
    644     if (!VALID_PTR(pGCPhysHit))
     644    if (!RT_VALID_PTR(pGCPhysHit))
    645645        return VERR_INVALID_POINTER;
    646646    *pGCPhysHit = NIL_RTGCPHYS;
    647647
    648     if (    !VALID_PTR(pabNeedle)
     648    if (    !RT_VALID_PTR(pabNeedle)
    649649        ||  GCPhys == NIL_RTGCPHYS)
    650650        return VERR_INVALID_POINTER;
     
    807807     * Validate and adjust the input a bit.
    808808     */
    809     if (!VALID_PTR(pGCPtrHit))
     809    if (!RT_VALID_PTR(pGCPtrHit))
    810810        return VERR_INVALID_POINTER;
    811811    *pGCPtrHit = 0;
    812812
    813     if (!VALID_PTR(pabNeedle))
     813    if (!RT_VALID_PTR(pabNeedle))
    814814        return VERR_INVALID_POINTER;
    815815    if (!cbNeedle)
  • trunk/src/VBox/VMM/VMMR3/VM.cpp

    r90785 r90794  
    583583    {
    584584        PVM pVM = pUVM->pVM = CreateVMReq.pVMR3;
    585         AssertRelease(VALID_PTR(pVM));
     585        AssertRelease(RT_VALID_PTR(pVM));
    586586        AssertRelease(pVM->pVMR0ForCall == CreateVMReq.pVMR0);
    587587        AssertRelease(pVM->pSession == pUVM->vm.s.pSession);
  • trunk/src/VBox/VMM/VMMRZ/PGMRZDynMap.cpp

    r86473 r90794  
    961961    {
    962962        uint8_t            *pbPage = (uint8_t *)RTR0MemObjAddress(pSeg->hMemObj);
    963         AssertMsg(VALID_PTR(pbPage) && !((uintptr_t)pbPage & PAGE_OFFSET_MASK), ("%p\n", pbPage));
     963        AssertMsg(RT_VALID_PTR(pbPage) && !((uintptr_t)pbPage & PAGE_OFFSET_MASK), ("%p\n", pbPage));
    964964        memset(pbPage, 0xfe, cPages << PAGE_SHIFT);
    965965
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