Changeset 34507 in vbox for trunk/src/VBox/Runtime
- Timestamp:
- Nov 30, 2010 1:14:14 PM (14 years ago)
- svn:sync-xref-src-repo-rev:
- 68295
- Location:
- trunk/src/VBox/Runtime
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/common/alloc/memcache.cpp
r33278 r34507 528 528 Assert(iObj * pThis->cbObject == offObj); 529 529 Assert(iObj < pThis->cPerPage); 530 AssertReturnVoid(ASMBitTest(pPage->pbmAlloc, iObj));530 AssertReturnVoid(ASMBitTest(pPage->pbmAlloc, (int32_t)iObj)); 531 531 # endif 532 532 -
trunk/src/VBox/Runtime/common/misc/lockvalidator.cpp
r33540 r34507 3751 3751 AssertReleaseReturnVoid(iEntry < RT_ELEMENTS(pThread->LockValidator.aShrdOwners)); 3752 3752 3753 Assert(!ASMBitTest(&pThread->LockValidator.bmFreeShrdOwners, iEntry));3754 ASMAtomicBitSet(&pThread->LockValidator.bmFreeShrdOwners, iEntry);3753 Assert(!ASMBitTest(&pThread->LockValidator.bmFreeShrdOwners, (int32_t)iEntry)); 3754 ASMAtomicBitSet(&pThread->LockValidator.bmFreeShrdOwners, (int32_t)iEntry); 3755 3755 3756 3756 rtThreadRelease(pThread); -
trunk/src/VBox/Runtime/common/rand/randadv.cpp
r28800 r34507 369 369 uint64_t off = u64Last - u64First; 370 370 if (off <= UINT32_MAX) 371 return (uint64_t)pThis->pfnGetU32(pThis, 0, off) + u64First;371 return (uint64_t)pThis->pfnGetU32(pThis, 0, (uint32_t)off) + u64First; 372 372 373 373 return ( (uint64_t)pThis->pfnGetU32(pThis, 0, UINT32_MAX) 374 | ((uint64_t)pThis->pfnGetU32(pThis, 0, off >> 32) << 32))374 | ((uint64_t)pThis->pfnGetU32(pThis, 0, (uint32_t)(off >> 32)) << 32)) 375 375 + u64First; 376 376 } -
trunk/src/VBox/Runtime/common/vfs/vfsbase.cpp
r34441 r34507 2124 2124 2125 2125 2126 RTDECL( RTFOFF) RTVfsIoStrmPoll(RTVFSIOSTREAM hVfsIos, uint32_t fEvents, RTMSINTERVAL cMillies, bool fIntr,2127 2126 RTDECL(int) RTVfsIoStrmPoll(RTVFSIOSTREAM hVfsIos, uint32_t fEvents, RTMSINTERVAL cMillies, bool fIntr, 2127 uint32_t *pfRetEvents) 2128 2128 { 2129 2129 RTVFSIOSTREAMINTERNAL *pThis = hVfsIos; … … 2185 2185 while (cb > 0) 2186 2186 { 2187 size_t cbToRead = RT_MIN(cb, _64K);2187 size_t cbToRead = (size_t)RT_MIN(cb, _64K); 2188 2188 RTVfsLockAcquireWrite(pThis->Base.hLock); 2189 2189 rc = RTVfsIoStrmRead(hVfsIos, pvBuf, cbToRead, true /*fBlocking*/, NULL); … … 2224 2224 while (cb > 0) 2225 2225 { 2226 size_t cbToWrite = RT_MIN(cb, _64K);2226 size_t cbToWrite = (size_t)RT_MIN(cb, _64K); 2227 2227 RTVfsLockAcquireWrite(pThis->Base.hLock); 2228 2228 rc = RTVfsIoStrmWrite(hVfsIos, pvBuf, cbToWrite, true /*fBlocking*/, NULL); -
trunk/src/VBox/Runtime/common/vfs/vfsmemory.cpp
r34441 r34507 326 326 cbThisRead = cbLeftToRead; 327 327 else 328 cbThisRead = pNext->off - offUnsigned;328 cbThisRead = (size_t)(pNext->off - offUnsigned); 329 329 330 330 RT_BZERO(pbDst, cbThisRead); … … 402 402 uint64_t cbMaxExtent = pNext->off - offExtent; 403 403 if (cbMaxExtent < cbExtent) 404 cbExtent = cbMaxExtent;404 cbExtent = (uint32_t)cbMaxExtent; 405 405 } 406 406 … … 490 490 * Copy the source data into the current extent. 491 491 */ 492 uint32_t const offDst = offUnsigned - pExtent->off;492 uint32_t const offDst = (uint32_t)(offUnsigned - pExtent->off); 493 493 uint32_t cbThisWrite = pExtent->cb - offDst; 494 494 if (cbThisWrite > cbLeftToWrite) … … 683 683 { 684 684 PRTVFSMEMFILE pThis = (PRTVFSMEMFILE)pvThis; 685 return pThis->Base.ObjInfo.cbObject; 685 *pcbFile = pThis->Base.ObjInfo.cbObject; 686 return VINF_SUCCESS; 686 687 } 687 688 -
trunk/src/VBox/Runtime/common/zip/tarvfs.cpp
r34181 r34507 1121 1121 { 1122 1122 PRTZIPTARIOSTREAM pThis = (PRTZIPTARIOSTREAM)pvThis; 1123 return pThis->offFile; 1123 *poffActual = pThis->offFile; 1124 return VINF_SUCCESS; 1124 1125 } 1125 1126 … … 1397 1398 pIosData->cbFile = Info.cbObject; 1398 1399 pIosData->offFile = 0; 1399 pIosData->cbPadding = Info.cbAllocated - Info.cbObject;1400 pIosData->cbPadding = (uint32_t)(Info.cbAllocated - Info.cbObject); 1400 1401 pIosData->fEndOfStream = false; 1401 1402 pIosData->hVfsIos = pThis->hVfsIos; -
trunk/src/VBox/Runtime/generic/timerlr-generic.cpp
r33540 r34507 305 305 306 306 /* block. */ 307 int rc = RTSemEventWait(pThis->hEvent, cNanoSeconds < 1000000 ? 1 : cNanoSeconds / 1000000); 307 int rc = RTSemEventWait(pThis->hEvent, 308 (RTMSINTERVAL)(cNanoSeconds < 1000000 ? 1 : cNanoSeconds / 1000000)); 308 309 if (RT_FAILURE(rc) && rc != VERR_INTERRUPTED && rc != VERR_TIMEOUT) 309 310 { -
trunk/src/VBox/Runtime/r3/socket.cpp
r33540 r34507 958 958 AssertReturn(pThis->u32Magic == RTSOCKET_MAGIC, VERR_INVALID_HANDLE); 959 959 AssertReturn(RTMemPoolRefCount(pThis) >= (pThis->cUsers ? 2U : 1U), VERR_CALLER_NO_REFERENCE); 960 int const fdMax = (int)pThis->hNative + 1; 961 AssertReturn(fdMax - 1 == pThis->hNative, VERR_INTERNAL_ERROR_5); 960 962 961 963 /* … … 970 972 int rc; 971 973 if (cMillies == RT_INDEFINITE_WAIT) 972 rc = select( pThis->hNative + 1, &fdsetR, NULL, &fdsetE, NULL);974 rc = select(fdMax, &fdsetR, NULL, &fdsetE, NULL); 973 975 else 974 976 { … … 976 978 timeout.tv_sec = cMillies / 1000; 977 979 timeout.tv_usec = (cMillies % 1000) * 1000; 978 rc = select( pThis->hNative + 1, &fdsetR, NULL, &fdsetE, &timeout);980 rc = select(fdMax, &fdsetR, NULL, &fdsetE, &timeout); 979 981 } 980 982 if (rc > 0) … … 1001 1003 AssertReturn(!(fEvents & ~RTSOCKET_EVT_VALID_MASK), VERR_INVALID_PARAMETER); 1002 1004 AssertReturn(RTMemPoolRefCount(pThis) >= (pThis->cUsers ? 2U : 1U), VERR_CALLER_NO_REFERENCE); 1005 int const fdMax = (int)pThis->hNative + 1; 1006 AssertReturn(fdMax - 1 == pThis->hNative, VERR_INTERNAL_ERROR_5); 1003 1007 1004 1008 *pfEvents = 0; … … 1023 1027 int rc; 1024 1028 if (cMillies == RT_INDEFINITE_WAIT) 1025 rc = select( pThis->hNative + 1, &fdsetR, &fdsetW, &fdsetE, NULL);1029 rc = select(fdMax, &fdsetR, &fdsetW, &fdsetE, NULL); 1026 1030 else 1027 1031 { … … 1029 1033 timeout.tv_sec = cMillies / 1000; 1030 1034 timeout.tv_usec = (cMillies % 1000) * 1000; 1031 rc = select( pThis->hNative + 1, &fdsetR, &fdsetW, &fdsetE, &timeout);1035 rc = select(fdMax, &fdsetR, &fdsetW, &fdsetE, &timeout); 1032 1036 } 1033 1037 if (rc > 0) -
trunk/src/VBox/Runtime/r3/win/dir-win.cpp
r34002 r34507 384 384 PCRTUTF16 pwszSrc = (PCRTUTF16)pDir->Data.cAlternateFileName; 385 385 PRTUTF16 pwszDst = pDirEntry->wszShortName; 386 while (*pwszSrc) 387 *pwszDst++ = *pwszSrc++; 388 pDirEntry->cwcShortName = pwszDst - &pDirEntry->wszShortName[0]; 386 uint32_t off = 0; 387 while (pwszSrc[off] && off < RT_ELEMENTS(pDirEntry->wszShortName) - 1U) 388 { 389 pwszDst[off] = pwszSrc[off]; 390 off++; 391 } 392 pDirEntry->cwcShortName = (uint16_t)off; 393 389 394 /* zero the rest */ 390 const PRTUTF16 pwszEnd = &pDirEntry->wszShortName[RT_ELEMENTS(pDirEntry->wszShortName)];391 while (pwszDst < pwszEnd)392 *pwszDst++ = '\0';395 do 396 pwszDst[off++] = '\0'; 397 while (off < RT_ELEMENTS(pDirEntry->wszShortName)); 393 398 } 394 399 else -
trunk/src/VBox/Runtime/r3/win/thread-win.cpp
r34256 r34507 196 196 { 197 197 Assert((DWORD_PTR)u64Mask == u64Mask || u64Mask == ~(uint64_t)0); 198 DWORD dwRet = SetThreadAffinityMask(GetCurrentThread(), (DWORD_PTR)u64Mask);198 DWORD_PTR dwRet = SetThreadAffinityMask(GetCurrentThread(), (DWORD_PTR)u64Mask); 199 199 if (dwRet) 200 200 return VINF_SUCCESS; … … 216 216 { 217 217 HANDLE hThread = GetCurrentThread(); 218 DWORD dwRet = SetThreadAffinityMask(hThread, dwProcAff);218 DWORD_PTR dwRet = SetThreadAffinityMask(hThread, dwProcAff); 219 219 if (dwRet) 220 220 { 221 DWORD dwSet = SetThreadAffinityMask(hThread, dwRet);221 DWORD_PTR dwSet = SetThreadAffinityMask(hThread, dwRet); 222 222 Assert(dwSet == dwProcAff); NOREF(dwRet); 223 223 return dwRet; -
trunk/src/VBox/Runtime/r3/win/tls-win.cpp
r28800 r34507 69 69 if (iTls == NIL_RTTLS) 70 70 return VINF_SUCCESS; 71 if (TlsFree( iTls))71 if (TlsFree((DWORD)iTls)) 72 72 return VINF_SUCCESS; 73 73 return RTErrConvertFromWin32(GetLastError()); 74 75 74 } 76 75 … … 78 77 RTR3DECL(void *) RTTlsGet(RTTLS iTls) 79 78 { 80 return TlsGetValue( iTls);79 return TlsGetValue((DWORD)iTls); 81 80 } 82 81 … … 84 83 RTR3DECL(int) RTTlsGetEx(RTTLS iTls, void **ppvValue) 85 84 { 86 void *pv = TlsGetValue( iTls);85 void *pv = TlsGetValue((DWORD)iTls); 87 86 if (pv) 88 87 { … … 99 98 RTR3DECL(int) RTTlsSet(RTTLS iTls, void *pvValue) 100 99 { 101 if (TlsSetValue( iTls, pvValue))100 if (TlsSetValue((DWORD)iTls, pvValue)) 102 101 return VINF_SUCCESS; 103 102 return RTErrConvertFromWin32(GetLastError());
Note:
See TracChangeset
for help on using the changeset viewer.