VirtualBox

vbox的更動 62379 路徑 trunk/src/VBox/Main


忽略:
時間撮記:
2016-7-20 下午08:11:50 (8 年 以前)
作者:
vboxsync
訊息:

Main: 2nd try: fixes for a few -Wunused -Wconversion

位置:
trunk/src/VBox/Main
檔案:
修改 17 筆資料

圖例:

未更動
新增
刪除
  • trunk/src/VBox/Main/include/GuestDnDPrivate.h

    r62372 r62379  
    242242    uint64_t addProcessed(uint32_t cbDataAdd)
    243243    {
    244         const uint64_t cbTotal = getTotal();
     244        const uint64_t cbTotal = getTotal(); NOREF(cbTotal);
    245245        Assert(cbProcessed + cbDataAdd <= cbTotal);
    246246        cbProcessed += cbDataAdd;
  • trunk/src/VBox/Main/include/HGCMObjects.h

    r62372 r62379  
    9090        uint32_t Handle()
    9191        {
    92             return m_core.AvlCore.Key;
     92            return (uint32_t)m_core.AvlCore.Key;
    9393        };
    9494
  • trunk/src/VBox/Main/src-client/ConsoleImpl.cpp

    r62372 r62379  
    306306                BOOL fRemove;
    307307                pNREv->COMGETTER(Remove)(&fRemove);
    308                 bool fUdp = (proto == NATProtocol_UDP);
    309308                Bstr hostIp, guestIp;
    310309                LONG hostPort, guestPort;
     
    39093908    DeviceType_T lType;
    39103909    PCFGMNODE pLunL0 = NULL;
    3911     PCFGMNODE pCfg = NULL;
    39123910
    39133911    hrc = pMediumAtt->COMGETTER(Device)(&lDev);                             H();
     
    48184816    /* Remove keys which are supposed to be removed on a suspend. */
    48194817    int rc = m_pKeyStore->deleteAllSecretKeys(true /* fSuspend */, true /* fForce */);
     4818    AssertRC(rc); NOREF(rc);
    48204819}
    48214820
     
    75547553
    75557554    PUVM     pUVM  = mpUVM;                 Assert(pUVM != NULL);
    7556     uint32_t cRefs = VMR3RetainUVM(pUVM);   Assert(cRefs != UINT32_MAX);
     7555    uint32_t cRefs = VMR3RetainUVM(pUVM);   Assert(cRefs != UINT32_MAX);  NOREF(cRefs);
    75577556
    75587557    AssertMsg(   mMachineState == MachineState_Running
     
    81318130
    81328131    pFolderName->u16Size   = (uint16_t)cbString;
    8133     pFolderName->u16Length = (uint16_t)cbString - sizeof(RTUTF16);
     8132    pFolderName->u16Length = (uint16_t)(cbString - sizeof(RTUTF16));
    81348133
    81358134    parms[0].type = VBOX_HGCM_SVC_PARM_PTR;
     
    81488147
    81498148    pMapName->u16Size   = (uint16_t)cbString;
    8150     pMapName->u16Length = (uint16_t)cbString - sizeof(RTUTF16);
     8149    pMapName->u16Length = (uint16_t)(cbString - sizeof(RTUTF16));
    81518150
    81528151    parms[1].type = VBOX_HGCM_SVC_PARM_PTR;
     
    82118210
    82128211    pMapName->u16Size   = (uint16_t)cbString;
    8213     pMapName->u16Length = (uint16_t)cbString - sizeof(RTUTF16);
     8212    pMapName->u16Length = (uint16_t)(cbString - sizeof(RTUTF16));
    82148213
    82158214    parms.type = VBOX_HGCM_SVC_PARM_PTR;
     
    1028210281{
    1028310282    PDRVMAINSTATUS pThis = RT_FROM_MEMBER(pInterface, DRVMAINSTATUS, IMediaNotify);
    10284     PPDMDRVINS pDrvIns = pThis->pDrvIns;
    1028510283    LogFunc(("uLUN=%d\n", uLUN));
    1028610284    if (pThis->pmapMediumAttachments)
  • trunk/src/VBox/Main/src-client/ConsoleImpl2.cpp

    r62372 r62379  
    17021702
    17031703                char szParamName[] = "BootDeviceX";
    1704                 szParamName[sizeof(szParamName) - 2] = ((char (pos - 1)) + '0');
     1704                szParamName[sizeof(szParamName) - 2] = (char)(pos - 1 + '0');
    17051705
    17061706                const char *pszBootDevice;
     
    25352535            for (uint32_t i = 0; i < 6; ++i)
    25362536            {
    2537                 char c1 = *macStr++ - '0';
     2537                int c1 = *macStr++ - '0';
    25382538                if (c1 > 9)
    25392539                    c1 -= 7;
    2540                 char c2 = *macStr++ - '0';
     2540                int c2 = *macStr++ - '0';
    25412541                if (c2 > 9)
    25422542                    c2 -= 7;
    2543                 *pMac++ = ((c1 & 0x0f) << 4) | (c2 & 0x0f);
     2543                *pMac++ = (char)(((c1 & 0x0f) << 4) | (c2 & 0x0f));
    25442544            }
    25452545            InsertConfigBytes(pCfg, "MAC", &Mac, sizeof(Mac));
     
    25982598
    25992599                PCFGMNODE pNetBtDevCfg;
    2600                 achBootIdx[0] = '0' + uBootIdx++;   /* Boot device order. */
     2600                achBootIdx[0] = (char)('0' + uBootIdx++);   /* Boot device order. */
    26012601                InsertConfigNode(pNetBootCfg, achBootIdx, &pNetBtDevCfg);
    26022602                InsertConfigInteger(pNetBtDevCfg, "NIC", it->mInstance);
     
    42444244    try
    42454245    {
    4246         int rc = VINF_SUCCESS;
    42474246        HRESULT hrc;
    42484247        Bstr bstr;
    4249         PCFGMNODE pLunL1 = NULL;
    42504248        PCFGMNODE pCfg = NULL;
    42514249
  • trunk/src/VBox/Main/src-client/ConsoleVRDPServer.cpp

    r62372 r62379  
    21462146              pvContext, pvUser, hVideo, u32Id, pvData, cbData));
    21472147
    2148     ConsoleVRDPServer *pServer = static_cast<ConsoleVRDPServer*>(pvContext);
     2148    ConsoleVRDPServer *pServer = static_cast<ConsoleVRDPServer*>(pvContext); NOREF(pServer);
    21492149    H3DORInstance *p = (H3DORInstance *)pvUser;
    21502150    Assert(p);
     
    36933693{
    36943694    VRDEORDERHDR update;
    3695     update.x = x;
    3696     update.y = y;
    3697     update.w = w;
    3698     update.h = h;
     3695    update.x = (uint16_t)x;
     3696    update.y = (uint16_t)y;
     3697    update.w = (uint16_t)w;
     3698    update.h = (uint16_t)h;
    36993699    if (mpEntryPoints && mhServer)
    37003700    {
  • trunk/src/VBox/Main/src-client/DisplayImpl.cpp

    r62372 r62379  
    441441
    442442    /* First block. */
    443     SSMR3PutU32(pSSM, cbThumbnail + 2 * sizeof(uint32_t));
     443    SSMR3PutU32(pSSM, (uint32_t)(cbThumbnail + 2 * sizeof(uint32_t)));
    444444    SSMR3PutU32(pSSM, 0); /* Block type: thumbnail. */
    445445
     
    452452
    453453    /* Second block. */
    454     SSMR3PutU32(pSSM, cbPNG + 2 * sizeof(uint32_t));
     454    SSMR3PutU32(pSSM, (uint32_t)(cbPNG + 2 * sizeof(uint32_t)));
    455455    SSMR3PutU32(pSSM, 1); /* Block type: png. */
    456456
     
    469469Display::i_displaySSMLoadScreenshot(PSSMHANDLE pSSM, void *pvUser, uint32_t uVersion, uint32_t uPass)
    470470{
    471     Display *that = static_cast<Display*>(pvUser);
    472 
    473471    if (uVersion != sSSMDisplayScreenshotVer)
    474472        return VERR_SSM_UNSUPPORTED_DATA_UNIT_VERSION;
     
    549547    uint32_t cMonitors;
    550548    int rc = SSMR3GetU32(pSSM, &cMonitors);
     549    AssertRCReturn(rc, rc);
    551550    if (cMonitors != that->mcMonitors)
    552551        return SSMR3SetCfgError(pSSM, RT_SRC_POS, N_("Number of monitors changed (%d->%d)!"), cMonitors, that->mcMonitors);
     
    13731372                pCtl->aParms[0].type = VBOX_HGCM_SVC_PARM_PTR;
    13741373                pCtl->aParms[0].u.pointer.addr = pRectsCopy;
    1375                 pCtl->aParms[0].u.pointer.size = cRect * sizeof(RTRECT);
     1374                pCtl->aParms[0].u.pointer.size = (uint32_t)(cRect * sizeof(RTRECT));
    13761375
    13771376                rc = i_crCtlSubmit(&pCtl->Hdr, sizeof(*pCtl), i_displayCrCmdFree, pCtl);
     
    31033102        {
    31043103            /* No VBVA do a display update. */
    3105             DISPLAYFBINFO *pFBInfo = &pDisplay->maFramebuffers[VBOX_VIDEO_PRIMARY_SCREEN];
    31063104            pDrv->pUpPort->pfnUpdateDisplay(pDrv->pUpPort);
    31073105        }
     
    31153113        for (uScreenId = 0; uScreenId < pDisplay->mcMonitors; uScreenId++)
    31163114        {
    3117             DISPLAYFBINFO *pFBInfo = &pDisplay->maFramebuffers[uScreenId];
    3118 
    31193115            Assert(pDisplay->mParent && pDisplay->mParent->i_consoleVRDPServer());
    31203116            pDisplay->mParent->i_consoleVRDPServer()->SendUpdate(uScreenId, NULL, 0);
     
    32903286{
    32913287    unsigned id = (unsigned)pCommand->iDisplay;
    3292     int rc = VINF_SUCCESS;
    32933288    if (id >= mcMonitors)
    32943289        return VERR_INVALID_PARAMETER;
     
    35863581                                  uGuestWidth, uGuestHeight,
    35873582                                  pu8BufferAddress, u64TimeStamp);
     3583    NOREF(rc);
    35883584    Assert(rc == VINF_SUCCESS /* || rc == VERR_TRY_AGAIN || rc == VINF_TRY_AGAIN*/);
    35893585# endif
     
    38483844    PDRVMAINDISPLAY pDrv = PDMIDISPLAYCONNECTOR_2_MAINDISPLAY(pInterface);
    38493845    Display *pThis = pDrv->pDisplay;
    3850     DISPLAYFBINFO *pFBInfo = &pThis->maFramebuffers[uScreenId];
    38513846
    38523847    if (ASMAtomicReadU32(&pThis->mu32UpdateVBVAFlags) > 0)
     
    41584153
    41594154    PDRVMAINDISPLAY pDrv = PDMIDISPLAYCONNECTOR_2_MAINDISPLAY(pInterface);
    4160     Display *pThis = pDrv->pDisplay;
    41614155
    41624156    uint32_t cbShape = 0;
  • trunk/src/VBox/Main/src-client/DisplayImplLegacy.cpp

    r62372 r62379  
    718718            phdr->h = (uint16_t)h;
    719719
    720             DISPLAYFBINFO *pFBInfo = &maFramebuffers[uScreenId];
    721 
    722720            /* Handle the command.
    723721             *
  • trunk/src/VBox/Main/src-client/DrvAudioVRDE.cpp

    r62372 r62379  
    498498    VRDEAUDIOFORMAT audioFmt = pVRDEAudioBegin->fmt;
    499499
    500     int iSampleHz  = VRDE_AUDIO_FMT_SAMPLE_FREQ(audioFmt);
    501     int cChannels  = VRDE_AUDIO_FMT_CHANNELS(audioFmt);
    502     int cBits      = VRDE_AUDIO_FMT_BITS_PER_SAMPLE(audioFmt);
    503     bool fUnsigned = VRDE_AUDIO_FMT_SIGNED(audioFmt);
     500    int iSampleHz  = VRDE_AUDIO_FMT_SAMPLE_FREQ(audioFmt);     NOREF(iSampleHz);
     501    int cChannels  = VRDE_AUDIO_FMT_CHANNELS(audioFmt);        NOREF(cChannels);
     502    int cBits      = VRDE_AUDIO_FMT_BITS_PER_SAMPLE(audioFmt); NOREF(cBits);
     503    bool fUnsigned = VRDE_AUDIO_FMT_SIGNED(audioFmt);          NOREF(fUnsigned);
    504504
    505505    LogFlowFunc(("cbSample=%RU32, iSampleHz=%d, cChannels=%d, cBits=%d, fUnsigned=%RTbool\n",
  • trunk/src/VBox/Main/src-client/GuestDnDTargetImpl.cpp

    r62372 r62379  
    9191    {
    9292        int vrc = GuestDnDTarget::i_sendDataThread(*m_pThread, this);
     93        NOREF(vrc);
    9394    }
    9495
  • trunk/src/VBox/Main/src-client/GuestSessionImpl.cpp

    r62372 r62379  
    292292    LogFlowThisFuncEnter();
    293293
    294     int rc = VINF_SUCCESS;
    295 
    296294    AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
    297295
     
    345343    baseUninit();
    346344
    347     LogFlowFuncLeaveRC(rc);
     345    LogFlowFuncLeave();
    348346}
    349347
     
    17441742    LogFlowThisFuncEnter();
    17451743
    1746     HRESULT hr = S_OK;
    17471744    int vrc = VINF_SUCCESS;
    17481745
     
    17611758         * worker thread. */
    17621759        //this function delete pTask in case of exceptions, so there is no need in the call of delete operator
    1763         hr = pTask->createThread();
    1764 
     1760        HRESULT hrc = pTask->createThread();
    17651761    }
    17661762    catch(std::bad_alloc &)
  • trunk/src/VBox/Main/src-client/MachineDebuggerImpl.cpp

    r62372 r62379  
    13131313                            ssize_t cch = DBGFR3RegFormatValue(szHex, sizeof(szHex), &paRegs[iReg].Val,
    13141314                                                               paRegs[iReg].enmType, true /*fSpecial*/);
    1315                             Assert(cch > 0);
     1315                            Assert(cch > 0); NOREF(cch);
    13161316                            aNames[iReg] = Utf8Str(paRegs[iReg].pszName);
    13171317                            aValues[iReg] = Utf8Str(szHex);
  • trunk/src/VBox/Main/src-client/MouseImpl.cpp

    r62372 r62379  
    10091009                if (fValid)
    10101010                {
    1011                     uint8_t fu8 =   (fInContact? 0x01: 0x00)
    1012                                   | (fInRange?   0x02: 0x00);
     1011                    uint8_t fu8 = (uint8_t)(  (fInContact? 0x01: 0x00)
     1012                                            | (fInRange?   0x02: 0x00));
    10131013                    pau64Contacts[cContacts] = RT_MAKE_U64_FROM_U16((uint16_t)xAdj,
    10141014                                                                    (uint16_t)yAdj,
  • trunk/src/VBox/Main/src-client/PCIRawDevImpl.cpp

    r62372 r62379  
    7979
    8080    HRESULT hrc = machine->COMGETTER(Parent)(vbox.asOutParam());
    81     Assert(SUCCEEDED(hrc));
     81    Assert(SUCCEEDED(hrc)); NOREF(hrc);
    8282
    8383    ComPtr<IEventSource> es;
     
    9898        msg = BstrFmt("runtime error %Rrc", rc);
    9999
    100     fireHostPCIDevicePlugEvent(es, bstrId.raw(), true /* plugged */, RT_SUCCESS(rc) /* success */, pda, msg.raw());
     100    fireHostPCIDevicePlugEvent(es, bstrId.raw(), true /* plugged */, RT_SUCCESS_NP(rc) /* success */, pda, msg.raw());
    101101
    102102    return VINF_SUCCESS;
  • trunk/src/VBox/Main/src-client/RemoteUSBDeviceImpl.cpp

    r62372 r62379  
    7979
    8080    unconst(mData.port)         = pDevDesc->idPort;
    81     unconst(mData.version)      = pDevDesc->bcdUSB >> 8;
     81    unconst(mData.version)      = (uint16_t)(pDevDesc->bcdUSB >> 8);
    8282    if (fDescExt)
    8383    {
     
    117117
    118118    mData.dirty                  = false;
    119     unconst(mData.devId)        = pDevDesc->id;
     119    unconst(mData.devId)        = (uint16_t)pDevDesc->id;
    120120
    121121    unconst(mData.clientId)     = u32ClientId;
  • trunk/src/VBox/Main/src-client/UsbCardReader.cpp

    r62372 r62379  
    432432    LogFlowFunc(("ENTER: pvUser:%p\n",
    433433                 pvUser));
    434     PUSBCARDREADER pThis = RT_FROM_MEMBER(pInterface, USBCARDREADER, ICardReaderDown);
     434    PUSBCARDREADER pThis = RT_FROM_MEMBER(pInterface, USBCARDREADER, ICardReaderDown); NOREF(pThis);
    435435    int rc = VERR_NOT_SUPPORTED;
    436436    AssertRC(rc);
     
    446446    LogFlowFunc(("ENTER: pvUser:%p, u32Disposition:%RX32\n",
    447447                 pvUser, u32Disposition));
    448     PUSBCARDREADER pThis = RT_FROM_MEMBER(pInterface, USBCARDREADER, ICardReaderDown);
     448    PUSBCARDREADER pThis = RT_FROM_MEMBER(pInterface, USBCARDREADER, ICardReaderDown); NOREF(pThis);
    449449    int rc = VERR_NOT_SUPPORTED;
    450450    AssertRC(rc);
     
    745745        case VRDE_SCARD_NOTIFY_DETACH:
    746746        {
    747             VRDESCARDNOTIFYDETACH *p = (VRDESCARDNOTIFYDETACH *)pvData;
     747            VRDESCARDNOTIFYDETACH *p = (VRDESCARDNOTIFYDETACH *)pvData; NOREF(p);
    748748            Assert(cbData == sizeof(VRDESCARDNOTIFYDETACH));
    749749
     
    831831        {
    832832            Assert(cbData == sizeof(VRDESCARDRELEASECONTEXTRSP) || RT_FAILURE(rcRequest));
    833             VRDESCARDRELEASECONTEXTRSP *pRsp = (VRDESCARDRELEASECONTEXTRSP *)pvData;
    834             UCRREQCTX *pCtx = (UCRREQCTX *)pvUser;
     833            VRDESCARDRELEASECONTEXTRSP *pRsp = (VRDESCARDRELEASECONTEXTRSP *)pvData; NOREF(pRsp);
     834            UCRREQCTX *pCtx = (UCRREQCTX *)pvUser; NOREF(pCtx);
    835835
    836836            Assert(pCtx->u32Function == u32Function);
     
    903903        {
    904904            Assert(cbData == sizeof(VRDESCARDCANCELRSP) || RT_FAILURE(rcRequest));
    905             VRDESCARDCANCELRSP *pRsp = (VRDESCARDCANCELRSP *)pvData;
    906             UCRREQCTX *pCtx = (UCRREQCTX *)pvUser;
     905            VRDESCARDCANCELRSP *pRsp = (VRDESCARDCANCELRSP *)pvData; NOREF(pRsp);
     906            UCRREQCTX *pCtx = (UCRREQCTX *)pvUser; NOREF(pCtx);
    907907
    908908            Assert(pCtx->u32Function == u32Function);
     
    953953        {
    954954            Assert(cbData == sizeof(VRDESCARDRECONNECTRSP) || RT_FAILURE(rcRequest));
    955             VRDESCARDRECONNECTRSP *pRsp = (VRDESCARDRECONNECTRSP *)pvData;
    956             UCRREQCTX *pCtx = (UCRREQCTX *)pvUser;
     955            VRDESCARDRECONNECTRSP *pRsp = (VRDESCARDRECONNECTRSP *)pvData; NOREF(pRsp);
     956            UCRREQCTX *pCtx = (UCRREQCTX *)pvUser; NOREF(pCtx);
    957957
    958958            Assert(pCtx->u32Function == u32Function);
     
    994994        {
    995995            Assert(cbData == sizeof(VRDESCARDBEGINTRANSACTIONRSP) || RT_FAILURE(rcRequest));
    996             VRDESCARDBEGINTRANSACTIONRSP *pRsp = (VRDESCARDBEGINTRANSACTIONRSP *)pvData;
    997             UCRREQCTX *pCtx = (UCRREQCTX *)pvUser;
     996            VRDESCARDBEGINTRANSACTIONRSP *pRsp = (VRDESCARDBEGINTRANSACTIONRSP *)pvData; NOREF(pRsp);
     997            UCRREQCTX *pCtx = (UCRREQCTX *)pvUser; NOREF(pCtx);
    998998
    999999            Assert(pCtx->u32Function == u32Function);
     
    10051005        {
    10061006            Assert(cbData == sizeof(VRDESCARDENDTRANSACTIONRSP) || RT_FAILURE(rcRequest));
    1007             VRDESCARDENDTRANSACTIONRSP *pRsp = (VRDESCARDENDTRANSACTIONRSP *)pvData;
    1008             UCRREQCTX *pCtx = (UCRREQCTX *)pvUser;
     1007            VRDESCARDENDTRANSACTIONRSP *pRsp = (VRDESCARDENDTRANSACTIONRSP *)pvData; NOREF(pRsp);
     1008            UCRREQCTX *pCtx = (UCRREQCTX *)pvUser; NOREF(pCtx);
    10091009
    10101010            Assert(pCtx->u32Function == u32Function);
     
    10161016        {
    10171017            Assert(cbData == sizeof(VRDESCARDSTATERSP) || RT_FAILURE(rcRequest));
    1018             VRDESCARDSTATERSP *pRsp = (VRDESCARDSTATERSP *)pvData;
    1019             UCRREQCTX *pCtx = (UCRREQCTX *)pvUser;
     1018            VRDESCARDSTATERSP *pRsp = (VRDESCARDSTATERSP *)pvData; NOREF(pRsp);
     1019            UCRREQCTX *pCtx = (UCRREQCTX *)pvUser; NOREF(pCtx);
    10201020
    10211021            Assert(pCtx->u32Function == u32Function);
     
    15781578        req.ioSendPci.u32Protocol = pioSendRequest->u32Protocol;
    15791579        req.ioSendPci.u32PciLength = pioSendRequest->cbPciLength < 2 * sizeof(uint32_t)?
    1580                                          2 * sizeof(uint32_t):
     1580                                         (uint32_t)(2 * sizeof(uint32_t)):
    15811581                                         pioSendRequest->cbPciLength;
    15821582        Assert(pioSendRequest->cbPciLength <= VRDE_SCARD_MAX_PCI_DATA + 2 * sizeof(uint32_t));
  • trunk/src/VBox/Main/src-client/UsbWebcamInterface.cpp

    r62372 r62379  
    215215        case VRDE_VIDEOIN_NOTIFY_ID_DETACH:
    216216        {
    217             VRDEVIDEOINNOTIFYDETACH *p = (VRDEVIDEOINNOTIFYDETACH *)pvData;
     217            VRDEVIDEOINNOTIFYDETACH *p = (VRDEVIDEOINNOTIFYDETACH *)pvData; NOREF(p);
    218218            Assert(cbData == sizeof(VRDEVIDEOINNOTIFYDETACH));
    219219
     
    272272                                 const VRDEVIDEOINCTRLHDR *pControl, uint32_t cbControl)
    273273{
    274     EMWEBCAMREMOTE *pRemote = (EMWEBCAMREMOTE *)pDeviceCtx;
     274    EMWEBCAMREMOTE *pRemote = (EMWEBCAMREMOTE *)pDeviceCtx; NOREF(pRemote);
    275275    Assert(pRemote == mpRemote);
    276276
  • trunk/src/VBox/Main/src-client/VMMDevInterface.cpp

    r62372 r62379  
    535535    PDRVMAINVMMDEV pDrv = RT_FROM_MEMBER(pInterface, DRVMAINVMMDEV, Connector);
    536536    Console *pConsole = pDrv->pVMMDev->getParent();
    537     BOOL           val = 0;
    538537
    539538    if (!pfPageFusionEnabled)
注意: 瀏覽 TracChangeset 來幫助您使用更動檢視器

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