VirtualBox

Changeset 106600 in vbox


Ignore:
Timestamp:
Oct 23, 2024 12:54:42 AM (5 weeks ago)
Author:
vboxsync
Message:

DevPL061: Warnings. jiraref:VBP-1171

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Gpio/DevPL061.cpp

    r106061 r106600  
    255255     *     to be read as 0, regardless of their value.
    256256     */
    257     if (    off >= PL061_REG_GPIODATA_INDEX
    258         &&  off < PL061_REG_GPIODATA_INDEX_END + sizeof(uint32_t))
     257    AssertCompile(PL061_REG_GPIODATA_INDEX == 0); /* Skip 'off >= PL061_REG_GPIODATA_INDEX' check and avoid C4267 */
     258    if (off < PL061_REG_GPIODATA_INDEX_END + sizeof(uint32_t))
    259259    {
    260260        *(uint32_t *)pv = pThis->u8RegData & (uint8_t)(off >> 2);
     
    343343     *     must be HIGH. Otherwise the bit values remain unchanged by the write.
    344344     */
    345     if (    off >= PL061_REG_GPIODATA_INDEX
    346         &&  off < PL061_REG_GPIODATA_INDEX_END + sizeof(uint32_t))
     345    AssertCompile(PL061_REG_GPIODATA_INDEX == 0); /* Skip 'off >= PL061_REG_GPIODATA_INDEX' check and avoid C4267 */
     346    if (off < PL061_REG_GPIODATA_INDEX_END + sizeof(uint32_t))
    347347    {
    348348        uint8_t uMask = (uint8_t)(off >> 2);
     
    459459    PDEVPL061   pThis   = PDMDEVINS_2_DATA(pDevIns, PDEVPL061);
    460460
    461     AssertReturn(idGpio < PL061_GPIO_NUM, VERR_INVALID_PARAMETER);
    462 
    463     return !RT_BOOL(pThis->u8RegDir & RT_BIT(idGpio)); /* Bit cleared means input. */
     461    AssertReturn(idGpio < PL061_GPIO_NUM, false);
     462
     463    return !(pThis->u8RegDir & RT_BIT(idGpio)); /* Bit cleared means input. */
    464464}
    465465
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