Changeset 34507 in vbox for trunk/src/VBox/Runtime/r3
- Timestamp:
- Nov 30, 2010 1:14:14 PM (14 years ago)
- svn:sync-xref-src-repo-rev:
- 68295
- Location:
- trunk/src/VBox/Runtime/r3
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
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.