VirtualBox

Changeset 62926 in vbox for trunk


Ignore:
Timestamp:
Aug 3, 2016 3:15:39 PM (8 years ago)
Author:
vboxsync
Message:

Devices: warnings

Location:
trunk/src/VBox/Devices
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Network/DrvNetSniffer.cpp

    r62511 r62926  
    297297static DECLCALLBACK(void) drvNetSnifferDetach(PPDMDRVINS pDrvIns, uint32_t fFlags)
    298298{
     299    RT_NOREF(fFlags);
    299300    PDRVNETSNIFFER pThis = PDMINS_2_DATA(pDrvIns, PDRVNETSNIFFER);
    300301
  • trunk/src/VBox/Devices/Storage/ATAPIPassthrough.cpp

    r62506 r62926  
    298298static int atapiTrackListUpdateFromSendDvdStructure(PTRACKLIST pTrackList, const uint8_t *pbCDB, const void *pvBuf)
    299299{
     300    RT_NOREF(pTrackList, pbCDB, pvBuf);
    300301    return VERR_NOT_IMPLEMENTED;
    301302}
     
    313314                                                bool fMSF, const uint8_t *pbBuf, uint32_t cbBuffer)
    314315{
     316    RT_NOREF(iTrack, cbBuffer); /** @todo unused parameters */
    315317    int rc = VINF_SUCCESS;
    316318    unsigned cbToc = atapiBE2H_U16(pbBuf);
     
    397399static int atapiTrackListUpdateFromReadTrackInformation(PTRACKLIST pTrackList, const uint8_t *pbCDB, const void *pvBuf)
    398400{
     401    RT_NOREF(pTrackList, pbCDB, pvBuf);
    399402    return VERR_NOT_IMPLEMENTED;
    400403}
     
    402405static int atapiTrackListUpdateFromReadDvdStructure(PTRACKLIST pTrackList, const uint8_t *pbCDB, const void *pvBuf)
    403406{
     407    RT_NOREF(pTrackList, pbCDB, pvBuf);
    404408    return VERR_NOT_IMPLEMENTED;
    405409}
     
    407411static int atapiTrackListUpdateFromReadDiscInformation(PTRACKLIST pTrackList, const uint8_t *pbCDB, const void *pvBuf)
    408412{
     413    RT_NOREF(pTrackList, pbCDB, pvBuf);
    409414    return VERR_NOT_IMPLEMENTED;
    410415}
  • trunk/src/VBox/Devices/Storage/IOBufMgmt.cpp

    r62463 r62926  
    9797}
    9898
    99 DECLINLINE(uint32_t) iobufMgrGetObjCount(size_t cbMem, unsigned cBins, size_t cbMin)
    100 {
    101     uint32_t cObjCnt = 0;
    102     uint32_t cbBin = cbMin;
     99DECLINLINE(uint32_t) iobufMgrGetObjCount(size_t cbMem, unsigned cBins, size_t cbMinBin)
     100{
     101    size_t cObjs = 0;
     102    size_t cbBin = cbMinBin;
    103103
    104104    while (cBins-- > 0)
    105105    {
    106         cObjCnt += cbMem / cbBin;
     106        cObjs += cbMem / cbBin;
    107107        cbBin <<= 1; /* The size doubles for every bin. */
    108108    }
    109109
    110     return cObjCnt;
     110    Assert((uint32_t)cObjs == cObjs);
     111    return (uint32_t)cObjs;
    111112}
    112113
     
    145146            {
    146147                /* Init the bins. */
    147                 uint32_t iObj = 0;
     148                size_t   iObj = 0;
    148149                uint32_t cbBin = IOBUFMGR_BIN_SIZE_MIN;
    149150                for (unsigned i = 0; i < cBins; i++)
     
    262263                    iBinCur--;
    263264                    pBinCur = &pThis->paBins[iBinCur];
    264                     pBinCur->papvFree[pBinCur->iFree] = pbMem + (RT_BIT(iBinCur + pThis->u32OrderMin));
     265                    pBinCur->papvFree[pBinCur->iFree] = pbMem + (size_t)RT_BIT(iBinCur + pThis->u32OrderMin); /* (RT_BIT causes weird MSC warning without cast) */
    265266                    pBinCur->iFree++;
    266267                }
     
    280281    /*
    281282     * If we didn't find something in the higher bins try to accumulate as much as possible from the smaller bins.
    282      * @todo: Defragment in case there is enough memory free but we can't find something in our bin.
    283283     */
     284    /** @todo Defragment in case there is enough memory free but we can't find something in our bin. */
    284285    if (   pBin->iFree == 0
    285286        && iBin > 0)
     
    294295                pBin->iFree--;
    295296                pSeg->pvSeg = pBin->papvFree[pBin->iFree];
    296                 pSeg->cbSeg = RT_BIT_32(iBin + pThis->u32OrderMin);
     297                pSeg->cbSeg = (size_t)RT_BIT_32(iBin + pThis->u32OrderMin);
    297298                AssertPtr(pSeg->pvSeg);
    298299                cbAlloc = pSeg->cbSeg;
     
    306307        pBin->iFree--;
    307308        pSeg->pvSeg = pBin->papvFree[pBin->iFree];
    308         pSeg->cbSeg = RT_BIT_32(u32Order);
     309        pSeg->cbSeg = (size_t)RT_BIT_32(u32Order);
    309310        cbAlloc = pSeg->cbSeg;
    310311        AssertPtr(pSeg->pvSeg);
     
    328329    {
    329330        unsigned iSeg = 0;
    330         unsigned cbLeft = cbIoBuf;
     331        size_t  cbLeft = cbIoBuf;
    331332        PRTSGSEG pSeg = &pIoBufDesc->Int.aSegs[0];
    332333
     
    382383            pBin->papvFree[pBin->iFree] = pSeg->pvSeg;
    383384            pBin->iFree++;
    384             pThis->cbFree += RT_BIT_32(u32Order);
     385            pThis->cbFree += (size_t)RT_BIT_32(u32Order);
    385386        }
    386387        RTCritSectLeave(&pThis->CritSectAlloc);
Note: See TracChangeset for help on using the changeset viewer.

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