VirtualBox

Changeset 89938 in vbox for trunk/src/VBox/Devices/Input


Ignore:
Timestamp:
Jun 29, 2021 6:57:51 AM (3 years ago)
Author:
vboxsync
Message:

Warnings.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Input/DevPS2K.cpp

    r89935 r89938  
    733733    else if (u8HidPage == USB_HID_CC_PAGE)
    734734    {
    735         for (int i = 0; i < RT_ELEMENTS(aPS2CCKeys); ++i)
     735        for (unsigned i = 0; i < RT_ELEMENTS(aPS2CCKeys); ++i)
    736736            if (aPS2CCKeys[i].usageId == u16HidUsage)
    737737            {
     
    744744    else if (u8HidPage == USB_HID_DC_PAGE)
    745745    {
    746         for (int i = 0; i < RT_ELEMENTS(aPS2DCKeys); ++i)
     746        for (unsigned i = 0; i < RT_ELEMENTS(aPS2DCKeys); ++i)
    747747            if (aPS2CCKeys[i].usageId == u16HidUsage)
    748748            {
     
    764764}
    765765
    766 static uint32_t ps2kR3InternalCodeToHid(int iKeyCode)
     766static uint32_t ps2kR3InternalCodeToHid(unsigned uKeyCode)
    767767{
    768768    uint16_t    u16HidUsage;
    769769    uint32_t    u32HidCode = 0;
    770770
    771     if ((iKeyCode >= PS2K_PAGE_DC_START) && (iKeyCode <= PS2K_PAGE_DC_END))
    772     {
    773         u16HidUsage = aPS2DCKeys[iKeyCode - PS2K_PAGE_DC_START].usageId;
     771    if ((uKeyCode >= PS2K_PAGE_DC_START) && (uKeyCode <= PS2K_PAGE_DC_END))
     772    {
     773        u16HidUsage = aPS2DCKeys[uKeyCode - PS2K_PAGE_DC_START].usageId;
    774774        u32HidCode  = RT_MAKE_U32(u16HidUsage, USB_HID_DC_PAGE);
    775775    }
    776     else if ((iKeyCode >= PS2K_PAGE_CC_START) && (iKeyCode <= PS2K_PAGE_CC_END))
    777     {
    778         u16HidUsage = aPS2CCKeys[iKeyCode - PS2K_PAGE_CC_START].usageId;
     776    else if ((uKeyCode >= PS2K_PAGE_CC_START) && (uKeyCode <= PS2K_PAGE_CC_END))
     777    {
     778        u16HidUsage = aPS2CCKeys[uKeyCode - PS2K_PAGE_CC_START].usageId;
    779779        u32HidCode  = RT_MAKE_U32(u16HidUsage, USB_HID_CC_PAGE);
    780780    }
    781781    else    /* Must be the keyboard usage page. */
    782782    {
    783         if (iKeyCode <= VBOX_USB_MAX_USAGE_CODE)
    784             u32HidCode = RT_MAKE_U32(iKeyCode, USB_HID_KB_PAGE);
     783        if (uKeyCode <= VBOX_USB_MAX_USAGE_CODE)
     784            u32HidCode = RT_MAKE_U32(uKeyCode, USB_HID_KB_PAGE);
    785785        else
    786             AssertMsgFailed(("iKeyCode out of range! (%d)\n", iKeyCode));
     786            AssertMsgFailed(("uKeyCode out of range! (%u)\n", uKeyCode));
    787787    }
    788788
     
    11201120    LogFlowFunc(("Releasing keys...\n"));
    11211121
    1122     for (int iKey = 0; iKey < sizeof(pThis->abDepressedKeys); ++iKey)
    1123         if (pThis->abDepressedKeys[iKey])
     1122    for (unsigned uKey = 0; uKey < RT_ELEMENTS(pThis->abDepressedKeys); ++uKey)
     1123        if (pThis->abDepressedKeys[uKey])
    11241124        {
    1125             ps2kR3ProcessKeyEvent(pDevIns, pThis, ps2kR3InternalCodeToHid(iKey), false /* key up */);
    1126             pThis->abDepressedKeys[iKey] = 0;
     1125            ps2kR3ProcessKeyEvent(pDevIns, pThis, ps2kR3InternalCodeToHid(uKey), false /* key up */);
     1126            pThis->abDepressedKeys[uKey] = 0;
    11271127        }
    11281128    LogFlowFunc(("Done releasing keys\n"));
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