Index: /trunk/include/iprt/vfs.h
===================================================================
--- /trunk/include/iprt/vfs.h	(revision 34506)
+++ /trunk/include/iprt/vfs.h	(revision 34507)
@@ -607,6 +607,6 @@
  * @sa      RTPollSetAdd, RTPoll, RTPollNoResume.
  */
-RTDECL(RTFOFF)      RTVfsIoStrmPoll(RTVFSIOSTREAM hVfsIos, uint32_t fEvents, RTMSINTERVAL cMillies, bool fIntr,
-                                    uint32_t *pfRetEvents);
+RTDECL(int)      RTVfsIoStrmPoll(RTVFSIOSTREAM hVfsIos, uint32_t fEvents, RTMSINTERVAL cMillies, bool fIntr,
+                                 uint32_t *pfRetEvents);
 /**
  * Tells the current I/O stream position.
Index: /trunk/src/VBox/Runtime/common/alloc/memcache.cpp
===================================================================
--- /trunk/src/VBox/Runtime/common/alloc/memcache.cpp	(revision 34506)
+++ /trunk/src/VBox/Runtime/common/alloc/memcache.cpp	(revision 34507)
@@ -528,5 +528,5 @@
         Assert(iObj * pThis->cbObject == offObj);
         Assert(iObj < pThis->cPerPage);
-        AssertReturnVoid(ASMBitTest(pPage->pbmAlloc, iObj));
+        AssertReturnVoid(ASMBitTest(pPage->pbmAlloc, (int32_t)iObj));
 # endif
 
Index: /trunk/src/VBox/Runtime/common/misc/lockvalidator.cpp
===================================================================
--- /trunk/src/VBox/Runtime/common/misc/lockvalidator.cpp	(revision 34506)
+++ /trunk/src/VBox/Runtime/common/misc/lockvalidator.cpp	(revision 34507)
@@ -3751,6 +3751,6 @@
             AssertReleaseReturnVoid(iEntry < RT_ELEMENTS(pThread->LockValidator.aShrdOwners));
 
-            Assert(!ASMBitTest(&pThread->LockValidator.bmFreeShrdOwners, iEntry));
-            ASMAtomicBitSet(&pThread->LockValidator.bmFreeShrdOwners, iEntry);
+            Assert(!ASMBitTest(&pThread->LockValidator.bmFreeShrdOwners, (int32_t)iEntry));
+            ASMAtomicBitSet(&pThread->LockValidator.bmFreeShrdOwners, (int32_t)iEntry);
 
             rtThreadRelease(pThread);
Index: /trunk/src/VBox/Runtime/common/rand/randadv.cpp
===================================================================
--- /trunk/src/VBox/Runtime/common/rand/randadv.cpp	(revision 34506)
+++ /trunk/src/VBox/Runtime/common/rand/randadv.cpp	(revision 34507)
@@ -369,8 +369,8 @@
     uint64_t off = u64Last - u64First;
     if (off <= UINT32_MAX)
-        return (uint64_t)pThis->pfnGetU32(pThis, 0, off) + u64First;
+        return (uint64_t)pThis->pfnGetU32(pThis, 0, (uint32_t)off) + u64First;
 
     return (    (uint64_t)pThis->pfnGetU32(pThis, 0, UINT32_MAX)
-            |  ((uint64_t)pThis->pfnGetU32(pThis, 0, off >> 32) << 32))
+            |  ((uint64_t)pThis->pfnGetU32(pThis, 0, (uint32_t)(off >> 32)) << 32))
          + u64First;
 }
Index: /trunk/src/VBox/Runtime/common/vfs/vfsbase.cpp
===================================================================
--- /trunk/src/VBox/Runtime/common/vfs/vfsbase.cpp	(revision 34506)
+++ /trunk/src/VBox/Runtime/common/vfs/vfsbase.cpp	(revision 34507)
@@ -2124,6 +2124,6 @@
 
 
-RTDECL(RTFOFF) RTVfsIoStrmPoll(RTVFSIOSTREAM hVfsIos, uint32_t fEvents, RTMSINTERVAL cMillies, bool fIntr,
-                               uint32_t *pfRetEvents)
+RTDECL(int) RTVfsIoStrmPoll(RTVFSIOSTREAM hVfsIos, uint32_t fEvents, RTMSINTERVAL cMillies, bool fIntr,
+                            uint32_t *pfRetEvents)
 {
     RTVFSIOSTREAMINTERNAL *pThis = hVfsIos;
@@ -2185,5 +2185,5 @@
             while (cb > 0)
             {
-                size_t cbToRead = RT_MIN(cb, _64K);
+                size_t cbToRead = (size_t)RT_MIN(cb, _64K);
                 RTVfsLockAcquireWrite(pThis->Base.hLock);
                 rc = RTVfsIoStrmRead(hVfsIos, pvBuf, cbToRead, true /*fBlocking*/, NULL);
@@ -2224,5 +2224,5 @@
             while (cb > 0)
             {
-                size_t cbToWrite = RT_MIN(cb, _64K);
+                size_t cbToWrite = (size_t)RT_MIN(cb, _64K);
                 RTVfsLockAcquireWrite(pThis->Base.hLock);
                 rc = RTVfsIoStrmWrite(hVfsIos, pvBuf, cbToWrite, true /*fBlocking*/, NULL);
Index: /trunk/src/VBox/Runtime/common/vfs/vfsmemory.cpp
===================================================================
--- /trunk/src/VBox/Runtime/common/vfs/vfsmemory.cpp	(revision 34506)
+++ /trunk/src/VBox/Runtime/common/vfs/vfsmemory.cpp	(revision 34507)
@@ -326,5 +326,5 @@
                 cbThisRead = cbLeftToRead;
             else
-                cbThisRead = pNext->off - offUnsigned;
+                cbThisRead = (size_t)(pNext->off - offUnsigned);
 
             RT_BZERO(pbDst, cbThisRead);
@@ -402,5 +402,5 @@
         uint64_t cbMaxExtent = pNext->off - offExtent;
         if (cbMaxExtent < cbExtent)
-            cbExtent = cbMaxExtent;
+            cbExtent = (uint32_t)cbMaxExtent;
     }
 
@@ -490,5 +490,5 @@
          * Copy the source data into the current extent.
          */
-        uint32_t const  offDst      = offUnsigned - pExtent->off;
+        uint32_t const  offDst      = (uint32_t)(offUnsigned - pExtent->off);
         uint32_t        cbThisWrite = pExtent->cb - offDst;
         if (cbThisWrite > cbLeftToWrite)
@@ -683,5 +683,6 @@
 {
     PRTVFSMEMFILE pThis = (PRTVFSMEMFILE)pvThis;
-    return pThis->Base.ObjInfo.cbObject;
+    *pcbFile = pThis->Base.ObjInfo.cbObject;
+    return VINF_SUCCESS;
 }
 
Index: /trunk/src/VBox/Runtime/common/zip/tarvfs.cpp
===================================================================
--- /trunk/src/VBox/Runtime/common/zip/tarvfs.cpp	(revision 34506)
+++ /trunk/src/VBox/Runtime/common/zip/tarvfs.cpp	(revision 34507)
@@ -1121,5 +1121,6 @@
 {
     PRTZIPTARIOSTREAM pThis = (PRTZIPTARIOSTREAM)pvThis;
-    return pThis->offFile;
+    *poffActual = pThis->offFile;
+    return VINF_SUCCESS;
 }
 
@@ -1397,5 +1398,5 @@
             pIosData->cbFile            = Info.cbObject;
             pIosData->offFile           = 0;
-            pIosData->cbPadding         = Info.cbAllocated - Info.cbObject;
+            pIosData->cbPadding         = (uint32_t)(Info.cbAllocated - Info.cbObject);
             pIosData->fEndOfStream      = false;
             pIosData->hVfsIos           = pThis->hVfsIos;
Index: /trunk/src/VBox/Runtime/generic/timerlr-generic.cpp
===================================================================
--- /trunk/src/VBox/Runtime/generic/timerlr-generic.cpp	(revision 34506)
+++ /trunk/src/VBox/Runtime/generic/timerlr-generic.cpp	(revision 34507)
@@ -305,5 +305,6 @@
 
             /* block. */
-            int rc = RTSemEventWait(pThis->hEvent, cNanoSeconds < 1000000 ? 1 : cNanoSeconds / 1000000);
+            int rc = RTSemEventWait(pThis->hEvent,
+                                    (RTMSINTERVAL)(cNanoSeconds < 1000000 ? 1 : cNanoSeconds / 1000000));
             if (RT_FAILURE(rc) && rc != VERR_INTERRUPTED && rc != VERR_TIMEOUT)
             {
Index: /trunk/src/VBox/Runtime/r3/socket.cpp
===================================================================
--- /trunk/src/VBox/Runtime/r3/socket.cpp	(revision 34506)
+++ /trunk/src/VBox/Runtime/r3/socket.cpp	(revision 34507)
@@ -958,4 +958,6 @@
     AssertReturn(pThis->u32Magic == RTSOCKET_MAGIC, VERR_INVALID_HANDLE);
     AssertReturn(RTMemPoolRefCount(pThis) >= (pThis->cUsers ? 2U : 1U), VERR_CALLER_NO_REFERENCE);
+    int const fdMax = (int)pThis->hNative + 1;
+    AssertReturn(fdMax - 1 == pThis->hNative, VERR_INTERNAL_ERROR_5);
 
     /*
@@ -970,5 +972,5 @@
     int rc;
     if (cMillies == RT_INDEFINITE_WAIT)
-        rc = select(pThis->hNative + 1, &fdsetR, NULL, &fdsetE, NULL);
+        rc = select(fdMax, &fdsetR, NULL, &fdsetE, NULL);
     else
     {
@@ -976,5 +978,5 @@
         timeout.tv_sec = cMillies / 1000;
         timeout.tv_usec = (cMillies % 1000) * 1000;
-        rc = select(pThis->hNative + 1, &fdsetR, NULL, &fdsetE, &timeout);
+        rc = select(fdMax, &fdsetR, NULL, &fdsetE, &timeout);
     }
     if (rc > 0)
@@ -1001,4 +1003,6 @@
     AssertReturn(!(fEvents & ~RTSOCKET_EVT_VALID_MASK), VERR_INVALID_PARAMETER);
     AssertReturn(RTMemPoolRefCount(pThis) >= (pThis->cUsers ? 2U : 1U), VERR_CALLER_NO_REFERENCE);
+    int const fdMax = (int)pThis->hNative + 1;
+    AssertReturn(fdMax - 1 == pThis->hNative, VERR_INTERNAL_ERROR_5);
 
     *pfEvents = 0;
@@ -1023,5 +1027,5 @@
     int rc;
     if (cMillies == RT_INDEFINITE_WAIT)
-        rc = select(pThis->hNative + 1, &fdsetR, &fdsetW, &fdsetE, NULL);
+        rc = select(fdMax, &fdsetR, &fdsetW, &fdsetE, NULL);
     else
     {
@@ -1029,5 +1033,5 @@
         timeout.tv_sec = cMillies / 1000;
         timeout.tv_usec = (cMillies % 1000) * 1000;
-        rc = select(pThis->hNative + 1, &fdsetR, &fdsetW, &fdsetE, &timeout);
+        rc = select(fdMax, &fdsetR, &fdsetW, &fdsetE, &timeout);
     }
     if (rc > 0)
Index: /trunk/src/VBox/Runtime/r3/win/dir-win.cpp
===================================================================
--- /trunk/src/VBox/Runtime/r3/win/dir-win.cpp	(revision 34506)
+++ /trunk/src/VBox/Runtime/r3/win/dir-win.cpp	(revision 34507)
@@ -384,11 +384,16 @@
         PCRTUTF16 pwszSrc = (PCRTUTF16)pDir->Data.cAlternateFileName;
         PRTUTF16  pwszDst = pDirEntry->wszShortName;
-        while (*pwszSrc)
-            *pwszDst++ = *pwszSrc++;
-        pDirEntry->cwcShortName = pwszDst - &pDirEntry->wszShortName[0];
+        uint32_t  off = 0;
+        while (pwszSrc[off] && off < RT_ELEMENTS(pDirEntry->wszShortName) - 1U)
+        {
+            pwszDst[off] = pwszSrc[off];
+            off++;
+        }
+        pDirEntry->cwcShortName = (uint16_t)off;
+
         /* zero the rest */
-        const PRTUTF16 pwszEnd = &pDirEntry->wszShortName[RT_ELEMENTS(pDirEntry->wszShortName)];
-        while (pwszDst < pwszEnd)
-            *pwszDst++ = '\0';
+        do
+            pwszDst[off++] = '\0';
+        while (off < RT_ELEMENTS(pDirEntry->wszShortName));
     }
     else
Index: /trunk/src/VBox/Runtime/r3/win/thread-win.cpp
===================================================================
--- /trunk/src/VBox/Runtime/r3/win/thread-win.cpp	(revision 34506)
+++ /trunk/src/VBox/Runtime/r3/win/thread-win.cpp	(revision 34507)
@@ -196,5 +196,5 @@
 {
     Assert((DWORD_PTR)u64Mask == u64Mask || u64Mask == ~(uint64_t)0);
-    DWORD dwRet = SetThreadAffinityMask(GetCurrentThread(), (DWORD_PTR)u64Mask);
+    DWORD_PTR dwRet = SetThreadAffinityMask(GetCurrentThread(), (DWORD_PTR)u64Mask);
     if (dwRet)
         return VINF_SUCCESS;
@@ -216,8 +216,8 @@
     {
         HANDLE hThread = GetCurrentThread();
-        DWORD dwRet = SetThreadAffinityMask(hThread, dwProcAff);
+        DWORD_PTR dwRet = SetThreadAffinityMask(hThread, dwProcAff);
         if (dwRet)
         {
-            DWORD dwSet = SetThreadAffinityMask(hThread, dwRet);
+            DWORD_PTR dwSet = SetThreadAffinityMask(hThread, dwRet);
             Assert(dwSet == dwProcAff); NOREF(dwRet);
             return dwRet;
Index: /trunk/src/VBox/Runtime/r3/win/tls-win.cpp
===================================================================
--- /trunk/src/VBox/Runtime/r3/win/tls-win.cpp	(revision 34506)
+++ /trunk/src/VBox/Runtime/r3/win/tls-win.cpp	(revision 34507)
@@ -69,8 +69,7 @@
     if (iTls == NIL_RTTLS)
         return VINF_SUCCESS;
-    if (TlsFree(iTls))
+    if (TlsFree((DWORD)iTls))
         return VINF_SUCCESS;
     return RTErrConvertFromWin32(GetLastError());
-
 }
 
@@ -78,5 +77,5 @@
 RTR3DECL(void *) RTTlsGet(RTTLS iTls)
 {
-    return TlsGetValue(iTls);
+    return TlsGetValue((DWORD)iTls);
 }
 
@@ -84,5 +83,5 @@
 RTR3DECL(int) RTTlsGetEx(RTTLS iTls, void **ppvValue)
 {
-    void *pv = TlsGetValue(iTls);
+    void *pv = TlsGetValue((DWORD)iTls);
     if (pv)
     {
@@ -99,5 +98,5 @@
 RTR3DECL(int) RTTlsSet(RTTLS iTls, void *pvValue)
 {
-    if (TlsSetValue(iTls, pvValue))
+    if (TlsSetValue((DWORD)iTls, pvValue))
         return VINF_SUCCESS;
     return RTErrConvertFromWin32(GetLastError());
