VirtualBox

Changeset 34507 in vbox for trunk/src/VBox/Runtime


Ignore:
Timestamp:
Nov 30, 2010 1:14:14 PM (14 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
68295
Message:

IPRT: Visual C++ warnings.

Location:
trunk/src/VBox/Runtime
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/common/alloc/memcache.cpp

    r33278 r34507  
    528528        Assert(iObj * pThis->cbObject == offObj);
    529529        Assert(iObj < pThis->cPerPage);
    530         AssertReturnVoid(ASMBitTest(pPage->pbmAlloc, iObj));
     530        AssertReturnVoid(ASMBitTest(pPage->pbmAlloc, (int32_t)iObj));
    531531# endif
    532532
  • trunk/src/VBox/Runtime/common/misc/lockvalidator.cpp

    r33540 r34507  
    37513751            AssertReleaseReturnVoid(iEntry < RT_ELEMENTS(pThread->LockValidator.aShrdOwners));
    37523752
    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);
    37553755
    37563756            rtThreadRelease(pThread);
  • trunk/src/VBox/Runtime/common/rand/randadv.cpp

    r28800 r34507  
    369369    uint64_t off = u64Last - u64First;
    370370    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;
    372372
    373373    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))
    375375         + u64First;
    376376}
  • trunk/src/VBox/Runtime/common/vfs/vfsbase.cpp

    r34441 r34507  
    21242124
    21252125
    2126 RTDECL(RTFOFF) RTVfsIoStrmPoll(RTVFSIOSTREAM hVfsIos, uint32_t fEvents, RTMSINTERVAL cMillies, bool fIntr,
    2127                                uint32_t *pfRetEvents)
     2126RTDECL(int) RTVfsIoStrmPoll(RTVFSIOSTREAM hVfsIos, uint32_t fEvents, RTMSINTERVAL cMillies, bool fIntr,
     2127                            uint32_t *pfRetEvents)
    21282128{
    21292129    RTVFSIOSTREAMINTERNAL *pThis = hVfsIos;
     
    21852185            while (cb > 0)
    21862186            {
    2187                 size_t cbToRead = RT_MIN(cb, _64K);
     2187                size_t cbToRead = (size_t)RT_MIN(cb, _64K);
    21882188                RTVfsLockAcquireWrite(pThis->Base.hLock);
    21892189                rc = RTVfsIoStrmRead(hVfsIos, pvBuf, cbToRead, true /*fBlocking*/, NULL);
     
    22242224            while (cb > 0)
    22252225            {
    2226                 size_t cbToWrite = RT_MIN(cb, _64K);
     2226                size_t cbToWrite = (size_t)RT_MIN(cb, _64K);
    22272227                RTVfsLockAcquireWrite(pThis->Base.hLock);
    22282228                rc = RTVfsIoStrmWrite(hVfsIos, pvBuf, cbToWrite, true /*fBlocking*/, NULL);
  • trunk/src/VBox/Runtime/common/vfs/vfsmemory.cpp

    r34441 r34507  
    326326                cbThisRead = cbLeftToRead;
    327327            else
    328                 cbThisRead = pNext->off - offUnsigned;
     328                cbThisRead = (size_t)(pNext->off - offUnsigned);
    329329
    330330            RT_BZERO(pbDst, cbThisRead);
     
    402402        uint64_t cbMaxExtent = pNext->off - offExtent;
    403403        if (cbMaxExtent < cbExtent)
    404             cbExtent = cbMaxExtent;
     404            cbExtent = (uint32_t)cbMaxExtent;
    405405    }
    406406
     
    490490         * Copy the source data into the current extent.
    491491         */
    492         uint32_t const  offDst      = offUnsigned - pExtent->off;
     492        uint32_t const  offDst      = (uint32_t)(offUnsigned - pExtent->off);
    493493        uint32_t        cbThisWrite = pExtent->cb - offDst;
    494494        if (cbThisWrite > cbLeftToWrite)
     
    683683{
    684684    PRTVFSMEMFILE pThis = (PRTVFSMEMFILE)pvThis;
    685     return pThis->Base.ObjInfo.cbObject;
     685    *pcbFile = pThis->Base.ObjInfo.cbObject;
     686    return VINF_SUCCESS;
    686687}
    687688
  • trunk/src/VBox/Runtime/common/zip/tarvfs.cpp

    r34181 r34507  
    11211121{
    11221122    PRTZIPTARIOSTREAM pThis = (PRTZIPTARIOSTREAM)pvThis;
    1123     return pThis->offFile;
     1123    *poffActual = pThis->offFile;
     1124    return VINF_SUCCESS;
    11241125}
    11251126
     
    13971398            pIosData->cbFile            = Info.cbObject;
    13981399            pIosData->offFile           = 0;
    1399             pIosData->cbPadding         = Info.cbAllocated - Info.cbObject;
     1400            pIosData->cbPadding         = (uint32_t)(Info.cbAllocated - Info.cbObject);
    14001401            pIosData->fEndOfStream      = false;
    14011402            pIosData->hVfsIos           = pThis->hVfsIos;
  • trunk/src/VBox/Runtime/generic/timerlr-generic.cpp

    r33540 r34507  
    305305
    306306            /* 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));
    308309            if (RT_FAILURE(rc) && rc != VERR_INTERRUPTED && rc != VERR_TIMEOUT)
    309310            {
  • trunk/src/VBox/Runtime/r3/socket.cpp

    r33540 r34507  
    958958    AssertReturn(pThis->u32Magic == RTSOCKET_MAGIC, VERR_INVALID_HANDLE);
    959959    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);
    960962
    961963    /*
     
    970972    int rc;
    971973    if (cMillies == RT_INDEFINITE_WAIT)
    972         rc = select(pThis->hNative + 1, &fdsetR, NULL, &fdsetE, NULL);
     974        rc = select(fdMax, &fdsetR, NULL, &fdsetE, NULL);
    973975    else
    974976    {
     
    976978        timeout.tv_sec = cMillies / 1000;
    977979        timeout.tv_usec = (cMillies % 1000) * 1000;
    978         rc = select(pThis->hNative + 1, &fdsetR, NULL, &fdsetE, &timeout);
     980        rc = select(fdMax, &fdsetR, NULL, &fdsetE, &timeout);
    979981    }
    980982    if (rc > 0)
     
    10011003    AssertReturn(!(fEvents & ~RTSOCKET_EVT_VALID_MASK), VERR_INVALID_PARAMETER);
    10021004    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);
    10031007
    10041008    *pfEvents = 0;
     
    10231027    int rc;
    10241028    if (cMillies == RT_INDEFINITE_WAIT)
    1025         rc = select(pThis->hNative + 1, &fdsetR, &fdsetW, &fdsetE, NULL);
     1029        rc = select(fdMax, &fdsetR, &fdsetW, &fdsetE, NULL);
    10261030    else
    10271031    {
     
    10291033        timeout.tv_sec = cMillies / 1000;
    10301034        timeout.tv_usec = (cMillies % 1000) * 1000;
    1031         rc = select(pThis->hNative + 1, &fdsetR, &fdsetW, &fdsetE, &timeout);
     1035        rc = select(fdMax, &fdsetR, &fdsetW, &fdsetE, &timeout);
    10321036    }
    10331037    if (rc > 0)
  • trunk/src/VBox/Runtime/r3/win/dir-win.cpp

    r34002 r34507  
    384384        PCRTUTF16 pwszSrc = (PCRTUTF16)pDir->Data.cAlternateFileName;
    385385        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
    389394        /* 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));
    393398    }
    394399    else
  • trunk/src/VBox/Runtime/r3/win/thread-win.cpp

    r34256 r34507  
    196196{
    197197    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);
    199199    if (dwRet)
    200200        return VINF_SUCCESS;
     
    216216    {
    217217        HANDLE hThread = GetCurrentThread();
    218         DWORD dwRet = SetThreadAffinityMask(hThread, dwProcAff);
     218        DWORD_PTR dwRet = SetThreadAffinityMask(hThread, dwProcAff);
    219219        if (dwRet)
    220220        {
    221             DWORD dwSet = SetThreadAffinityMask(hThread, dwRet);
     221            DWORD_PTR dwSet = SetThreadAffinityMask(hThread, dwRet);
    222222            Assert(dwSet == dwProcAff); NOREF(dwRet);
    223223            return dwRet;
  • trunk/src/VBox/Runtime/r3/win/tls-win.cpp

    r28800 r34507  
    6969    if (iTls == NIL_RTTLS)
    7070        return VINF_SUCCESS;
    71     if (TlsFree(iTls))
     71    if (TlsFree((DWORD)iTls))
    7272        return VINF_SUCCESS;
    7373    return RTErrConvertFromWin32(GetLastError());
    74 
    7574}
    7675
     
    7877RTR3DECL(void *) RTTlsGet(RTTLS iTls)
    7978{
    80     return TlsGetValue(iTls);
     79    return TlsGetValue((DWORD)iTls);
    8180}
    8281
     
    8483RTR3DECL(int) RTTlsGetEx(RTTLS iTls, void **ppvValue)
    8584{
    86     void *pv = TlsGetValue(iTls);
     85    void *pv = TlsGetValue((DWORD)iTls);
    8786    if (pv)
    8887    {
     
    9998RTR3DECL(int) RTTlsSet(RTTLS iTls, void *pvValue)
    10099{
    101     if (TlsSetValue(iTls, pvValue))
     100    if (TlsSetValue((DWORD)iTls, pvValue))
    102101        return VINF_SUCCESS;
    103102    return RTErrConvertFromWin32(GetLastError());
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette