VirtualBox

Changeset 62960 in vbox for trunk/src/VBox/Devices/USB


Ignore:
Timestamp:
Aug 4, 2016 8:09:34 AM (9 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
109563
Message:

Devices: warnings

Location:
trunk/src/VBox/Devices/USB
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/USB/VUSBSnifferPcapNg.cpp

    r62959 r62960  
    452452static DECLCALLBACK(int) vusbSnifferFmtPcanNgInit(PVUSBSNIFFERFMTINT pThis, PVUSBSNIFFERSTRM pStrm)
    453453{
    454     int rc = VINF_SUCCESS;
    455 
    456454    pThis->pStrm       = pStrm;
    457455    pThis->cbBlockCur  = 0;
     
    470468
    471469    /* Write the blocks. */
    472     rc = vusbSnifferBlockNew(pThis, &Shb.Hdr, sizeof(Shb));
     470    int rc = vusbSnifferBlockNew(pThis, &Shb.Hdr, sizeof(Shb));
    473471    if (RT_SUCCESS(rc))
    474472    {
  • trunk/src/VBox/Devices/USB/VUSBSnifferUsbMon.cpp

    r62956 r62960  
    8181static DECLCALLBACK(void) vusbSnifferFmtUsbMonDestroy(PVUSBSNIFFERFMTINT pThis)
    8282{
    83 
     83    RT_NOREF(pThis);
    8484}
    8585
  • trunk/src/VBox/Devices/USB/VUSBSnifferVmx.cpp

    r62956 r62960  
    9393static int vusbSnifferFmtVmxLogData(PVUSBSNIFFERFMTINT pThis, PRTTIME pTime, uint8_t *pbBuf, size_t cbBuf)
    9494{
    95     int rc = VINF_SUCCESS;
    96     char aszLineBuf[256];
    97     uint16_t off = 0;
     95    int rc;
     96    char szLineBuf[256];
     97    size_t off = 0;
    9898
    9999    do
    100100    {
    101         size_t cch = RTStrPrintf(&aszLineBuf[0], sizeof(aszLineBuf),
    102                                  "%s %02u %02u:%02u:%02u.%3.*u: vmx| USBIO:  %03x: %16.*Rhxs\n",
    103                                  s_apszMonths[pTime->u8Month - 1], pTime->u8MonthDay, pTime->u8Hour, pTime->u8Minute, pTime->u8Second, 3, pTime->u32Nanosecond,
     101        size_t cch = RTStrPrintf(&szLineBuf[0], sizeof(szLineBuf),
     102                                 "%s %02u %02u:%02u:%02u.%3.*u: vmx| USBIO:  %03zx: %16.*Rhxs\n",
     103                                 s_apszMonths[pTime->u8Month - 1], pTime->u8MonthDay,
     104                                 pTime->u8Hour, pTime->u8Minute, pTime->u8Second, 3, pTime->u32Nanosecond,
    104105                                 off, RT_MIN(cbBuf - off, 16), pbBuf);
    105         rc = pThis->pStrm->pfnWrite(pThis->pStrm, &aszLineBuf[0], cch);
     106        rc = pThis->pStrm->pfnWrite(pThis->pStrm, &szLineBuf[0], cch);
    106107        off   += RT_MIN(cbBuf, 16);
    107108        pbBuf += RT_MIN(cbBuf, 16);
     
    131132    RTTIMESPEC TimeNow;
    132133    RTTIME Time;
    133     char aszLineBuf[256];
     134    char szLineBuf[256];
    134135    const char *pszEvt = enmEvent == VUSBSNIFFEREVENT_SUBMIT ? "Down" : "Up";
    135136    uint8_t cIsocPkts = pUrb->enmType == VUSBXFERTYPE_ISOC ? pUrb->cIsocPkts : 0;
     
    138139        return VINF_SUCCESS;
    139140
    140     RT_ZERO(aszLineBuf);
     141    RT_ZERO(szLineBuf);
    141142
    142143    RTTimeNow(&TimeNow);
    143144    RTTimeExplode(&Time, &TimeNow);
    144145
    145     size_t cch = RTStrPrintf(&aszLineBuf[0], sizeof(aszLineBuf),
     146    size_t cch = RTStrPrintf(&szLineBuf[0], sizeof(szLineBuf),
    146147                             "%s %02u %02u:%02u:%02u.%3.*u: vmx| USBIO: %s dev=%u endpt=%x datalen=%u numPackets=%u status=%u 0\n",
    147148                             s_apszMonths[Time.u8Month - 1], Time.u8MonthDay, Time.u8Hour, Time.u8Minute, Time.u8Second, 3, Time.u32Nanosecond,
    148149                             pszEvt, pUrb->DstAddress, pUrb->EndPt | (pUrb->enmDir == VUSBDIRECTION_IN ? 0x80 : 0x00),
    149150                             pUrb->cbData, cIsocPkts, pUrb->enmStatus);
    150     int rc = pThis->pStrm->pfnWrite(pThis->pStrm, &aszLineBuf[0], cch);
     151    int rc = pThis->pStrm->pfnWrite(pThis->pStrm, &szLineBuf[0], cch);
    151152    if (RT_SUCCESS(rc))
    152153    {
  • trunk/src/VBox/Devices/USB/VUSBUrb.cpp

    r60515 r62960  
    746746 * @param   pUrb        The URB to submit.
    747747 */
    748 static void vusbMsgDoTransfer(PVUSBURB pUrb, PVUSBSETUP pSetup, PVUSBCTRLEXTRA pExtra, PVUSBPIPE pPipe, PVUSBDEV pDev)
    749 {
     748static void vusbMsgDoTransfer(PVUSBURB pUrb, PVUSBSETUP pSetup, PVUSBCTRLEXTRA pExtra, PVUSBPIPE pPipe)
     749{
     750    RT_NOREF(pPipe);
     751
    750752    /*
    751753     * Mark this transfer as sent (cleared at setup time).
     
    904906            /* pre-buffer our output if it's device-to-host */
    905907            if (pSetup->bmRequestType & VUSB_DIR_TO_HOST)
    906                 vusbMsgDoTransfer(pUrb, pSetup, pExtra, pPipe, pDev);
     908                vusbMsgDoTransfer(pUrb, pSetup, pExtra, pPipe);
    907909            else if (pSetup->wLength)
    908910            {
     
    919921            {
    920922                LogFlow(("%s: vusbUrbSubmitCtrl: stage=SETUP - to dev: sending\n", pUrb->pszDesc));
    921                 vusbMsgDoTransfer(pUrb, pSetup, pExtra, pPipe, pDev);
     923                vusbMsgDoTransfer(pUrb, pSetup, pExtra, pPipe);
    922924            }
    923925            break;
     
    992994                {
    993995                    LogFlow(("%s: vusbUrbSubmitCtrl: stage=DATA - to dev: sending\n", pUrb->pszDesc));
    994                     vusbMsgDoTransfer(pUrb, pSetup, pExtra, pPipe, pDev);
     996                    vusbMsgDoTransfer(pUrb, pSetup, pExtra, pPipe);
    995997                    break;
    996998                }
     
    10151017            {
    10161018                LogFlow(("%s: vusbUrbSubmitCtrl: stage=STATUS - to dev: sending\n", pUrb->pszDesc));
    1017                 vusbMsgDoTransfer(pUrb, pSetup, pExtra, pPipe, pDev);
     1019                vusbMsgDoTransfer(pUrb, pSetup, pExtra, pPipe);
    10181020            }
    10191021            break;
     
    12491251    while (pVUsbUrb)
    12501252    {
    1251         PVUSBURB pUrb = pVUsbUrb->pUrb;
    1252 
    1253         vusbUrbAssert(pUrb);
     1253        vusbUrbAssert(pVUsbUrb->pUrb);
    12541254        PVUSBURBVUSB pVUsbUrbNext = RTListGetNext(pUrbLst, pVUsbUrb, VUSBURBVUSBINT, NdLst);
    12551255        PVUSBDEV pDev = pVUsbUrb->pDev;
  • trunk/src/VBox/Devices/USB/VUSBUrbPool.cpp

    r62463 r62960  
    118118                                      size_t cbHciTd, unsigned cTds)
    119119{
     120    Assert((uint32_t)cbData == cbData);
     121    Assert((uint32_t)cbHci == cbHci);
     122
    120123    /*
    121124     * Reuse or allocate a new URB.
     
    188191     * (Re)init the URB
    189192     */
    190     uint32_t offAlloc = cbData;
     193    uint32_t offAlloc = (uint32_t)cbData;
    191194    PVUSBURB pUrb = &pHdr->Urb;
    192195    pUrb->u32Magic               = VUSBURB_MAGIC;
     
    204207    pUrb->Dev.pvPrivate          = NULL;
    205208    pUrb->Dev.pNext              = NULL;
    206     pUrb->EndPt                  = ~0;
     209    pUrb->EndPt                  = UINT8_MAX;
    207210    pUrb->enmType                = enmType;
    208211    pUrb->enmDir                 = enmDir;
    209212    pUrb->fShortNotOk            = false;
    210213    pUrb->enmStatus              = VUSBSTATUS_INVALID;
    211     pUrb->cbData                 = cbData;
     214    pUrb->cbData                 = (uint32_t)cbData;
    212215    pUrb->pHci                   = cbHci ? (PVUSBURBHCI)&pUrb->abData[offAlloc] : NULL;
    213     offAlloc += cbHci;
     216    offAlloc += (uint32_t)cbHci;
    214217    pUrb->paTds                  = (cbHciTd && cTds) ? (PVUSBURBHCITD)&pUrb->abData[offAlloc] : NULL;
    215218
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