Changeset 25000 in vbox for trunk/src/VBox/Runtime
- Timestamp:
- Nov 26, 2009 2:22:44 PM (15 years ago)
- Location:
- trunk/src/VBox/Runtime
- Files:
-
- 24 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/VBox/strformat-vbox.cpp
r14061 r25000 107 107 { 108 108 int rc = va_arg(*pArgs, int); 109 ch ar ch= *(*ppszFormat)++;109 ch = *(*ppszFormat)++; 110 110 #ifdef IN_RING3 /* we don't want this anywhere else yet. */ 111 111 PCRTSTATUSMSG pMsg = RTErrGet(rc); … … 152 152 case 'h': 153 153 { 154 ch ar ch= *(*ppszFormat)++;154 ch = *(*ppszFormat)++; 155 155 switch (ch) 156 156 { -
trunk/src/VBox/Runtime/common/ldr/ldrELFRelocatable.cpp.h
r24678 r25000 489 489 */ 490 490 AssertMsgReturn(Value == (RTUINTPTR)Value, (FMT_ELF_ADDR "\n", Value), VERR_SYMBOL_VALUE_TOO_BIG); 491 intrc = pfnCallback(pMod, pszName, ~0, (RTUINTPTR)Value, pvUser);491 rc = pfnCallback(pMod, pszName, ~0, (RTUINTPTR)Value, pvUser); 492 492 if (rc) 493 493 return rc; … … 873 873 for (unsigned i = 0; i < cbName; i++, off++) 874 874 { 875 intrc = pModElf->pReader->pfnRead(pModElf->pReader, pszName + i, 1, off);875 rc = pModElf->pReader->pfnRead(pModElf->pReader, pszName + i, 1, off); 876 876 if (RT_FAILURE(rc)) 877 877 { -
trunk/src/VBox/Runtime/common/misc/handletablectx.cpp
r24181 r25000 176 176 && pThis->cCur < pThis->cMax) 177 177 { 178 uint32_t i;179 180 178 pThis->papvLevel1[iLevel1New] = paTable; 181 179 -
trunk/src/VBox/Runtime/common/misc/handletablesimple.cpp
r24181 r25000 170 170 /* link all entries into a free list. */ 171 171 Assert(!(pThis->cCur % RTHT_LEVEL2_ENTRIES)); 172 for ( uint32_ti = 0; i < RTHT_LEVEL2_ENTRIES - 1; i++)172 for (i = 0; i < RTHT_LEVEL2_ENTRIES - 1; i++) 173 173 RTHT_SET_FREE_IDX((PRTHTENTRYFREE)&paTable[i], i + 1 + pThis->cCur); 174 174 RTHT_SET_FREE_IDX((PRTHTENTRYFREE)&paTable[RTHT_LEVEL2_ENTRIES - 1], NIL_RTHT_INDEX); -
trunk/src/VBox/Runtime/common/misc/thread.cpp
r23125 r25000 136 136 * But first, we'll create the semaphore. 137 137 */ 138 intrc = RTSemRWCreate(&g_ThreadRWSem);138 rc = RTSemRWCreate(&g_ThreadRWSem); 139 139 if (RT_SUCCESS(rc)) 140 140 { -
trunk/src/VBox/Runtime/common/misc/zip.cpp
r22007 r25000 565 565 pZip->u.Zlib.next_out = (Bytef *)pvBuf; 566 566 pZip->u.Zlib.avail_out = (uInt)cbBuf; Assert(pZip->u.Zlib.avail_out == cbBuf); 567 int rc = Z_OK; 568 /* Be greedy reading input, even if no output buffer is left. It's possible 567 568 /* 569 * Be greedy reading input, even if no output buffer is left. It's possible 569 570 * that it's just the end of stream marker which needs to be read. Happens 570 * for incompressible blocks just larger than the input buffer size.*/ 571 * for incompressible blocks just larger than the input buffer size. 572 */ 571 573 while (pZip->u.Zlib.avail_out > 0 || pZip->u.Zlib.avail_in <= 0) 572 574 { … … 587 589 * Pass it on to zlib. 588 590 */ 589 rc = inflate(&pZip->u.Zlib, Z_NO_FLUSH);591 int rc = inflate(&pZip->u.Zlib, Z_NO_FLUSH); 590 592 if (rc == Z_STREAM_END) 591 593 { -
trunk/src/VBox/Runtime/common/string/strformatrt.cpp
r23961 r25000 572 572 case 'f': 573 573 { 574 char ch = *(*ppszFormat)++; 575 switch (ch) 574 switch (*(*ppszFormat)++) 576 575 { 577 576 /* … … 607 606 608 607 default: 609 AssertMsgFailed(("Invalid status code format type '%.10s'!\n", ch,pszFormatOrg));608 AssertMsgFailed(("Invalid status code format type '%.10s'!\n", pszFormatOrg)); 610 609 break; 611 610 } … … 619 618 case 'h': 620 619 { 621 char ch = *(*ppszFormat)++; 622 switch (ch) 620 switch (*(*ppszFormat)++) 623 621 { 624 622 /* … … 632 630 if (pu8) 633 631 { 634 ch = *(*ppszFormat)++; 635 switch (ch) 632 switch (*(*ppszFormat)++) 636 633 { 637 634 /* … … 687 684 688 685 default: 689 AssertMsgFailed(("Invalid status code format type '%.10s'!\n", ch,pszFormatOrg));686 AssertMsgFailed(("Invalid status code format type '%.10s'!\n", pszFormatOrg)); 690 687 break; 691 688 } … … 704 701 case 'r': 705 702 { 706 707 char ch = *(*ppszFormat)++;708 703 uint32_t hrc = va_arg(*pArgs, uint32_t); 709 704 PCRTCOMERRMSG pMsg = RTErrCOMGet(hrc); 710 switch ( ch)705 switch (*(*ppszFormat)++) 711 706 { 712 707 case 'c': … … 725 720 726 721 default: 727 AssertMsgFailed(("Invalid status code format type '%.10s'!\n", ch,pszFormatOrg));722 AssertMsgFailed(("Invalid status code format type '%.10s'!\n", pszFormatOrg)); 728 723 return 0; 729 724 … … 738 733 { 739 734 int rc = va_arg(*pArgs, int); 740 char ch = *(*ppszFormat)++;741 735 #ifdef IN_RING3 /* we don't want this anywhere else yet. */ 742 736 PCRTSTATUSMSG pMsg = RTErrGet(rc); 743 switch ( ch)737 switch (*(*ppszFormat)++) 744 738 { 745 739 case 'c': … … 756 750 } 757 751 #else /* !IN_RING3 */ 758 switch ( ch)752 switch (*(*ppszFormat)++) 759 753 { 760 754 case 'c': … … 778 772 { 779 773 long rc = va_arg(*pArgs, long); 780 char ch = *(*ppszFormat)++;781 774 # if defined(RT_OS_WINDOWS) 782 775 PCRTWINERRMSG pMsg = RTErrWinGet(rc); 783 776 # endif 784 switch ( ch)777 switch (*(*ppszFormat)++) 785 778 { 786 779 # if defined(RT_OS_WINDOWS) -
trunk/src/VBox/Runtime/common/string/utf-8.cpp
r21791 r25000 1160 1160 && !(uMask & 1)) 1161 1161 { 1162 u nsigned uch = *--puch;1162 uch = *--puch; 1163 1163 if ((uch & 0xc0) != 0x80) 1164 1164 { -
trunk/src/VBox/Runtime/generic/env-generic.cpp
r21337 r25000 245 245 for (size_t iVar = 0; iVar < cVars; iVar++) 246 246 { 247 int rc = RTStrCurrentCPToUtf8(&pIntEnv->papszEnv[iVar], papszEnv[iVar]);248 if (RT_FAILURE(rc ))247 int rc2 = RTStrCurrentCPToUtf8(&pIntEnv->papszEnv[iVar], papszEnv[iVar]); 248 if (RT_FAILURE(rc2)) 249 249 { 250 250 pIntEnv->cVars = iVar; 251 251 RTEnvDestroy(pIntEnv); 252 return rc ;252 return rc2; 253 253 } 254 254 } … … 265 265 pIntEnv->cVars = iVar; 266 266 RTEnvDestroy(pIntEnv); 267 return rc;267 return VERR_NO_STR_MEMORY; 268 268 } 269 269 pIntEnv->papszEnv[iVar] = pszVar; -
trunk/src/VBox/Runtime/generic/uuid-generic.cpp
r21337 r25000 324 324 RTDECL(int) RTUuidToUtf16(PCRTUUID pUuid, PRTUTF16 pwszString, size_t cwcString) 325 325 { 326 static const char g_achDigits[17] = "0123456789abcdef";327 326 uint32_t u32TimeLow; 328 327 unsigned u; -
trunk/src/VBox/Runtime/r3/tcp.cpp
r24219 r25000 603 603 * we cannot safely access the handle so we'll have to return here. 604 604 */ 605 RTSOCKETSockServer = rtTcpAtomicXchgSock(&pServer->SockServer, NIL_RTSOCKET);605 SockServer = rtTcpAtomicXchgSock(&pServer->SockServer, NIL_RTSOCKET); 606 606 rtTcpServerSetState(pServer, RTTCPSERVERSTATE_STOPPED, RTTCPSERVERSTATE_STOPPING); 607 607 rtTcpClose(SockServer, "Listener: server stopped", false /*fTryGracefulShutdown*/); -
trunk/src/VBox/Runtime/r3/xml.cpp
r23973 r25000 340 340 void MemoryBuf::setPos (uint64_t aPos) 341 341 { 342 size_t pos= (size_t) aPos;343 if ((uint64_t) pos!= aPos)342 size_t off = (size_t) aPos; 343 if ((uint64_t) off != aPos) 344 344 throw EInvalidArg(); 345 345 346 if ( pos> m->len)346 if (off > m->len) 347 347 throw EInvalidArg(); 348 348 349 m->pos = pos;349 m->pos = off; 350 350 } 351 351 -
trunk/src/VBox/Runtime/testcase/tstFile.cpp
r14831 r25000 180 180 else 181 181 { 182 size_tcbWritten = 0;182 cbWritten = 0; 183 183 while (cbWritten < sizeof(szTestBuf)) 184 184 { -
trunk/src/VBox/Runtime/testcase/tstFileAio.cpp
r23973 r25000 186 186 187 187 NanoTS = RTTimeNanoTS() - NanoTS; 188 unsigned SpeedKBs = cbTestFile / (NanoTS / 1000000000.0) / 1024;188 unsigned SpeedKBs = (unsigned)(cbTestFile / (NanoTS / 1000000000.0) / 1024); 189 189 190 190 RTPrintf("tstFileAio: Completed simple %s test: %d.%03d MB/sec\n", -
trunk/src/VBox/Runtime/testcase/tstFork.cpp
r20606 r25000 69 69 */ 70 70 pid_t pid = fork(); 71 if (pid == -1) 72 RTTestFailed(hTest, "fork() failed: %d - %s", errno, strerror(errno)); 73 else if (pid == 0) 71 if (pid == 0) 74 72 { 75 73 /* 76 74 * Check that the values has changed. 77 75 */ 78 intrc = 0;76 rc = 0; 79 77 if (ProcBefore == RTProcSelf()) 80 78 { … … 84 82 return rc; 85 83 } 86 else84 if (pid != -1) 87 85 { 88 86 /* … … 94 92 * Wait for the child. 95 93 */ 96 intrc = 1;94 rc = 1; 97 95 while ( waitpid(pid, &rc, 0) 98 96 && errno == EINTR) … … 101 99 RTTestFailed(hTest, "rc=%#x", rc); 102 100 } 101 else 102 RTTestFailed(hTest, "fork() failed: %d - %s", errno, strerror(errno)); 103 103 #endif 104 104 -
trunk/src/VBox/Runtime/testcase/tstLdr-4.cpp
r19924 r25000 203 203 if (aLoads[i].hLdrMod) 204 204 { 205 intrc = RTLdrClose(aLoads[i].hLdrMod);205 rc = RTLdrClose(aLoads[i].hLdrMod); 206 206 if (RT_FAILURE(rc)) 207 207 { -
trunk/src/VBox/Runtime/testcase/tstOnce.cpp
r10947 r25000 143 143 char szName[16]; 144 144 RTStrPrintf(szName, sizeof(szName), "ONCE2-%d\n", i); 145 intrc = RTThreadCreate(&aThreads[i], Once2Thread, NULL, 0, RTTHREADTYPE_DEFAULT, RTTHREADFLAGS_WAITABLE, szName);145 rc = RTThreadCreate(&aThreads[i], Once2Thread, NULL, 0, RTTHREADTYPE_DEFAULT, RTTHREADFLAGS_WAITABLE, szName); 146 146 if (RT_FAILURE(rc)) 147 147 { … … 165 165 { 166 166 int rc2; 167 intrc = RTThreadWait(aThreads[i], 30*1000, &rc2);167 rc = RTThreadWait(aThreads[i], 30*1000, &rc2); 168 168 if (RT_FAILURE(rc)) 169 169 { -
trunk/src/VBox/Runtime/testcase/tstPath.cpp
r20606 r25000 184 184 if (s_aRTPathAbsExTests[i].pcszOutput[1] == 'p') 185 185 { 186 size_tcch = strlen(szTmp);186 cch = strlen(szTmp); 187 187 if (cch + strlen(s_aRTPathAbsExTests[i].pcszOutput) - 2 <= sizeof(szTmp)) 188 188 strcpy(szTmp + cch, s_aRTPathAbsExTests[i].pcszOutput + 2); -
trunk/src/VBox/Runtime/testcase/tstRTCidr.cpp
r20606 r25000 46 46 do { \ 47 47 RTIPV4ADDR Network, NetMask; \ 48 int rc = RTCidrStrToIPv4(String, &Network, &NetMask); \49 if ((rcExpected) && !rc ) \48 int rc2 = RTCidrStrToIPv4(String, &Network, &NetMask); \ 49 if ((rcExpected) && !rc2) \ 50 50 { \ 51 51 RTTestIFailed("at line %d: '%s': expected %Rrc got %Rrc\n", \ 52 __LINE__, String, (rcExpected), rc ); \52 __LINE__, String, (rcExpected), rc2); \ 53 53 } \ 54 else if ( (rcExpected) != rc \55 || ( rc == VINF_SUCCESS \54 else if ( (rcExpected) != rc2 \ 55 || ( rc2 == VINF_SUCCESS \ 56 56 && ( (ExpectedNetwork) != Network \ 57 57 || (ExpectedNetMask) != NetMask))) \ 58 58 { \ 59 59 RTTestIFailed("at line %d: '%s': expected %Rrc got %Rrc, expected network %08x got %08x, expected netmask %08x got %08x\n", \ 60 __LINE__, String, rcExpected, rc , (ExpectedNetwork), Network, (ExpectedNetMask), NetMask); \60 __LINE__, String, rcExpected, rc2, (ExpectedNetwork), Network, (ExpectedNetMask), NetMask); \ 61 61 } \ 62 62 } while (0) -
trunk/src/VBox/Runtime/testcase/tstRTProcWait.cpp
r14831 r25000 75 75 /* Wait for it to complete. */ 76 76 int rc2; 77 intrc = RTThreadWait(Thread, RT_INDEFINITE_WAIT, &rc2);77 rc = RTThreadWait(Thread, RT_INDEFINITE_WAIT, &rc2); 78 78 if (RT_SUCCESS(rc)) 79 79 rc = rc2; -
trunk/src/VBox/Runtime/testcase/tstTSC.cpp
r17093 r25000 390 390 */ 391 391 RTPrintf("tstTSC: %RU64 ticks in %RU64 ns\n", uTSC, uNanoTS); 392 uint64_t cHz = uTSC / ((long double)uNanoTS / (long double)1000000000);392 uint64_t cHz = (uint64_t)(uTSC / ((long double)uNanoTS / (long double)1000000000)); 393 393 RTPrintf("tstTSC: Frequency %RU64 Hz", cHz); 394 394 if (cHz > _1G) -
trunk/src/VBox/Runtime/testcase/tstTimer.cpp
r14831 r25000 167 167 * Start the timer and active waiting for the requested test period. 168 168 */ 169 u int64_t uTSBegin = RTTimeNanoTS();169 uTSBegin = RTTimeNanoTS(); 170 170 #ifndef RT_OS_WINDOWS 171 171 rc = RTTimerStart(pTimer, 0); … … 182 182 /* destroy the timer */ 183 183 uint64_t uTSEnd = RTTimeNanoTS(); 184 u int64_t uTSDiff = uTSEnd - uTSBegin;184 uTSDiff = uTSEnd - uTSBegin; 185 185 rc = RTTimerDestroy(pTimer); 186 186 if (RT_FAILURE(rc)) -
trunk/src/VBox/Runtime/testcase/tstTimerLR.cpp
r14831 r25000 160 160 * Start the timer an actively wait for it for the period requested. 161 161 */ 162 u int64_t uTSBegin = RTTimeNanoTS();162 uTSBegin = RTTimeNanoTS(); 163 163 rc = RTTimerLRStart(hTimerLR, 0); 164 164 if (RT_FAILURE(rc)) … … 180 180 181 181 uint64_t uTSEnd = RTTimeNanoTS(); 182 u int64_t uTSDiff = uTSEnd - uTSBegin;182 uTSDiff = uTSEnd - uTSBegin; 183 183 RTPrintf("uTS=%RI64 (%RU64 - %RU64)\n", uTSDiff, uTSBegin, uTSEnd); 184 184 -
trunk/src/VBox/Runtime/testcase/tstUtf8.cpp
r23223 r25000 469 469 RTTestFailed(hTest, "UTF-8 -> UTF-16 failed compare!"); 470 470 471 char *pszUtf8;472 471 rc = RTUtf16ToUtf8(pwszUtf16, &pszUtf8); 473 472 if (rc == VINF_SUCCESS)
Note:
See TracChangeset
for help on using the changeset viewer.