Changeset 90803 in vbox for trunk/src/VBox/Runtime/common
- Timestamp:
- Aug 23, 2021 7:08:38 PM (3 years ago)
- Location:
- trunk/src/VBox/Runtime/common
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/common/dbg/dbgas.cpp
r82968 r90803 332 332 PRTDBGASMOD pMod = pDbgAs->papModules[i]; 333 333 AssertPtr(pMod); 334 if ( VALID_PTR(pMod))334 if (RT_VALID_PTR(pMod)) 335 335 { 336 336 Assert(pMod->iOrdinal == i); -
trunk/src/VBox/Runtime/common/fuzz/fuzz.cpp
r85121 r90803 2137 2137 rc = pMutator->pfnPrep(pThis, offStart, pMutationParent, &pMutation); 2138 2138 if ( RT_SUCCESS(rc) 2139 && VALID_PTR(pMutation))2139 && RT_VALID_PTR(pMutation)) 2140 2140 { 2141 2141 pMutation->pMutator = pMutator; -
trunk/src/VBox/Runtime/common/ldr/ldrEx.cpp
r90789 r90803 394 394 */ 395 395 AssertMsgReturn(rtldrIsValid(hLdrMod), ("hLdrMod=%p\n", hLdrMod), VERR_INVALID_HANDLE); 396 Assert MsgReturn(!pvBits || VALID_PTR(pvBits), ("pvBits=%p\n", pvBits), VERR_INVALID_PARAMETER);396 AssertPtrNullReturn(pvBits, VERR_INVALID_POINTER); 397 397 AssertPtrReturn(pfnCallback, VERR_INVALID_POINTER); 398 398 PRTLDRMODINTERNAL pMod = (PRTLDRMODINTERNAL)hLdrMod; … … 418 418 */ 419 419 AssertMsgReturn(rtldrIsValid(hLdrMod), ("hLdrMod=%p\n", hLdrMod), VERR_INVALID_HANDLE); 420 Assert MsgReturn(!pvBits || RT_VALID_PTR(pvBits), ("pvBits=%p\n", pvBits), VERR_INVALID_PARAMETER);420 AssertPtrNullReturn(pvBits, VERR_INVALID_POINTER); 421 421 AssertPtrReturn(pfnCallback, VERR_INVALID_POINTER); 422 422 PRTLDRMODINTERNAL pMod = (PRTLDRMODINTERNAL)hLdrMod; -
trunk/src/VBox/Runtime/common/log/log.cpp
r90693 r90803 799 799 */ 800 800 if ( (cGroups && !papszGroups) 801 || ! VALID_PTR(ppLogger) )801 || !RT_VALID_PTR(ppLogger) ) 802 802 { 803 803 AssertMsgFailed(("Invalid parameters!\n")); … … 997 997 998 998 /* Use the callback to generate some initial log contents. */ 999 Assert( VALID_PTR(pLogger->pInt->pfnPhase) || pLogger->pInt->pfnPhase == NULL);999 Assert(RT_VALID_PTR(pLogger->pInt->pfnPhase) || pLogger->pInt->pfnPhase == NULL); 1000 1000 if (pLogger->pInt->pfnPhase) 1001 1001 pLogger->pInt->pfnPhase(pLogger, RTLOGPHASE_BEGIN, rtlogPhaseMsgNormal); -
trunk/src/VBox/Runtime/common/log/tracelogwriter.cpp
r86387 r90803 899 899 900 900 if ( RT_SUCCESS(rc) 901 && VALID_PTR(pEvtDescInt))901 && RT_VALID_PTR(pEvtDescInt)) 902 902 { 903 903 TRACELOGEVT Evt; … … 933 933 934 934 if ( RT_SUCCESS(rc) 935 && VALID_PTR(pEvtDescInt))935 && RT_VALID_PTR(pEvtDescInt)) 936 936 { 937 937 TRACELOGEVT Evt; -
trunk/src/VBox/Runtime/common/misc/assert.cpp
r82968 r90803 224 224 "Expression: %s\n" 225 225 "Location : %s(%d) %s\n", 226 VALID_PTR(pszExpr) ? pszExpr : "<none>",227 VALID_PTR(pszFile) ? pszFile : "<none>",226 RT_VALID_PTR(pszExpr) ? pszExpr : "<none>", 227 RT_VALID_PTR(pszFile) ? pszFile : "<none>", 228 228 uLine, 229 VALID_PTR(pszFunction) ? pszFunction : "");229 RT_VALID_PTR(pszFunction) ? pszFunction : ""); 230 230 # ifdef IPRT_WITH_ASSERT_STACK 231 231 fprintf(stderr, "Stack :\n%s\n", szStack); -
trunk/src/VBox/Runtime/common/misc/lockvalidator.cpp
r87151 r90803 386 386 if (!pThread) 387 387 return "<NIL>"; 388 if (! VALID_PTR(pThread))388 if (!RT_VALID_PTR(pThread)) 389 389 return "<INVALID>"; 390 390 if (pThread->u32Magic != RTTHREADINT_MAGIC) … … 450 450 451 451 /* Validate the class pointer. */ 452 if (! VALID_PTR(pClass))452 if (!RT_VALID_PTR(pClass)) 453 453 { 454 454 RTAssertMsg2AddWeak("%sbad class=%p sub-class=%s\n", pszPrefix, pClass, pszSubClass); … … 538 538 if (!pClass) 539 539 return "<nil-class>"; 540 if (! VALID_PTR(pClass))540 if (!RT_VALID_PTR(pClass)) 541 541 return "<bad-class-ptr>"; 542 542 if (pClass->u32Magic != RTLOCKVALCLASS_MAGIC) … … 612 612 { 613 613 PRTLOCKVALRECSHRD pShared = pRec->ShrdOwner.pSharedRec; 614 if ( VALID_PTR(pShared)614 if ( RT_VALID_PTR(pShared) 615 615 && pShared->Core.u32Magic == RTLOCKVALRECSHRD_MAGIC) 616 616 #ifdef RTLOCKVAL_WITH_VERBOSE_DUMPS … … 660 660 # define FIX_REC(r) (r) 661 661 #endif 662 if ( VALID_PTR(pRec)662 if ( RT_VALID_PTR(pRec) 663 663 && !ASMAtomicUoReadBool(&g_fLockValidatorQuiet)) 664 664 { … … 683 683 PRTLOCKVALRECUNION pRealRec = pRec->Nest.pRec; 684 684 uint32_t u32Magic; 685 if ( VALID_PTR(pRealRec)685 if ( RT_VALID_PTR(pRealRec) 686 686 && ( (u32Magic = pRealRec->Core.u32Magic) == RTLOCKVALRECEXCL_MAGIC 687 687 || u32Magic == RTLOCKVALRECSHRD_MAGIC … … 720 720 PRTLOCKVALRECUNION pHighightRec) 721 721 { 722 if ( VALID_PTR(pThread)722 if ( RT_VALID_PTR(pThread) 723 723 && !ASMAtomicUoReadBool(&g_fLockValidatorQuiet) 724 724 && pThread->u32Magic == RTTHREADINT_MAGIC … … 731 731 pThread, pThread->szName, cEntries, cEntries == 1 ? "y" : "ies"); 732 732 PRTLOCKVALRECUNION pCur = rtLockValidatorReadRecUnionPtr(&pThread->LockValidator.pStackTop); 733 for (uint32_t i = 0; VALID_PTR(pCur); i++)733 for (uint32_t i = 0; RT_VALID_PTR(pCur); i++) 734 734 { 735 735 char szPrefix[80]; … … 771 771 RTAssertMsg1Weak("RTLockValidator", pSrcPos ? pSrcPos->uLine : 0, pSrcPos ? pSrcPos->pszFile : NULL, pSrcPos ? pSrcPos->pszFunction : NULL); 772 772 if (pSrcPos && pSrcPos->uId) 773 RTAssertMsg2Weak("%s [uId=%p thrd=%s]\n", pszWhat, pSrcPos->uId, VALID_PTR(pThreadSelf) ? pThreadSelf->szName : "<NIL>");773 RTAssertMsg2Weak("%s [uId=%p thrd=%s]\n", pszWhat, pSrcPos->uId, RT_VALID_PTR(pThreadSelf) ? pThreadSelf->szName : "<NIL>"); 774 774 else 775 RTAssertMsg2Weak("%s [thrd=%s]\n", pszWhat, VALID_PTR(pThreadSelf) ? pThreadSelf->szName : "<NIL>");775 RTAssertMsg2Weak("%s [thrd=%s]\n", pszWhat, RT_VALID_PTR(pThreadSelf) ? pThreadSelf->szName : "<NIL>"); 776 776 rtLockValComplainAboutLock("Lock: ", pRec, "\n"); 777 777 if (fDumpStack) … … 1591 1591 case RTLOCKVALRECNEST_MAGIC: 1592 1592 pRec = rtLockValidatorReadRecUnionPtr(&pRec->Nest.pRec); 1593 if ( VALID_PTR(pRec))1593 if (RT_VALID_PTR(pRec)) 1594 1594 { 1595 1595 switch (pRec->Core.u32Magic) … … 1633 1633 { 1634 1634 PRTLOCKVALRECSHRD pSharedRec = pRec->ShrdOwner.pSharedRec; 1635 if (RT_LIKELY( VALID_PTR(pSharedRec)1635 if (RT_LIKELY( RT_VALID_PTR(pSharedRec) 1636 1636 && pSharedRec->Core.u32Magic == RTLOCKVALRECSHRD_MAGIC)) 1637 1637 return pSharedRec->hClass; … … 1642 1642 { 1643 1643 PRTLOCKVALRECUNION pRealRec = pRec->Nest.pRec; 1644 if ( VALID_PTR(pRealRec))1644 if (RT_VALID_PTR(pRealRec)) 1645 1645 { 1646 1646 switch (pRealRec->Core.u32Magic) … … 1652 1652 { 1653 1653 PRTLOCKVALRECSHRD pSharedRec = pRealRec->ShrdOwner.pSharedRec; 1654 if (RT_LIKELY( VALID_PTR(pSharedRec)1654 if (RT_LIKELY( RT_VALID_PTR(pSharedRec) 1655 1655 && pSharedRec->Core.u32Magic == RTLOCKVALRECSHRD_MAGIC)) 1656 1656 return pSharedRec->hClass; … … 1702 1702 1703 1703 PRTLOCKVALRECSHRD pSharedRec = pRec->ShrdOwner.pSharedRec; 1704 if (RT_LIKELY( VALID_PTR(pSharedRec)1704 if (RT_LIKELY( RT_VALID_PTR(pSharedRec) 1705 1705 && pSharedRec->Core.u32Magic == RTLOCKVALRECSHRD_MAGIC)) 1706 1706 { … … 1717 1717 1718 1718 PRTLOCKVALRECUNION pRealRec = pRec->Nest.pRec; 1719 if ( VALID_PTR(pRealRec))1719 if (RT_VALID_PTR(pRealRec)) 1720 1720 { 1721 1721 switch (pRealRec->Core.u32Magic) … … 1728 1728 { 1729 1729 PRTLOCKVALRECSHRD pSharedRec = pRealRec->ShrdOwner.pSharedRec; 1730 if (RT_LIKELY( VALID_PTR(pSharedRec)1730 if (RT_LIKELY( RT_VALID_PTR(pSharedRec) 1731 1731 && pSharedRec->Core.u32Magic == RTLOCKVALRECSHRD_MAGIC)) 1732 1732 { … … 1774 1774 { 1775 1775 PRTLOCKVALRECSHRD pSharedRec = pRec->ShrdOwner.pSharedRec; 1776 if (RT_LIKELY( VALID_PTR(pSharedRec)1776 if (RT_LIKELY( RT_VALID_PTR(pSharedRec) 1777 1777 && pSharedRec->Core.u32Magic == RTLOCKVALRECSHRD_MAGIC)) 1778 1778 return pSharedRec->uSubClass; … … 1783 1783 { 1784 1784 PRTLOCKVALRECUNION pRealRec = pRec->Nest.pRec; 1785 if ( VALID_PTR(pRealRec))1785 if (RT_VALID_PTR(pRealRec)) 1786 1786 { 1787 1787 switch (pRealRec->Core.u32Magic) … … 1793 1793 { 1794 1794 PRTLOCKVALRECSHRD pSharedRec = pRealRec->ShrdOwner.pSharedRec; 1795 if (RT_LIKELY( VALID_PTR(pSharedRec)1795 if (RT_LIKELY( RT_VALID_PTR(pSharedRec) 1796 1796 && pSharedRec->Core.u32Magic == RTLOCKVALRECSHRD_MAGIC)) 1797 1797 return pSharedRec->uSubClass; … … 1826 1826 uint32_t cEntries = 0; 1827 1827 PRTLOCKVALRECUNION pCur = rtLockValidatorReadRecUnionPtr(&pThread->LockValidator.pStackTop); 1828 while ( VALID_PTR(pCur))1828 while (RT_VALID_PTR(pCur)) 1829 1829 { 1830 1830 switch (pCur->Core.u32Magic) … … 2870 2870 if (pStack->a[i].pRec->Core.u32Magic == RTLOCKVALRECSHRD_MAGIC) 2871 2871 pShrdOwner = (PRTLOCKVALRECUNION)pStack->a[i].pRec->Shared.papOwners[pStack->a[i].iEntry]; 2872 if ( VALID_PTR(pShrdOwner) && pShrdOwner->Core.u32Magic == RTLOCKVALRECSHRDOWN_MAGIC)2872 if (RT_VALID_PTR(pShrdOwner) && pShrdOwner->Core.u32Magic == RTLOCKVALRECSHRDOWN_MAGIC) 2873 2873 { 2874 2874 rtLockValComplainAboutLock(szPrefix, pShrdOwner, "\n"); … … 4333 4333 { 4334 4334 PRTLOCKVALRECUNION pCur = rtLockValidatorReadRecUnionPtr(&pThread->LockValidator.pStackTop); 4335 while ( VALID_PTR(pCur) && !fRet)4335 while (RT_VALID_PTR(pCur) && !fRet) 4336 4336 { 4337 4337 switch (pCur->Core.u32Magic) … … 4342 4342 break; 4343 4343 case RTLOCKVALRECSHRDOWN_MAGIC: 4344 fRet = VALID_PTR(pCur->ShrdOwner.pSharedRec)4344 fRet = RT_VALID_PTR(pCur->ShrdOwner.pSharedRec) 4345 4345 && pCur->ShrdOwner.pSharedRec->hClass == hClass; 4346 4346 pCur = rtLockValidatorReadRecUnionPtr(&pCur->ShrdOwner.pDown); … … 4353 4353 break; 4354 4354 case RTLOCKVALRECSHRDOWN_MAGIC: 4355 fRet = VALID_PTR(pCur->ShrdOwner.pSharedRec)4355 fRet = RT_VALID_PTR(pCur->ShrdOwner.pSharedRec) 4356 4356 && pCur->Nest.pRec->ShrdOwner.pSharedRec->hClass == hClass; 4357 4357 break; … … 4386 4386 { 4387 4387 PRTLOCKVALRECUNION pCur = rtLockValidatorReadRecUnionPtr(&pThread->LockValidator.pStackTop); 4388 while ( VALID_PTR(pCur) && !fRet)4388 while (RT_VALID_PTR(pCur) && !fRet) 4389 4389 { 4390 4390 switch (pCur->Core.u32Magic) … … 4396 4396 break; 4397 4397 case RTLOCKVALRECSHRDOWN_MAGIC: 4398 fRet = VALID_PTR(pCur->ShrdOwner.pSharedRec)4398 fRet = RT_VALID_PTR(pCur->ShrdOwner.pSharedRec) 4399 4399 && pCur->ShrdOwner.pSharedRec->hClass == hClass 4400 4400 && pCur->ShrdOwner.pSharedRec->uSubClass == uSubClass; … … 4409 4409 break; 4410 4410 case RTLOCKVALRECSHRDOWN_MAGIC: 4411 fRet = VALID_PTR(pCur->ShrdOwner.pSharedRec)4411 fRet = RT_VALID_PTR(pCur->ShrdOwner.pSharedRec) 4412 4412 && pCur->Nest.pRec->ShrdOwner.pSharedRec->hClass == hClass 4413 4413 && pCur->Nest.pRec->ShrdOwner.pSharedRec->uSubClass == uSubClass; -
trunk/src/VBox/Runtime/common/misc/sg.cpp
r89264 r90803 84 84 { 85 85 AssertPtr(pSgBuf); 86 Assert( (cSegs > 0 && VALID_PTR(paSegs))86 Assert( (cSegs > 0 && RT_VALID_PTR(paSegs)) 87 87 || (!cSegs && !paSegs)); 88 88 Assert(cSegs < (~(unsigned)0 >> 1)); -
trunk/src/VBox/Runtime/common/misc/thread.cpp
r90396 r90803 304 304 RTTHREAD Thread; 305 305 306 AssertReturn(!(fFlags & RTTHREADFLAGS_WAITABLE), VERR_INVALID_ PARAMETER);307 Assert Return(!pszName || VALID_PTR(pszName), VERR_INVALID_POINTER);308 Assert Return(!pThread || VALID_PTR(pThread), VERR_INVALID_POINTER);306 AssertReturn(!(fFlags & RTTHREADFLAGS_WAITABLE), VERR_INVALID_FLAGS); 307 AssertPtrNullReturn(pszName, VERR_INVALID_POINTER); 308 AssertPtrNullReturn(pThread, VERR_INVALID_POINTER); 309 309 310 310 rc = VINF_SUCCESS; … … 552 552 DECLHIDDEN(PRTTHREADINT) rtThreadGet(RTTHREAD Thread) 553 553 { 554 if ( 555 && 554 if ( Thread != NIL_RTTHREAD 555 && RT_VALID_PTR(Thread)) 556 556 { 557 557 PRTTHREADINT pThread = (PRTTHREADINT)Thread; -
trunk/src/VBox/Runtime/common/time/time.cpp
r82968 r90803 295 295 int iMonth; 296 296 297 Assert Msg(VALID_PTR(pTime), ("%p\n", pTime));298 Assert Msg(VALID_PTR(pTimeSpec), ("%p\n", pTime));297 AssertPtr(pTime); 298 AssertPtr(pTimeSpec); 299 299 300 300 /* … … 414 414 * Validate input. 415 415 */ 416 Assert Return(VALID_PTR(pTimeSpec), NULL);417 Assert Return(VALID_PTR(pTime), NULL);416 AssertPtrReturn(pTimeSpec, NULL); 417 AssertPtrReturn(pTime, NULL); 418 418 AssertReturn(pTime->u32Nanosecond < 1000000000, NULL); 419 419 AssertReturn(pTime->u8Second < 60, NULL); … … 696 696 * Validate that we've got the minimum of stuff handy. 697 697 */ 698 Assert Return(VALID_PTR(pTime), NULL);698 AssertPtrReturn(pTime, NULL); 699 699 AssertMsgReturn(!(pTime->fFlags & ~RTTIME_FLAGS_MASK), ("%#x\n", pTime->fFlags), NULL); 700 700 AssertMsgReturn((pTime->fFlags & RTTIME_FLAGS_TYPE_MASK) != RTTIME_FLAGS_TYPE_LOCAL, ("Use RTTimeLocalNormalize!\n"), NULL); … … 736 736 * Validate that we've got the minimum of stuff handy. 737 737 */ 738 Assert Return(VALID_PTR(pTime), NULL);738 AssertPtrReturn(pTime, NULL); 739 739 AssertMsgReturn(!(pTime->fFlags & ~RTTIME_FLAGS_MASK), ("%#x\n", pTime->fFlags), NULL); 740 740 AssertMsgReturn((pTime->fFlags & RTTIME_FLAGS_TYPE_MASK) != RTTIME_FLAGS_TYPE_UTC, ("Use RTTimeNormalize!\n"), NULL); … … 1554 1554 * Validate that we've got the minimum of stuff handy. 1555 1555 */ 1556 Assert Return(VALID_PTR(pTime), NULL);1556 AssertPtrReturn(pTime, NULL); 1557 1557 AssertMsgReturn(!(pTime->fFlags & ~RTTIME_FLAGS_MASK), ("%#x\n", pTime->fFlags), NULL); 1558 1558
Note:
See TracChangeset
for help on using the changeset viewer.