Changeset 40938 in vbox for trunk/src/VBox/Runtime/common
- Timestamp:
- Apr 16, 2012 11:58:26 AM (13 years ago)
- svn:sync-xref-src-repo-rev:
- 77489
- Location:
- trunk/src/VBox/Runtime/common
- Files:
-
- 32 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/common/alloc/heapoffset.cpp
r40930 r40938 508 508 static PRTHEAPOFFSETBLOCK rtHeapOffsetAllocBlock(PRTHEAPOFFSETINTERNAL pHeapInt, size_t cb, size_t uAlignment) 509 509 { 510 PRTHEAPOFFSETBLOCK pRet = (PRTHEAPOFFSETBLOCK)NULL;510 PRTHEAPOFFSETBLOCK pRet = NULL; 511 511 PRTHEAPOFFSETFREE pFree; 512 512 513 AssertReturn((pHeapInt)->u32Magic == RTHEAPOFFSET_MAGIC, (PRTHEAPOFFSETBLOCK)NULL);513 AssertReturn((pHeapInt)->u32Magic == RTHEAPOFFSET_MAGIC, NULL); 514 514 #ifdef RTHEAPOFFSET_STRICT 515 515 rtHeapOffsetAssertAll(pHeapInt); … … 704 704 * of us (both lists are sorted by address). 705 705 */ 706 pLeft = (PRTHEAPOFFSETFREE)NULL;707 pRight = (PRTHEAPOFFSETFREE)NULL;706 pLeft = NULL; 707 pRight = NULL; 708 708 if (pHeapInt->offFreeTail) 709 709 { … … 814 814 static void rtHeapOffsetAssertAll(PRTHEAPOFFSETINTERNAL pHeapInt) 815 815 { 816 PRTHEAPOFFSETFREE pPrev = (PRTHEAPOFFSETFREE)NULL;817 PRTHEAPOFFSETFREE pPrevFree = (PRTHEAPOFFSETFREE)NULL;816 PRTHEAPOFFSETFREE pPrev = NULL; 817 PRTHEAPOFFSETFREE pPrevFree = NULL; 818 818 PRTHEAPOFFSETFREE pBlock; 819 819 for (pBlock = (PRTHEAPOFFSETFREE)(pHeapInt + 1); -
trunk/src/VBox/Runtime/common/alloc/heapsimple.cpp
r40932 r40938 318 318 /* Init the single free block. */ 319 319 pFree = pHeapInt->pFreeHead; 320 pFree->Core.pNext = (PRTHEAPSIMPLEBLOCK)NULL;321 pFree->Core.pPrev = (PRTHEAPSIMPLEBLOCK)NULL;320 pFree->Core.pNext = NULL; 321 pFree->Core.pPrev = NULL; 322 322 pFree->Core.pHeap = pHeapInt; 323 323 pFree->Core.fFlags = RTHEAPSIMPLEBLOCK_FLAGS_MAGIC | RTHEAPSIMPLEBLOCK_FLAGS_FREE; 324 pFree->pNext = (PRTHEAPSIMPLEFREE)NULL;325 pFree->pPrev = (PRTHEAPSIMPLEFREE)NULL;324 pFree->pNext = NULL; 325 pFree->pPrev = NULL; 326 326 pFree->cb = pHeapInt->cbFree; 327 327 … … 476 476 static PRTHEAPSIMPLEBLOCK rtHeapSimpleAllocBlock(PRTHEAPSIMPLEINTERNAL pHeapInt, size_t cb, size_t uAlignment) 477 477 { 478 PRTHEAPSIMPLEBLOCK pRet = (PRTHEAPSIMPLEBLOCK)NULL;478 PRTHEAPSIMPLEBLOCK pRet = NULL; 479 479 PRTHEAPSIMPLEFREE pFree; 480 480 … … 533 533 pPrev = (PRTHEAPSIMPLEBLOCK)(pHeapInt + 1); 534 534 Assert(pPrev == &pFree->Core); 535 pPrev->pPrev = (PRTHEAPSIMPLEBLOCK)NULL;535 pPrev->pPrev = NULL; 536 536 pPrev->pNext = &pFree->Core; 537 537 pPrev->pHeap = pHeapInt; … … 696 696 * of us (both lists are sorted by address). 697 697 */ 698 pLeft = (PRTHEAPSIMPLEFREE)NULL;699 pRight = (PRTHEAPSIMPLEFREE)NULL;698 pLeft = NULL; 699 pRight = NULL; 700 700 if (pHeapInt->pFreeTail) 701 701 { … … 728 728 Assert(pRight == pHeapInt->pFreeHead); 729 729 pFree->Core.fFlags |= RTHEAPSIMPLEBLOCK_FLAGS_FREE; 730 pFree->pPrev = (PRTHEAPSIMPLEFREE)NULL;730 pFree->pPrev = NULL; 731 731 pFree->pNext = pRight; 732 732 if (pRight) … … 806 806 static void rtHeapSimpleAssertAll(PRTHEAPSIMPLEINTERNAL pHeapInt) 807 807 { 808 PRTHEAPSIMPLEFREE pPrev = (PRTHEAPSIMPLEFREE)NULL;809 PRTHEAPSIMPLEFREE pPrevFree = (PRTHEAPSIMPLEFREE)NULL;808 PRTHEAPSIMPLEFREE pPrev = NULL; 809 PRTHEAPSIMPLEFREE pPrevFree = NULL; 810 810 PRTHEAPSIMPLEFREE pBlock; 811 811 for (pBlock = (PRTHEAPSIMPLEFREE)(pHeapInt + 1); -
trunk/src/VBox/Runtime/common/log/log.cpp
r40933 r40938 440 440 return VERR_INVALID_PARAMETER; 441 441 } 442 *ppLogger = (PRTLOGGER)NULL;442 *ppLogger = NULL; 443 443 444 444 if (pszErrorMsg) … … 469 469 pLogger->pInt->cbSelf = sizeof(RTLOGGERINTERNAL); 470 470 pLogger->pInt->hSpinMtx = NIL_RTSEMSPINMUTEX; 471 pLogger->pInt->pfnFlush = (PFNRTLOGFLUSH)NULL;472 pLogger->pInt->pfnPrefix = (PFNRTLOGPREFIX)NULL;471 pLogger->pInt->pfnFlush = NULL; 472 pLogger->pInt->pfnPrefix = NULL; 473 473 pLogger->pInt->pvPrefixUserArg = NULL; 474 474 pLogger->pInt->afPadding1[0] = false; … … 480 480 pLogger->pInt->pacEntriesPerGroup = (uint32_t *)(pLogger->pInt + 1); 481 481 else 482 pLogger->pInt->pacEntriesPerGroup = (uint32_t *)NULL;482 pLogger->pInt->pacEntriesPerGroup = NULL; 483 483 pLogger->pInt->cMaxEntriesPerGroup = UINT32_MAX; 484 484 # ifdef IN_RING3 … … 670 670 va_start(args, pszFilenameFmt); 671 671 rc = RTLogCreateExV(ppLogger, fFlags, pszGroupSettings, pszEnvVarBase, cGroups, papszGroups, 672 fDestFlags, (PFNRTLOGPHASE)NULL /*pfnPhase*/, 0 /*cHistory*/, 0 /*cbHistoryFileMax*/, 0 /*cSecsHistoryTimeSlot*/,673 (char *)NULL /*pszErrorMsg*/, 0 /*cchErrorMsg*/, pszFilenameFmt, args);672 fDestFlags, NULL /*pfnPhase*/, 0 /*cHistory*/, 0 /*cbHistoryFileMax*/, 0 /*cSecsHistoryTimeSlot*/, 673 NULL /*pszErrorMsg*/, 0 /*cchErrorMsg*/, pszFilenameFmt, args); 674 674 va_end(args); 675 675 return rc; … … 779 779 RTMemExecFree(*(void **)&pLogger->pfnLogger, 64); 780 780 # endif 781 pLogger->pfnLogger = (PFNRTLOGGER)NULL;781 pLogger->pfnLogger = NULL; 782 782 } 783 783 RTMemFree(pLogger); … … 916 916 { 917 917 rtLogOutput(pLogger, pLoggerRC->achScratch, pLoggerRC->offScratch); 918 rtLogOutput(pLogger, (char *)NULL, 0);918 rtLogOutput(pLogger, NULL, 0); 919 919 pLoggerRC->offScratch = 0; 920 920 } … … 1174 1174 { 1175 1175 rtLogOutput(pDstLogger, pSrcLogger->achScratch, pSrcLogger->offScratch); 1176 rtLogOutput(pDstLogger, (char *)NULL, 0);1176 rtLogOutput(pDstLogger, NULL, 0); 1177 1177 pSrcLogger->offScratch = 0; 1178 1178 } … … 2586 2586 RTDECL(void) RTLogPrintfV(const char *pszFormat, va_list args) 2587 2587 { 2588 RTLogLoggerV( (PRTLOGGER)NULL, pszFormat, args);2588 RTLogLoggerV(NULL, pszFormat, args); 2589 2589 } 2590 2590 RT_EXPORT_SYMBOL(RTLogPrintfV); … … 3188 3188 const char *pszGroup = pArgs->iGroup != ~0U ? pLogger->pInt->papszGroups[pArgs->iGroup] : NULL; 3189 3189 #else 3190 const char *pszGroup = (char *)NULL;3190 const char *pszGroup = NULL; 3191 3191 #endif 3192 3192 psz = rtLogStPNCpyPad(psz, pszGroup, 16, 8); -
trunk/src/VBox/Runtime/common/log/logrel.cpp
r40933 r40938 142 142 RTDECL(void) RTLogRelPrintfV(const char *pszFormat, va_list args) 143 143 { 144 RTLogRelLoggerV( (PRTLOGGER)NULL, 0, ~0U, pszFormat, args);144 RTLogRelLoggerV(NULL, 0, ~0U, pszFormat, args); 145 145 } 146 146 RT_EXPORT_SYMBOL(RTLogRelPrintfV); -
trunk/src/VBox/Runtime/common/misc/handletable.cpp
r40934 r40938 93 93 pThis->papvLevel1 = (void **)((uint8_t *)pThis + RT_ALIGN(sizeof(*pThis), sizeof(void *))); 94 94 else 95 pThis->papvLevel1 = (void **)NULL;95 pThis->papvLevel1 = NULL; 96 96 pThis->pfnRetain = pfnRetain; 97 97 pThis->pvRetainUser = pvUser; … … 119 119 RTDECL(int) RTHandleTableCreate(PRTHANDLETABLE phHandleTable) 120 120 { 121 return RTHandleTableCreateEx(phHandleTable, RTHANDLETABLE_FLAGS_LOCKED, 1, 65534, (PFNRTHANDLETABLERETAIN)NULL, NULL);121 return RTHandleTableCreateEx(phHandleTable, RTHANDLETABLE_FLAGS_LOCKED, 1, 65534, NULL, NULL); 122 122 } 123 123 RT_EXPORT_SYMBOL(RTHandleTableCreate); -
trunk/src/VBox/Runtime/common/misc/handletable.h
r40934 r40938 166 166 return &paTable[i % RTHT_LEVEL2_ENTRIES]; 167 167 } 168 return (PRTHTENTRY)NULL;168 return NULL; 169 169 } 170 170 … … 198 198 return &paTable[i % RTHT_LEVEL2_ENTRIES]; 199 199 } 200 return (PRTHTENTRYCTX)NULL;200 return NULL; 201 201 } 202 202 -
trunk/src/VBox/Runtime/common/misc/handletablectx.cpp
r40934 r40938 121 121 */ 122 122 rc = VERR_TRY_AGAIN; 123 papvLevel1 = (void **)NULL;123 papvLevel1 = NULL; 124 124 if (cLevel1) 125 125 { -
trunk/src/VBox/Runtime/common/misc/handletablesimple.cpp
r40934 r40938 113 113 */ 114 114 rc = VERR_TRY_AGAIN; 115 void **papvLevel1 = (void **)NULL;115 void **papvLevel1 = NULL; 116 116 if (cLevel1) 117 117 { -
trunk/src/VBox/Runtime/common/misc/term.cpp
r40934 r40938 69 69 static uint32_t g_cCallbacks = 0; 70 70 /** The callback head. */ 71 static PRTTERMCALLBACKREC g_pCallbackHead = (PRTTERMCALLBACKREC)NULL;71 static PRTTERMCALLBACKREC g_pCallbackHead = NULL; 72 72 73 73 … … 161 161 * Search for the specified pfnCallback/pvUser pair. 162 162 */ 163 PRTTERMCALLBACKREC pPrev = (PRTTERMCALLBACKREC)NULL;163 PRTTERMCALLBACKREC pPrev = NULL; 164 164 PRTTERMCALLBACKREC pCur = g_pCallbackHead; 165 165 while (pCur) … … 175 175 RTSemFastMutexRelease(hFastMutex); 176 176 177 pCur->pfnCallback = (PFNRTTERMCALLBACK)NULL;177 pCur->pfnCallback = NULL; 178 178 RTMemFree(pCur); 179 179 return VINF_SUCCESS; -
trunk/src/VBox/Runtime/common/misc/thread.cpp
r40934 r40938 385 385 RTMemFree(pThread); 386 386 } 387 return (PRTTHREADINT)NULL;387 return NULL; 388 388 } 389 389 … … 538 538 539 539 AssertMsgFailed(("Thread=%RTthrd\n", Thread)); 540 return (PRTTHREADINT)NULL;540 return NULL; 541 541 } 542 542 … … 906 906 } 907 907 } 908 return (char *)NULL;908 return NULL; 909 909 } 910 910 RT_EXPORT_SYMBOL(RTThreadSelfName); … … 922 922 PRTTHREADINT pThread; 923 923 if (Thread == NIL_RTTHREAD) 924 return (char *)NULL;924 return NULL; 925 925 pThread = rtThreadGet(Thread); 926 926 if (pThread) … … 930 930 return szName; 931 931 } 932 return (char *)NULL;932 return NULL; 933 933 } 934 934 RT_EXPORT_SYMBOL(RTThreadGetName); -
trunk/src/VBox/Runtime/common/path/RTPathAbsDup.cpp
r40934 r40938 49 49 if (RT_SUCCESS(rc)) 50 50 return RTStrDup(szPath); 51 return (char *)NULL;51 return NULL; 52 52 } 53 53 -
trunk/src/VBox/Runtime/common/path/RTPathAbsExDup.cpp
r40934 r40938 53 53 if (RT_SUCCESS(rc)) 54 54 return RTStrDup(szPath); 55 return (char *)NULL;55 return NULL; 56 56 } 57 57 -
trunk/src/VBox/Runtime/common/path/RTPathExt.cpp
r40934 r40938 43 43 { 44 44 const char *psz = pszPath; 45 const char *pszExt = (char *)NULL;45 const char *pszExt = NULL; 46 46 47 47 for (;; psz++) … … 52 52 #if defined(RT_OS_WINDOWS) || defined(RT_OS_OS2) 53 53 case ':': 54 pszExt = (char *)NULL;54 pszExt = NULL; 55 55 break; 56 56 … … 58 58 #endif 59 59 case '/': 60 pszExt = (char *)NULL;60 pszExt = NULL; 61 61 break; 62 62 case '.': … … 68 68 if (pszExt) 69 69 return (char *)(void *)pszExt; 70 return (char *)NULL;70 return NULL; 71 71 } 72 72 } 73 73 74 74 /* will never get here */ 75 return (char *)NULL;75 return NULL; 76 76 } 77 77 -
trunk/src/VBox/Runtime/common/path/RTPathFilename.cpp
r40934 r40938 67 67 if (*pszName) 68 68 return (char *)(void *)pszName; 69 return (char *)NULL;69 return NULL; 70 70 } 71 71 } -
trunk/src/VBox/Runtime/common/path/RTPathParse.cpp
r40934 r40938 56 56 ssize_t offRoot = 0; 57 57 const char *pszName = pszPath; 58 const char *pszLastDot = (char *)NULL;58 const char *pszLastDot = NULL; 59 59 60 60 for (;; psz++) -
trunk/src/VBox/Runtime/common/path/RTPathRealDup.cpp
r40934 r40938 50 50 if (RT_SUCCESS(rc)) 51 51 return RTStrDup(szPath); 52 return (char *)NULL;52 return NULL; 53 53 } 54 54 -
trunk/src/VBox/Runtime/common/path/RTPathStripExt.cpp
r40934 r40938 42 42 RTDECL(void) RTPathStripExt(char *pszPath) 43 43 { 44 char *pszDot = (char *)NULL;44 char *pszDot = NULL; 45 45 for (;; pszPath++) 46 46 { … … 53 53 #endif 54 54 case '/': 55 pszDot = (char *)NULL;55 pszDot = NULL; 56 56 break; 57 57 case '.': -
trunk/src/VBox/Runtime/common/path/RTPathStripFilename.cpp
r40934 r40938 44 44 { 45 45 char *psz = pszPath; 46 char *pszLastSep = (char *)NULL;46 char *pszLastSep = NULL; 47 47 48 48 -
trunk/src/VBox/Runtime/common/rand/randparkmiller.cpp
r40934 r40938 152 152 153 153 /* u32Ctx */ 154 char *pszNext = (char *)NULL;154 char *pszNext = NULL; 155 155 uint32_t u32Ctx; 156 156 int rc = RTStrToUInt32Ex(pszState, &pszNext, 16, &u32Ctx); -
trunk/src/VBox/Runtime/common/string/straprintf.cpp
r40934 r40938 132 132 133 133 /* failure */ 134 pArg->psz = (char *)NULL;134 pArg->psz = NULL; 135 135 } 136 136 return 0; … … 153 153 Arg.pszTag = pszTag; 154 154 szBuf[0] = '\0'; 155 int cbRet = (int)RTStrFormatV(strallocoutput, &Arg, (PFNSTRFORMAT)NULL, NULL, pszFormat, args);155 int cbRet = (int)RTStrFormatV(strallocoutput, &Arg, NULL, NULL, pszFormat, args); 156 156 if (Arg.psz) 157 157 { … … 175 175 { 176 176 /* allocation error */ 177 *ppszBuffer = (char *)NULL;177 *ppszBuffer = NULL; 178 178 cbRet = -1; 179 179 -
trunk/src/VBox/Runtime/common/string/strformat.cpp
r40934 r40938 782 782 783 783 /* terminate the output */ 784 pfnOutput(pvArgOutput, (const char *)NULL, 0);784 pfnOutput(pvArgOutput, NULL, 0); 785 785 786 786 return cch; -
trunk/src/VBox/Runtime/common/string/strformatrt.cpp
r40934 r40938 346 346 return pfnOutput(pvArgOutput, s_szFalse, sizeof(s_szFalse) - 1); 347 347 /* invalid boolean value */ 348 return RTStrFormat(pfnOutput, pvArgOutput, (PFNSTRFORMAT)NULL, 0, "!%lld!", u.u64);348 return RTStrFormat(pfnOutput, pvArgOutput, NULL, 0, "!%lld!", u.u64); 349 349 } 350 350 … … 384 384 385 385 case RTSF_IPV4: 386 return RTStrFormat(pfnOutput, pvArgOutput, (PFNSTRFORMAT)NULL, 0,386 return RTStrFormat(pfnOutput, pvArgOutput, NULL, 0, 387 387 "%u.%u.%u.%u", 388 388 u.Ipv4Addr.au8[0], … … 394 394 { 395 395 if (VALID_PTR(u.pIpv6Addr)) 396 return RTStrFormat(pfnOutput, pvArgOutput, (PFNSTRFORMAT)NULL, 0,396 return RTStrFormat(pfnOutput, pvArgOutput, NULL, 0, 397 397 "%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x", 398 398 u.pIpv6Addr->au8[0], … … 418 418 { 419 419 if (VALID_PTR(u.pMac)) 420 return RTStrFormat(pfnOutput, pvArgOutput, (PFNSTRFORMAT)NULL, 0,420 return RTStrFormat(pfnOutput, pvArgOutput, NULL, 0, 421 421 "%02x:%02x:%02x:%02x:%02x:%02x", 422 422 u.pMac->au8[0], … … 437 437 case RTNETADDRTYPE_IPV4: 438 438 if (u.pNetAddr->uPort == RTNETADDR_PORT_NA) 439 return RTStrFormat(pfnOutput, pvArgOutput, (PFNSTRFORMAT)NULL, 0,439 return RTStrFormat(pfnOutput, pvArgOutput, NULL, 0, 440 440 "%u.%u.%u.%u", 441 441 u.pNetAddr->uAddr.IPv4.au8[0], … … 443 443 u.pNetAddr->uAddr.IPv4.au8[2], 444 444 u.pNetAddr->uAddr.IPv4.au8[3]); 445 return RTStrFormat(pfnOutput, pvArgOutput, (PFNSTRFORMAT)NULL, 0,445 return RTStrFormat(pfnOutput, pvArgOutput, NULL, 0, 446 446 "%u.%u.%u.%u:%u", 447 447 u.pNetAddr->uAddr.IPv4.au8[0], … … 453 453 case RTNETADDRTYPE_IPV6: 454 454 if (u.pNetAddr->uPort == RTNETADDR_PORT_NA) 455 return RTStrFormat(pfnOutput, pvArgOutput, (PFNSTRFORMAT)NULL, 0,455 return RTStrFormat(pfnOutput, pvArgOutput, NULL, 0, 456 456 "%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x", 457 457 u.pNetAddr->uAddr.IPv6.au8[0], … … 471 471 u.pNetAddr->uAddr.IPv6.au8[14], 472 472 u.pNetAddr->uAddr.IPv6.au8[15]); 473 return RTStrFormat(pfnOutput, pvArgOutput, (PFNSTRFORMAT)NULL, 0,473 return RTStrFormat(pfnOutput, pvArgOutput, NULL, 0, 474 474 "%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x %u", 475 475 u.pNetAddr->uAddr.IPv6.au8[0], … … 492 492 493 493 case RTNETADDRTYPE_MAC: 494 return RTStrFormat(pfnOutput, pvArgOutput, (PFNSTRFORMAT)NULL, 0,494 return RTStrFormat(pfnOutput, pvArgOutput, NULL, 0, 495 495 "%02x:%02x:%02x:%02x:%02x:%02x", 496 496 u.pNetAddr->uAddr.Mac.au8[0], … … 502 502 503 503 default: 504 return RTStrFormat(pfnOutput, pvArgOutput, (PFNSTRFORMAT)NULL, 0,504 return RTStrFormat(pfnOutput, pvArgOutput, NULL, 0, 505 505 "unsupported-netaddr-type=%u", u.pNetAddr->enmType); 506 506 … … 515 515 { 516 516 /* cannot call RTUuidToStr because of GC/R0. */ 517 return RTStrFormat(pfnOutput, pvArgOutput, (PFNSTRFORMAT)NULL, 0,517 return RTStrFormat(pfnOutput, pvArgOutput, NULL, 0, 518 518 "%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x", 519 519 u.pUuid->Gen.u32TimeLow, … … 664 664 { 665 665 int i; 666 cch += RTStrFormat(pfnOutput, pvArgOutput, (PFNSTRFORMAT)NULL, 0, "%s%0*x %04x:", off ? "\n" : "", sizeof(pu8) * 2, (uintptr_t)pu8, off);666 cch += RTStrFormat(pfnOutput, pvArgOutput, NULL, 0, "%s%0*x %04x:", off ? "\n" : "", sizeof(pu8) * 2, (uintptr_t)pu8, off); 667 667 for (i = 0; i < cchWidth && off + i < cchPrecision ; i++) 668 cch += RTStrFormat(pfnOutput, pvArgOutput, (PFNSTRFORMAT)NULL, 0,668 cch += RTStrFormat(pfnOutput, pvArgOutput, NULL, 0, 669 669 off + i < cchPrecision ? !(i & 7) && i ? "-%02x" : " %02x" : " ", pu8[i]); 670 670 while (i++ < cchWidth) … … 693 693 if (cchPrecision-- > 0) 694 694 { 695 cch = RTStrFormat(pfnOutput, pvArgOutput, (PFNSTRFORMAT)NULL, 0, "%02x", *pu8++);695 cch = RTStrFormat(pfnOutput, pvArgOutput, NULL, 0, "%02x", *pu8++); 696 696 for (; cchPrecision > 0; cchPrecision--, pu8++) 697 cch += RTStrFormat(pfnOutput, pvArgOutput, (PFNSTRFORMAT)NULL, 0, " %02x", *pu8);697 cch += RTStrFormat(pfnOutput, pvArgOutput, NULL, 0, " %02x", *pu8); 698 698 return cch; 699 699 } … … 728 728 return pfnOutput(pvArgOutput, pMsg->pszMsgFull,strlen(pMsg->pszMsgFull)); 729 729 case 'a': 730 return RTStrFormat(pfnOutput, pvArgOutput, (PFNSTRFORMAT)NULL, 0, "%s (0x%08X) - %s", pMsg->pszDefine, hrc, pMsg->pszMsgFull);730 return RTStrFormat(pfnOutput, pvArgOutput, NULL, 0, "%s (0x%08X) - %s", pMsg->pszDefine, hrc, pMsg->pszMsgFull); 731 731 default: 732 732 AssertMsgFailed(("Invalid status code format type '%.10s'!\n", pszFormatOrg)); … … 762 762 return pfnOutput(pvArgOutput, pMsg->pszMsgFull, strlen(pMsg->pszMsgFull)); 763 763 case 'a': 764 return RTStrFormat(pfnOutput, pvArgOutput, (PFNSTRFORMAT)NULL, 0, "%s (%d) - %s", pMsg->pszDefine, rc, pMsg->pszMsgFull);764 return RTStrFormat(pfnOutput, pvArgOutput, NULL, 0, "%s (%d) - %s", pMsg->pszDefine, rc, pMsg->pszMsgFull); 765 765 default: 766 766 AssertMsgFailed(("Invalid status code format type '%.10s'!\n", pszFormatOrg)); … … 774 774 case 'f': 775 775 case 'a': 776 return RTStrFormat(pfnOutput, pvArgOutput, (PFNSTRFORMAT)NULL, 0, "%d", rc);776 return RTStrFormat(pfnOutput, pvArgOutput, NULL, 0, "%d", rc); 777 777 default: 778 778 AssertMsgFailed(("Invalid status code format type '%.10s'!\n", pszFormatOrg)); … … 801 801 return pfnOutput(pvArgOutput, pMsg->pszMsgFull,strlen(pMsg->pszMsgFull)); 802 802 case 'a': 803 return RTStrFormat(pfnOutput, pvArgOutput, (PFNSTRFORMAT)NULL, 0, "%s (0x%08X) - %s", pMsg->pszDefine, rc, pMsg->pszMsgFull);803 return RTStrFormat(pfnOutput, pvArgOutput, NULL, 0, "%s (0x%08X) - %s", pMsg->pszDefine, rc, pMsg->pszMsgFull); 804 804 # else 805 805 case 'c': 806 806 case 'f': 807 807 case 'a': 808 return RTStrFormat(pfnOutput, pvArgOutput, (PFNSTRFORMAT)NULL, 0, "0x%08X", rc);808 return RTStrFormat(pfnOutput, pvArgOutput, NULL, 0, "0x%08X", rc); 809 809 # endif 810 810 default: … … 911 911 { 912 912 case RTST_TIMESPEC: 913 return RTStrFormat(pfnOutput, pvArgOutput, (PFNSTRFORMAT)NULL, NULL, "%'lld ns", RTTimeSpecGetNano(u.pTimeSpec));913 return RTStrFormat(pfnOutput, pvArgOutput, NULL, NULL, "%'lld ns", RTTimeSpecGetNano(u.pTimeSpec)); 914 914 915 915 default: -
trunk/src/VBox/Runtime/common/string/stringalloc.cpp
r40934 r40938 71 71 { 72 72 RTMemFree(pszOld); 73 *ppsz = (char *)NULL;73 *ppsz = NULL; 74 74 } 75 75 else if (pszOld) -
trunk/src/VBox/Runtime/common/string/strpbrk.cpp
r40934 r40938 60 60 61 61 } 62 return (char *)NULL;62 return NULL; 63 63 } 64 64 -
trunk/src/VBox/Runtime/common/string/strprintf.cpp
r40934 r40938 100 100 RTDECL(size_t) RTStrPrintfV(char *pszBuffer, size_t cchBuffer, const char *pszFormat, va_list args) 101 101 { 102 return RTStrPrintfExV( (PFNSTRFORMAT)NULL, NULL, pszBuffer, cchBuffer, pszFormat, args);102 return RTStrPrintfExV(NULL, NULL, pszBuffer, cchBuffer, pszFormat, args); 103 103 } 104 104 RT_EXPORT_SYMBOL(RTStrPrintfV); -
trunk/src/VBox/Runtime/common/string/strtonum.cpp
r40934 r40938 261 261 { 262 262 uint64_t u64; 263 int rc = RTStrToUInt64Ex(pszValue, (char **)NULL, 0, &u64);263 int rc = RTStrToUInt64Ex(pszValue, NULL, 0, &u64); 264 264 if (RT_SUCCESS(rc)) 265 265 return u64; … … 348 348 { 349 349 uint32_t u32; 350 int rc = RTStrToUInt32Ex(pszValue, (char **)NULL, 0, &u32);350 int rc = RTStrToUInt32Ex(pszValue, NULL, 0, &u32); 351 351 if (RT_SUCCESS(rc)) 352 352 return u32; … … 435 435 { 436 436 uint16_t u16; 437 int rc = RTStrToUInt16Ex(pszValue, (char **)NULL, 0, &u16);437 int rc = RTStrToUInt16Ex(pszValue, NULL, 0, &u16); 438 438 if (RT_SUCCESS(rc)) 439 439 return u16; … … 522 522 { 523 523 uint8_t u8; 524 int rc = RTStrToUInt8Ex(pszValue, (char **)NULL, 0, &u8);524 int rc = RTStrToUInt8Ex(pszValue, NULL, 0, &u8); 525 525 if (RT_SUCCESS(rc)) 526 526 return u8; … … 701 701 { 702 702 int64_t i64; 703 int rc = RTStrToInt64Ex(pszValue, (char **)NULL, 0, &i64);703 int rc = RTStrToInt64Ex(pszValue, NULL, 0, &i64); 704 704 if (RT_SUCCESS(rc)) 705 705 return i64; … … 788 788 { 789 789 int32_t i32; 790 int rc = RTStrToInt32Ex(pszValue, (char **)NULL, 0, &i32);790 int rc = RTStrToInt32Ex(pszValue, NULL, 0, &i32); 791 791 if (RT_SUCCESS(rc)) 792 792 return i32; … … 875 875 { 876 876 int16_t i16; 877 int rc = RTStrToInt16Ex(pszValue, (char **)NULL, 0, &i16);877 int rc = RTStrToInt16Ex(pszValue, NULL, 0, &i16); 878 878 if (RT_SUCCESS(rc)) 879 879 return i16; … … 962 962 { 963 963 int8_t i8; 964 int rc = RTStrToInt8Ex(pszValue, (char **)NULL, 0, &i8);964 int rc = RTStrToInt8Ex(pszValue, NULL, 0, &i8); 965 965 if (RT_SUCCESS(rc)) 966 966 return i8; -
trunk/src/VBox/Runtime/common/string/utf-16.cpp
r40934 r40938 464 464 Assert(VALID_PTR(ppszString)); 465 465 Assert(VALID_PTR(pwszString)); 466 *ppszString = (char *)NULL;466 *ppszString = NULL; 467 467 468 468 /* … … 529 529 else 530 530 { 531 *ppsz = (char *)NULL;531 *ppsz = NULL; 532 532 fShouldFree = true; 533 533 cch = RT_MAX(cch, cchResult + 1); … … 824 824 Assert(VALID_PTR(ppszString)); 825 825 Assert(VALID_PTR(pwszString)); 826 *ppszString = (char *)NULL;826 *ppszString = NULL; 827 827 828 828 /* … … 889 889 else 890 890 { 891 *ppsz = (char *)NULL;891 *ppsz = NULL; 892 892 fShouldFree = true; 893 893 cch = RT_MAX(cch, cchResult + 1); … … 1003 1003 Assert(VALID_PTR(ppwszString)); 1004 1004 Assert(VALID_PTR(pszString)); 1005 *ppwszString = (PRTUTF16)NULL;1005 *ppwszString = NULL; 1006 1006 1007 1007 /* … … 1071 1071 else 1072 1072 { 1073 *ppwsz = (PRTUTF16)NULL;1073 *ppwsz = NULL; 1074 1074 fShouldFree = true; 1075 1075 cwc = RT_MAX(cwcResult + 1, cwc); -
trunk/src/VBox/Runtime/common/string/utf-8.cpp
r40934 r40938 275 275 { 276 276 size_t cCodePoints; 277 int rc = rtUtf8Length(psz, RTSTR_MAX, &cCodePoints, (size_t *)NULL);277 int rc = rtUtf8Length(psz, RTSTR_MAX, &cCodePoints, NULL); 278 278 return RT_SUCCESS(rc) ? cCodePoints : 0; 279 279 } … … 284 284 { 285 285 size_t cCodePoints; 286 int rc = rtUtf8Length(psz, cch, &cCodePoints, (size_t *)NULL);286 int rc = rtUtf8Length(psz, cch, &cCodePoints, NULL); 287 287 if (pcCps) 288 288 *pcCps = RT_SUCCESS(rc) ? cCodePoints : 0; … … 390 390 Assert(VALID_PTR(pszString)); 391 391 Assert(VALID_PTR(ppaCps)); 392 *ppaCps = (PRTUNICP)NULL;392 *ppaCps = NULL; 393 393 394 394 /* … … 396 396 */ 397 397 size_t cCps; 398 int rc = rtUtf8Length(pszString, RTSTR_MAX, &cCps, (size_t *)NULL);398 int rc = rtUtf8Length(pszString, RTSTR_MAX, &cCps, NULL); 399 399 if (RT_SUCCESS(rc)) 400 400 { … … 437 437 */ 438 438 size_t cCpsResult; 439 int rc = rtUtf8Length(pszString, cchString, &cCpsResult, (size_t *)NULL);439 int rc = rtUtf8Length(pszString, cchString, &cCpsResult, NULL); 440 440 if (RT_SUCCESS(rc)) 441 441 { … … 457 457 else 458 458 { 459 *ppaCps = (PRTUNICP)NULL;459 *ppaCps = NULL; 460 460 fShouldFree = true; 461 461 cCps = RT_MAX(cCpsResult + 1, cCps); … … 711 711 Assert(VALID_PTR(ppwszString)); 712 712 Assert(VALID_PTR(pszString)); 713 *ppwszString = (PRTUTF16)NULL;713 *ppwszString = NULL; 714 714 715 715 /* … … 779 779 else 780 780 { 781 *ppwsz = (PRTUTF16)NULL;781 *ppwsz = NULL; 782 782 fShouldFree = true; 783 783 cwc = RT_MAX(cwcResult + 1, cwc); … … 901 901 Assert(VALID_PTR(ppszString)); 902 902 Assert(VALID_PTR(pszString)); 903 *ppszString = (char *)NULL;903 *ppszString = NULL; 904 904 905 905 /* … … 966 966 else 967 967 { 968 *ppsz = (char *)NULL;968 *ppsz = NULL; 969 969 fShouldFree = true; 970 970 cch = RT_MAX(cch, cchResult + 1); … … 1094 1094 Assert(VALID_PTR(ppszString)); 1095 1095 Assert(VALID_PTR(pszString)); 1096 *ppszString = (char *)NULL;1096 *ppszString = NULL; 1097 1097 1098 1098 /* … … 1162 1162 else 1163 1163 { 1164 *ppsz = (char *)NULL;1164 *ppsz = NULL; 1165 1165 fShouldFree = true; 1166 1166 cch = RT_MAX(cchResult + 1, cch); -
trunk/src/VBox/Runtime/common/table/avl_Base.cpp.h
r40934 r40938 118 118 # define KAVL_NULL 0 119 119 # else 120 # define KAVL_NULL ((PKAVLNODECORE)0)120 # define KAVL_NULL NULL 121 121 # endif 122 122 #endif … … 410 410 pDeleteNode = KAVL_GET_POINTER(ppDeleteNode); 411 411 else 412 return KAVL_NULL;412 return NULL; 413 413 414 414 kASSERT(AVLStack.cEntries < KAVL_MAX_STACK); -
trunk/src/VBox/Runtime/common/table/avl_Get.cpp.h
r40934 r40938 49 49 pNode = KAVL_GET_POINTER(&pNode->pLeft); 50 50 else 51 return KAVL_NULL;51 return NULL; 52 52 } 53 53 else … … 56 56 pNode = KAVL_GET_POINTER(&pNode->pRight); 57 57 else 58 return KAVL_NULL;58 return NULL; 59 59 } 60 60 } -
trunk/src/VBox/Runtime/common/table/avl_GetBestFit.cpp.h
r40934 r40938 47 47 if (pNode) 48 48 { 49 PKAVLNODECORE pNodeLast = KAVL_NULL;49 PKAVLNODECORE pNodeLast = NULL; 50 50 if (fAbove) 51 51 { /* pNode->Key >= Key */ -
trunk/src/VBox/Runtime/common/time/time.cpp
r40934 r40938 383 383 * Validate input. 384 384 */ 385 AssertReturn(VALID_PTR(pTimeSpec), (PRTTIMESPEC)NULL);386 AssertReturn(VALID_PTR(pTime), (PRTTIMESPEC)NULL);387 AssertReturn(pTime->u32Nanosecond < 1000000000, (PRTTIMESPEC)NULL);388 AssertReturn(pTime->u8Second < 60, (PRTTIMESPEC)NULL);389 AssertReturn(pTime->u8Minute < 60, (PRTTIMESPEC)NULL);390 AssertReturn(pTime->u8Hour < 24, (PRTTIMESPEC)NULL);391 AssertReturn(pTime->u16YearDay >= 1, (PRTTIMESPEC)NULL);392 AssertReturn(pTime->u16YearDay <= (rtTimeIsLeapYear(pTime->i32Year) ? 366 : 365), (PRTTIMESPEC)NULL);393 AssertMsgReturn(pTime->i32Year <= RTTIME_MAX_YEAR && pTime->i32Year >= RTTIME_MIN_YEAR, ("%RI32\n", pTime->i32Year), (PRTTIMESPEC)NULL);385 AssertReturn(VALID_PTR(pTimeSpec), NULL); 386 AssertReturn(VALID_PTR(pTime), NULL); 387 AssertReturn(pTime->u32Nanosecond < 1000000000, NULL); 388 AssertReturn(pTime->u8Second < 60, NULL); 389 AssertReturn(pTime->u8Minute < 60, NULL); 390 AssertReturn(pTime->u8Hour < 24, NULL); 391 AssertReturn(pTime->u16YearDay >= 1, NULL); 392 AssertReturn(pTime->u16YearDay <= (rtTimeIsLeapYear(pTime->i32Year) ? 366 : 365), NULL); 393 AssertMsgReturn(pTime->i32Year <= RTTIME_MAX_YEAR && pTime->i32Year >= RTTIME_MIN_YEAR, ("%RI32\n", pTime->i32Year), NULL); 394 394 395 395 /* … … 398 398 i32Days = g_aoffYear[pTime->i32Year - OFF_YEAR_IDX_0_YEAR] 399 399 + pTime->u16YearDay - 1; 400 AssertMsgReturn(i32Days <= RTTIME_MAX_DAY && i32Days >= RTTIME_MIN_DAY, ("%RI32\n", i32Days), (PRTTIMESPEC)NULL);400 AssertMsgReturn(i32Days <= RTTIME_MAX_DAY && i32Days >= RTTIME_MIN_DAY, ("%RI32\n", i32Days), NULL); 401 401 402 402 u32Secs = pTime->u8Second … … 405 405 i64Nanos = (uint64_t)pTime->u32Nanosecond 406 406 + u32Secs * UINT64_C(1000000000); 407 AssertMsgReturn(i32Days != RTTIME_MAX_DAY || i64Nanos <= RTTIME_MAX_DAY_NANO, ("%RI64\n", i64Nanos), (PRTTIMESPEC)NULL);408 AssertMsgReturn(i32Days != RTTIME_MIN_DAY || i64Nanos >= RTTIME_MIN_DAY_NANO, ("%RI64\n", i64Nanos), (PRTTIMESPEC)NULL);407 AssertMsgReturn(i32Days != RTTIME_MAX_DAY || i64Nanos <= RTTIME_MAX_DAY_NANO, ("%RI64\n", i64Nanos), NULL); 408 AssertMsgReturn(i32Days != RTTIME_MIN_DAY || i64Nanos >= RTTIME_MIN_DAY_NANO, ("%RI64\n", i64Nanos), NULL); 409 409 410 410 i64Nanos += i32Days * UINT64_C(86400000000000); … … 439 439 && pTime->u8MonthDay, 440 440 ("date=%d-%d-%d\n", pTime->i32Year, pTime->u8Month, pTime->u8MonthDay), 441 (PRTTIME)NULL);441 NULL); 442 442 while (pTime->u8Month > 12) 443 443 { … … 663 663 * Validate that we've got the minimum of stuff handy. 664 664 */ 665 AssertReturn(VALID_PTR(pTime), (PRTTIME)NULL);666 AssertMsgReturn(!(pTime->fFlags & ~RTTIME_FLAGS_MASK), ("%#x\n", pTime->fFlags), (PRTTIME)NULL);667 AssertMsgReturn((pTime->fFlags & RTTIME_FLAGS_TYPE_MASK) != RTTIME_FLAGS_TYPE_LOCAL, ("Use RTTimeLocalNormalize!\n"), (PRTTIME)NULL);668 AssertMsgReturn(pTime->offUTC == 0, ("%d; Use RTTimeLocalNormalize!\n", pTime->offUTC), (PRTTIME)NULL);665 AssertReturn(VALID_PTR(pTime), NULL); 666 AssertMsgReturn(!(pTime->fFlags & ~RTTIME_FLAGS_MASK), ("%#x\n", pTime->fFlags), NULL); 667 AssertMsgReturn((pTime->fFlags & RTTIME_FLAGS_TYPE_MASK) != RTTIME_FLAGS_TYPE_LOCAL, ("Use RTTimeLocalNormalize!\n"), NULL); 668 AssertMsgReturn(pTime->offUTC == 0, ("%d; Use RTTimeLocalNormalize!\n", pTime->offUTC), NULL); 669 669 670 670 pTime = rtTimeNormalizeInternal(pTime); … … 712 712 if ( cch <= 15 713 713 || psz[cch - 5] != chSign) 714 return (char *)NULL;714 return NULL; 715 715 } 716 716 else … … 721 721 if ( cch <= 15 722 722 || psz[cch - 1] != 'Z') 723 return (char *)NULL;723 return NULL; 724 724 } 725 725 return psz;
Note:
See TracChangeset
for help on using the changeset viewer.