Changeset 90794 in vbox
- Timestamp:
- Aug 23, 2021 1:16:11 PM (3 years ago)
- Location:
- trunk/src/VBox
- Files:
-
- 19 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/common/VBoxControl/testcase/tstVBoxControl.cpp
r82968 r90794 88 88 static char szValue[] = "Value"; 89 89 static char szFlags[] = "TRANSIENT"; 90 if ( VALID_PTR(ppszValue))90 if (ppszValue) 91 91 *ppszValue = szValue; 92 if ( VALID_PTR(pu64Timestamp))92 if (pu64Timestamp) 93 93 *pu64Timestamp = 12345; 94 if ( VALID_PTR(ppszFlags))94 if (ppszFlags) 95 95 *ppszFlags = szFlags; 96 if ( VALID_PTR(pcbBufActual))96 if (pcbBufActual) 97 97 *pcbBufActual = 256; 98 98 return VINF_SUCCESS; … … 129 129 static char szFlags[] = "TRANSIENT"; 130 130 *ppHandle = &Handle; 131 if ( VALID_PTR(ppszName))131 if (ppszName) 132 132 *ppszName = szName; 133 if ( VALID_PTR(ppszValue))133 if (ppszValue) 134 134 *ppszValue = szValue; 135 if ( VALID_PTR(pu64Timestamp))135 if (pu64Timestamp) 136 136 *pu64Timestamp = 12345; 137 if ( VALID_PTR(ppszFlags))137 if (ppszFlags) 138 138 *ppszFlags = szFlags; 139 139 return VINF_SUCCESS; … … 148 148 RT_NOREF1(pHandle); 149 149 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), 151 151 VERR_INVALID_POINTER); 152 if ( VALID_PTR(ppszName))152 if (ppszName) 153 153 *ppszName = NULL; 154 if ( VALID_PTR(ppszValue))154 if (ppszValue) 155 155 *ppszValue = NULL; 156 if ( VALID_PTR(pu64Timestamp))156 if (pu64Timestamp) 157 157 *pu64Timestamp = 0; 158 if ( VALID_PTR(ppszFlags))158 if (ppszFlags) 159 159 *ppszFlags = NULL; 160 160 return VINF_SUCCESS; … … 191 191 static char szValue[] = "Value"; 192 192 static char szFlags[] = "TRANSIENT"; 193 if ( VALID_PTR(ppszName))193 if (ppszName) 194 194 *ppszName = szName; 195 if ( VALID_PTR(ppszValue))195 if (ppszValue) 196 196 *ppszValue = szValue; 197 if ( VALID_PTR(pu64Timestamp))197 if (pu64Timestamp) 198 198 *pu64Timestamp = 12345; 199 if ( VALID_PTR(ppszFlags))199 if (ppszFlags) 200 200 *ppszFlags = szFlags; 201 if ( VALID_PTR(pcbBufActual))201 if (pcbBufActual) 202 202 *pcbBufActual = 256; 203 203 return VINF_SUCCESS; -
trunk/src/VBox/Additions/common/VBoxGuest/VBoxDev-haiku.c
r82968 r90794 162 162 * Close the session if it's still hanging on to the device... 163 163 */ 164 if ( VALID_PTR(pSession))164 if (RT_VALID_PTR(pSession)) 165 165 { 166 166 VGDrvCommonCloseSession(&g_DevExt, pSession); … … 191 191 * Validate the input. 192 192 */ 193 if (RT_UNLIKELY(! VALID_PTR(pSession)))193 if (RT_UNLIKELY(!RT_VALID_PTR(pSession))) 194 194 return EINVAL; 195 195 … … 233 233 return EFAULT; 234 234 } 235 if (RT_UNLIKELY(! VALID_PTR(pvBuf)))235 if (RT_UNLIKELY(!RT_VALID_PTR(pvBuf))) 236 236 { 237 237 RTMemTmpFree(pvBuf); -
trunk/src/VBox/Additions/common/VBoxGuest/VBoxGuest-freebsd.c
r82968 r90794 289 289 * Close the session if it's still hanging on to the device... 290 290 */ 291 if ( VALID_PTR(pSession))291 if (RT_VALID_PTR(pSession)) 292 292 { 293 293 VGDrvCommonCloseSession(&g_DevExt, pSession); … … 518 518 519 519 PVBOXGUESTSESSION pSession = (PVBOXGUESTSESSION)pDev->si_drv1; 520 if (RT_UNLIKELY(! VALID_PTR(pSession))) {520 if (RT_UNLIKELY(!RT_VALID_PTR(pSession))) { 521 521 Log(("vgdrvFreeBSDPoll: no state data for %s\n", devtoname(pDev))); 522 522 return (fEvents & (POLLHUP|POLLIN|POLLRDNORM|POLLOUT|POLLWRNORM)); -
trunk/src/VBox/Additions/linux/drm/indent.sed
r85125 r90794 113 113 s/\bUINT32_C\b(\(.*\))/\1u/g 114 114 s/!VALID_PTR(/WARN_ON(!/g 115 s/!RT_VALID_PTR(/WARN_ON(!/g 115 116 s/\bRT_UNTRUSTED_VOLATILE_HOST\b//g 116 117 s/\bRT_UNTRUSTED_VOLATILE_GUEST\b//g -
trunk/src/VBox/Additions/os2/VBoxSF/VBoxSFInit.cpp
r79113 r90794 88 88 */ 89 89 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)) 92 92 { 93 93 int rc = RTR0Init(0); -
trunk/src/VBox/Additions/x11/vboxvideo/VBoxVideoIPRT.h
r85123 r90794 131 131 #define RT_UOFFSETOF(type, member) offsetof(type, member) 132 132 #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) 134 135 #ifndef INT16_C 135 136 # define INT16_C(Value) (Value) -
trunk/src/VBox/GuestHost/SharedClipboard/clipboard-x11.cpp
r89947 r90794 495 495 { 496 496 AssertPtrReturn(pCtx, NIL_CLIPX11FORMAT); 497 AssertReturn( VALID_PTR(paIdxFmtTargets) || cTargets == 0, NIL_CLIPX11FORMAT);497 AssertReturn(RT_VALID_PTR(paIdxFmtTargets) || cTargets == 0, NIL_CLIPX11FORMAT); 498 498 499 499 SHCLX11FMTIDX idxFmtText = NIL_CLIPX11FORMAT; … … 530 530 { 531 531 AssertPtrReturn(pCtx, NIL_CLIPX11FORMAT); 532 AssertReturn( VALID_PTR(paIdxFmtTargets) || cTargets == 0, NIL_CLIPX11FORMAT);532 AssertReturn(RT_VALID_PTR(paIdxFmtTargets) || cTargets == 0, NIL_CLIPX11FORMAT); 533 533 534 534 SHCLX11FMTIDX idxFmtBmp = NIL_CLIPX11FORMAT; … … 564 564 { 565 565 AssertPtrReturn(pCtx, NIL_CLIPX11FORMAT); 566 AssertReturn( VALID_PTR(paIdxFmtTargets) || cTargets == 0, NIL_CLIPX11FORMAT);566 AssertReturn(RT_VALID_PTR(paIdxFmtTargets) || cTargets == 0, NIL_CLIPX11FORMAT); 567 567 568 568 SHCLX11FMTIDX idxFmtHTML = NIL_CLIPX11FORMAT; … … 599 599 { 600 600 AssertPtrReturn(pCtx, NIL_CLIPX11FORMAT); 601 AssertReturn( VALID_PTR(paIdxFmtTargets) || cTargets == 0, NIL_CLIPX11FORMAT);601 AssertReturn(RT_VALID_PTR(paIdxFmtTargets) || cTargets == 0, NIL_CLIPX11FORMAT); 602 602 603 603 SHCLX11FMTIDX idxFmtURI = NIL_CLIPX11FORMAT; -
trunk/src/VBox/HostServices/GuestControl/testcase/tstGuestControlSvc.cpp
r82968 r90794 102 102 { 103 103 int rc = VINF_SUCCESS; 104 if (! VALID_PTR(pTable->pfnHostCall))104 if (!RT_VALID_PTR(pTable->pfnHostCall)) 105 105 { 106 106 RTTestPrintf(g_hTest, RTTESTLVL_FAILURE, "Invalid pfnHostCall() pointer\n"); -
trunk/src/VBox/Runtime/common/string/utf-16-latin-1.cpp
r82968 r90794 185 185 * Validate input. 186 186 */ 187 Assert (VALID_PTR(ppszString));188 Assert (VALID_PTR(pwszString));187 AssertPtr(ppszString); 188 AssertPtr(pwszString); 189 189 *ppszString = NULL; 190 190 … … 364 364 * Validate input. 365 365 */ 366 Assert (VALID_PTR(ppwszString));367 Assert (VALID_PTR(pszString));366 AssertPtr(ppwszString); 367 AssertPtr(pszString); 368 368 *ppwszString = NULL; 369 369 … … 406 406 * Validate input. 407 407 */ 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); 411 411 412 412 /* -
trunk/src/VBox/Runtime/common/string/utf-16.cpp
r82968 r90794 740 740 * Validate input. 741 741 */ 742 Assert (VALID_PTR(ppszString));743 Assert (VALID_PTR(pwszString));742 AssertPtr(ppszString); 743 AssertPtr(pwszString); 744 744 *ppszString = NULL; 745 745 … … 787 787 * Validate input. 788 788 */ 789 Assert (VALID_PTR(ppszString));790 Assert (VALID_PTR(pwszString));789 AssertPtr(ppszString); 790 AssertPtr(pwszString); 791 791 *ppszString = NULL; 792 792 … … 826 826 * Validate input. 827 827 */ 828 Assert (VALID_PTR(ppszString));829 Assert (VALID_PTR(pwszString));828 AssertPtr(ppszString); 829 AssertPtr(pwszString); 830 830 *ppszString = NULL; 831 831 -
trunk/src/VBox/Runtime/common/string/utf-8.cpp
r82968 r90794 447 447 * Validate input. 448 448 */ 449 Assert (VALID_PTR(pszString));450 Assert (VALID_PTR(ppaCps));449 AssertPtr(pszString); 450 AssertPtr(ppaCps); 451 451 *ppaCps = NULL; 452 452 … … 488 488 * Validate input. 489 489 */ 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); 493 493 494 494 /* … … 1007 1007 * Validate input. 1008 1008 */ 1009 Assert (VALID_PTR(ppwszString));1010 Assert (VALID_PTR(pszString));1009 AssertPtr(ppwszString); 1010 AssertPtr(pszString); 1011 1011 *ppwszString = NULL; 1012 1012 … … 1048 1048 * Validate input. 1049 1049 */ 1050 Assert (VALID_PTR(ppwszString));1051 Assert (VALID_PTR(pszString));1050 AssertPtr(ppwszString); 1051 AssertPtr(pszString); 1052 1052 *ppwszString = NULL; 1053 1053 … … 1090 1090 * Validate input. 1091 1091 */ 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); 1095 1095 1096 1096 /* … … 1155 1155 * Validate input. 1156 1156 */ 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); 1160 1160 1161 1161 /* … … 1311 1311 * Validate input. 1312 1312 */ 1313 Assert (VALID_PTR(ppszString));1314 Assert (VALID_PTR(pszString));1313 AssertPtr(ppszString); 1314 AssertPtr(pszString); 1315 1315 *ppszString = NULL; 1316 1316 … … 1350 1350 * Validate input. 1351 1351 */ 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); 1355 1355 1356 1356 /* … … 1504 1504 * Validate input. 1505 1505 */ 1506 Assert (VALID_PTR(ppszString));1507 Assert (VALID_PTR(pszString));1506 AssertPtr(ppszString); 1507 AssertPtr(pszString); 1508 1508 *ppszString = NULL; 1509 1509 … … 1546 1546 * Validate input. 1547 1547 */ 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); 1551 1551 1552 1552 /* -
trunk/src/VBox/Runtime/r0drv/freebsd/timer-r0drv-freebsd.c
r82968 r90794 158 158 DECLINLINE(bool) rtTimerIsValid(PRTTIMER pTimer) 159 159 { 160 Assert Return(VALID_PTR(pTimer), false);160 AssertPtrReturn(pTimer, false); 161 161 AssertReturn(pTimer->u32Magic == RTTIMER_MAGIC, false); 162 162 return true; -
trunk/src/VBox/Runtime/r0drv/linux/alloc-r0drv-linux.c
r90577 r90794 402 402 * validate input. 403 403 */ 404 Assert (VALID_PTR(pPhys));404 AssertPtr(pPhys); 405 405 Assert(cb > 0); 406 406 -
trunk/src/VBox/Runtime/r0drv/nt/alloc-r0drv-nt.cpp
r82968 r90794 101 101 * validate input. 102 102 */ 103 Assert (VALID_PTR(pPhys));103 AssertPtr(pPhys); 104 104 Assert(cb > 0); 105 105 -
trunk/src/VBox/Runtime/r0drv/os2/timer-r0drv-os2.cpp
r82968 r90794 196 196 DECLINLINE(bool) rtTimerIsValid(PRTTIMER pTimer) 197 197 { 198 Assert Return(VALID_PTR(pTimer), false);198 AssertPtrReturn(pTimer, false); 199 199 AssertReturn(pTimer->u32Magic == RTTIMER_MAGIC, false); 200 200 return true; -
trunk/src/VBox/VMM/VMMR3/DBGFR3Bp.cpp
r90310 r90794 1167 1167 DBGFBP hBp2 = DBGF_BP_INT3_L1_ENTRY_GET_BP_HND(u32Entry); 1168 1168 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); 1170 1170 if (RT_SUCCESS(rc)) 1171 1171 rc = dbgfR3BpInt3L2BstCreate(pUVM, idxL1, u32Entry, hBp, GCPtr, hBp2, pBp2->Pub.u.Int3.GCPtr); -
trunk/src/VBox/VMM/VMMR3/PGMDbg.cpp
r90439 r90794 642 642 * Validate and adjust the input a bit. 643 643 */ 644 if (! VALID_PTR(pGCPhysHit))644 if (!RT_VALID_PTR(pGCPhysHit)) 645 645 return VERR_INVALID_POINTER; 646 646 *pGCPhysHit = NIL_RTGCPHYS; 647 647 648 if ( ! VALID_PTR(pabNeedle)648 if ( !RT_VALID_PTR(pabNeedle) 649 649 || GCPhys == NIL_RTGCPHYS) 650 650 return VERR_INVALID_POINTER; … … 807 807 * Validate and adjust the input a bit. 808 808 */ 809 if (! VALID_PTR(pGCPtrHit))809 if (!RT_VALID_PTR(pGCPtrHit)) 810 810 return VERR_INVALID_POINTER; 811 811 *pGCPtrHit = 0; 812 812 813 if (! VALID_PTR(pabNeedle))813 if (!RT_VALID_PTR(pabNeedle)) 814 814 return VERR_INVALID_POINTER; 815 815 if (!cbNeedle) -
trunk/src/VBox/VMM/VMMR3/VM.cpp
r90785 r90794 583 583 { 584 584 PVM pVM = pUVM->pVM = CreateVMReq.pVMR3; 585 AssertRelease( VALID_PTR(pVM));585 AssertRelease(RT_VALID_PTR(pVM)); 586 586 AssertRelease(pVM->pVMR0ForCall == CreateVMReq.pVMR0); 587 587 AssertRelease(pVM->pSession == pUVM->vm.s.pSession); -
trunk/src/VBox/VMM/VMMRZ/PGMRZDynMap.cpp
r86473 r90794 961 961 { 962 962 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)); 964 964 memset(pbPage, 0xfe, cPages << PAGE_SHIFT); 965 965
Note:
See TracChangeset
for help on using the changeset viewer.