VirtualBox

Changeset 62992 in vbox for trunk/src


Ignore:
Timestamp:
Aug 4, 2016 3:08:21 PM (9 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
109601
Message:

Devices: warnings

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

Legend:

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

    r62956 r62992  
    357357    uint32_t altmap[4] = {0,};
    358358    uint8_t *tmp, *end = buf + len;
    359     uint8_t *orig_desc = buf;
    360359    uint8_t alt;
    361360    int state;
     
    762761static DECLCALLBACK(void) usbProxyDestruct(PPDMUSBINS pUsbIns)
    763762{
     763    PDMUSB_CHECK_VERSIONS_RETURN_VOID(pUsbIns);
    764764    PUSBPROXYDEV pThis = PDMINS_2_DATA(pUsbIns, PUSBPROXYDEV);
    765765    Log(("usbProxyDestruct: destroying pProxyDev=%s\n", pUsbIns->pszName));
     
    859859static DECLCALLBACK(int) usbProxyConstruct(PPDMUSBINS pUsbIns, int iInstance, PCFGMNODE pCfg, PCFGMNODE pCfgGlobal)
    860860{
     861    PDMUSB_CHECK_VERSIONS_RETURN(pUsbIns);
     862    RT_NOREF(iInstance);
    861863    PUSBPROXYDEV pThis = PDMINS_2_DATA(pUsbIns, PUSBPROXYDEV);
    862864    LogFlow(("usbProxyConstruct: pUsbIns=%p iInstance=%d\n", pUsbIns, iInstance));
  • trunk/src/VBox/Devices/USB/win/USBProxyDevice-win.cpp

    r62956 r62992  
    7979*   Internal Functions                                                                                                           *
    8080*********************************************************************************************************************************/
    81 static int usbProxyWinSetInterface(PUSBPROXYDEV p, int ifnum, int setting);
     81static int usbProxyWinSetInterface(PUSBPROXYDEV p, int iIf, int setting);
    8282
    8383/**
     
    9090static int usbProxyWinHandleUnpluggedDevice(PUSBPROXYDEV pProxyDev, DWORD dwErr)
    9191{
    92     PPRIV_USBW32 pPriv = USBPROXYDEV_2_DATA(pProxyDev, PPRIV_USBW32);
     92#ifdef LOG_ENABLED
     93    PPRIV_USBW32 pPriv = USBPROXYDEV_2_DATA(pProxyDev, PPRIV_USBW32);
     94#endif
    9395
    9496    if (   dwErr == ERROR_INVALID_HANDLE_STATE
     
    110112static DECLCALLBACK(int) usbProxyWinOpen(PUSBPROXYDEV pProxyDev, const char *pszAddress, void *pvBackend)
    111113{
     114    RT_NOREF(pvBackend);
    112115    PPRIV_USBW32 pPriv = USBPROXYDEV_2_DATA(pProxyDev, PPRIV_USBW32);
    113116
     
    140143            if (DeviceIoControl(pPriv->hDev, SUPUSB_IOCTL_GET_VERSION, NULL, 0, &version, sizeof(version), &cbReturned, NULL))
    141144            {
    142                 if (!(    version.u32Major != USBDRV_MAJOR_VERSION
    143                       ||  version.u32Minor <  USBDRV_MINOR_VERSION))
     145                if (    version.u32Major == USBDRV_MAJOR_VERSION
     146#if USBDRV_MINOR_VERSION != 0
     147                    &&  version.u32Minor >=  USBDRV_MINOR_VERSION
     148#endif
     149                   )
    144150                {
    145151                    USBSUP_CLAIMDEV in;
     
    245251static DECLCALLBACK(int) usbProxyWinReset(PUSBPROXYDEV pProxyDev, bool fResetOnLinux)
    246252{
     253    RT_NOREF(fResetOnLinux);
    247254    PPRIV_USBW32 pPriv = USBPROXYDEV_2_DATA(pProxyDev, PPRIV_USBW32);
    248255    DWORD cbReturned;
     
    302309}
    303310
    304 static DECLCALLBACK(int) usbProxyWinClaimInterface(PUSBPROXYDEV pProxyDev, int ifnum)
     311static DECLCALLBACK(int) usbProxyWinClaimInterface(PUSBPROXYDEV pProxyDev, int iIf)
    305312{
    306313    /* Called just before we use an interface. Needed on Linux to claim
     
    311318    PPRIV_USBW32 pPriv = USBPROXYDEV_2_DATA(pProxyDev, PPRIV_USBW32);
    312319
    313     pPriv->bInterfaceNumber = ifnum;
     320    pPriv->bInterfaceNumber = iIf;
    314321
    315322    Assert(pPriv);
     
    317324}
    318325
    319 static DECLCALLBACK(int) usbProxyWinReleaseInterface(PUSBPROXYDEV pProxyDev, int ifnum)
    320 {
     326static DECLCALLBACK(int) usbProxyWinReleaseInterface(PUSBPROXYDEV pProxyDev, int iIf)
     327{
     328    RT_NOREF(pProxyDev, iIf);
    321329    /* The opposite of claim_interface. */
    322     PPRIV_USBW32 pPriv = USBPROXYDEV_2_DATA(pProxyDev, PPRIV_USBW32);
    323 
    324     Assert(pPriv);
    325330    return VINF_SUCCESS;
    326331}
    327332
    328 static DECLCALLBACK(int) usbProxyWinSetInterface(PUSBPROXYDEV pProxyDev, int ifnum, int setting)
     333static DECLCALLBACK(int) usbProxyWinSetInterface(PUSBPROXYDEV pProxyDev, int iIf, int setting)
    329334{
    330335    /* Select an alternate setting for an interface, the same applies
     
    338343    Assert(pPriv);
    339344
    340     Log(("usbproxy: Select interface of %x to %d/%d\n", pPriv->hDev, ifnum, setting));
    341     in.bInterfaceNumber  = ifnum;
     345    Log(("usbproxy: Select interface of %x to %d/%d\n", pPriv->hDev, iIf, setting));
     346    in.bInterfaceNumber  = iIf;
    342347    in.bAlternateSetting = setting;
    343348
     
    559564            /* Wait for the wakeup call. */
    560565            DWORD cMilliesWait = cMillies == RT_INDEFINITE_WAIT ? INFINITE : cMillies;
    561             DWORD rc = WaitForMultipleObjects(1, &pPriv->hEventWakeup, FALSE, cMilliesWait);
     566            DWORD dwRc = WaitForMultipleObjects(1, &pPriv->hEventWakeup, FALSE, cMilliesWait);
     567            NOREF(dwRc);
    562568        }
    563569
     
    630636    }
    631637
    632     if (rc >= WAIT_OBJECT_0 && rc < WAIT_OBJECT_0 + cQueuedUrbs)
     638    AssertCompile(WAIT_OBJECT_0 == 0);
     639    if (/*rc >= WAIT_OBJECT_0 && */ rc < WAIT_OBJECT_0 + cQueuedUrbs)
    633640    {
    634641        RTCritSectEnter(&pPriv->CritSect);
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