VirtualBox

Changeset 63267 in vbox for trunk/src/VBox/NetworkServices


Ignore:
Timestamp:
Aug 10, 2016 1:34:15 PM (9 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
109900
Message:

NetworkServices: warnings

Location:
trunk/src/VBox/NetworkServices
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/NetworkServices/NAT/VBoxNetLwipNAT.cpp

    r62481 r63267  
    415415            break;
    416416        }
     417
     418        default: break; /* Shut up MSC. */
    417419    }
    418420    return hrc;
     
    426428
    427429    HRESULT hrc = com::Initialize();
    428     Assert(!FAILED(hrc));
     430    Assert(!FAILED(hrc)); NOREF(hrc);
    429431
    430432    proxy_arp_hook = pxremap_proxy_arp;
     
    516518{
    517519    AssertPtrReturnVoid(arg);
    518     VBoxNetLwipNAT *pThis = (VBoxNetLwipNAT *)arg;
    519520
    520521    /* XXX: proxy finalization */
     
    998999            RT_ZERO(Rule);
    9991000
    1000             int irc = netPfStrToPf(Val.psz, (rc == 'P'), &Rule.Pfr);
     1001            int rc2 = netPfStrToPf(Val.psz, (rc == 'P'), &Rule.Pfr);
     1002            RT_NOREF_PV(rc2);
    10011003            rules.push_back(Rule);
    10021004            return VINF_SUCCESS;
     
    10131015    AssertReturn(cbFrame != 0, VERR_INVALID_PARAMETER);
    10141016
    1015     struct pbuf *p = pbuf_alloc(PBUF_RAW, cbFrame + ETH_PAD_SIZE, PBUF_POOL);
     1017    struct pbuf *p = pbuf_alloc(PBUF_RAW, (u16_t)cbFrame + ETH_PAD_SIZE, PBUF_POOL);
    10161018    if (RT_UNLIKELY(p == NULL))
    10171019        return VERR_NO_MEMORY;
     
    10491051int VBoxNetLwipNAT::processGSO(PCPDMNETWORKGSO pGso, size_t cbFrame)
    10501052{
    1051     if (!PDMNetGsoIsValid(pGso, cbFrame,
    1052                           cbFrame - sizeof(PDMNETWORKGSO)))
     1053    if (!PDMNetGsoIsValid(pGso, cbFrame, cbFrame - sizeof(PDMNETWORKGSO)))
    10531054        return VERR_INVALID_PARAMETER;
    10541055
     
    10571058    uint32_t const  cSegs = PDMNetGsoCalcSegmentCount(pGso,
    10581059                                                      cbFrame);
    1059     for (size_t iSeg = 0; iSeg < cSegs; iSeg++)
     1060    for (uint32_t iSeg = 0; iSeg < cSegs; iSeg++)
    10601061    {
    10611062        uint32_t cbSegFrame;
    1062         void    *pvSegFrame =
    1063           PDMNetGsoCarveSegmentQD(pGso,
    1064                                   (uint8_t *)(pGso + 1),
    1065                                   cbFrame,
    1066                                   abHdrScratch,
    1067                                   iSeg,
    1068                                   cSegs,
    1069                                   &cbSegFrame);
     1063        void    *pvSegFrame = PDMNetGsoCarveSegmentQD(pGso,
     1064                                                      (uint8_t *)(pGso + 1),
     1065                                                      cbFrame,
     1066                                                      abHdrScratch,
     1067                                                      iSeg,
     1068                                                      cSegs,
     1069                                                      &cbSegFrame);
    10701070
    10711071        int rc = processFrame(pvSegFrame, cbSegFrame);
  • trunk/src/VBox/NetworkServices/NetLib/VBoxNetBaseService.cpp

    r62679 r63267  
    533533
    534534/* S/G API */
    535 int VBoxNetBaseService::sendBufferOnWire(PCINTNETSEG pcSg, int cSg, size_t cbFrame)
    536 {
     535int VBoxNetBaseService::sendBufferOnWire(PCINTNETSEG paSegs, size_t cSegs, size_t cbFrame)
     536{
     537    /* Allocate frame */
    537538    PINTNETHDR pHdr = NULL;
    538     uint8_t *pu8Frame = NULL;
    539 
    540     /* Allocate frame */
    541     int rc = IntNetRingAllocateFrame(&m->m_pIfBuf->Send, cbFrame, &pHdr, (void **)&pu8Frame);
     539    uint8_t *pbFrame = NULL;
     540    int rc = IntNetRingAllocateFrame(&m->m_pIfBuf->Send, (uint32_t)cbFrame, &pHdr, (void **)&pbFrame);
    542541    AssertRCReturn(rc, rc);
    543542
    544543    /* Now we fill pvFrame with S/G above */
    545     int offFrame = 0;
    546     for (int idxSg = 0; idxSg < cSg; ++idxSg)
    547     {
    548         memcpy(&pu8Frame[offFrame], pcSg[idxSg].pv, pcSg[idxSg].cb);
    549         offFrame+=pcSg[idxSg].cb;
     544    size_t offFrame = 0;
     545    for (size_t idxSeg = 0; idxSeg < cSegs; ++idxSeg)
     546    {
     547        memcpy(&pbFrame[offFrame], paSegs[idxSeg].pv, paSegs[idxSeg].cb);
     548        offFrame += paSegs[idxSeg].cb;
    550549    }
    551550
     
    817816void VBoxNetBaseService::debugPrintV(int iMinLevel, bool fMsg, const char *pszFmt, va_list va) const
    818817{
     818    RT_NOREF(fMsg);
    819819    if (iMinLevel <= m->m_cVerbosity)
    820820    {
     
    840840    {
    841841        PRTGETOPTDEF pOpt = m->m_vecOptionDefs[i];
    842         memcpy(&pOptArray[i], m->m_vecOptionDefs[i], sizeof(RTGETOPTDEF));
     842        memcpy(&pOptArray[i], pOpt, sizeof(*pOpt));
    843843    }
    844844    return pOptArray;
  • trunk/src/VBox/NetworkServices/NetLib/VBoxNetBaseService.h

    r62481 r63267  
    7070    int                 waitForIntNetEvent(int cMillis);
    7171    int                 abortWait();
    72     int                 sendBufferOnWire(PCINTNETSEG pSg, int cSg, size_t cbBuffer);
     72    int                 sendBufferOnWire(PCINTNETSEG paSegs, size_t cSegs, size_t cbBuffer);
    7373    void                flushWire();
    7474
  • trunk/src/VBox/NetworkServices/NetLib/VBoxNetIntIf.cpp

    r62481 r63267  
    8080int VBoxNetIntIfRingWriteFrame(PINTNETBUF pBuf, PINTNETRINGBUF pRingBuf, size_t cSegs, PCINTNETSEG paSegs)
    8181{
     82    RT_NOREF(pBuf);
     83
    8284    /*
    8385     * Validate input.
  • trunk/src/VBox/NetworkServices/NetLib/VBoxNetPortForwardString.cpp

    r62681 r63267  
    5555                                bool fEmptyAcceptable)
    5656{
    57     int idxRaw = 0;
    5857    int cbField = 0;
    5958
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