VirtualBox

Changeset 48400 in vbox for trunk/src/VBox/Devices


Ignore:
Timestamp:
Sep 10, 2013 8:38:28 AM (11 years ago)
Author:
vboxsync
Message:

DevEFI.cpp: style and docs.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/EFI/DevEFI.cpp

    r46356 r48400  
    16611661
    16621662
    1663 static int efiParseDeviceString(PDEVEFI  pThis, char *pszDeviceProps)
    1664 {
    1665     int         rc = 0;
    1666     uint32_t    iStr, iHex, u32OutLen;
    1667     uint8_t     u8Value = 0;                    /* (shut up gcc) */
    1668     bool        fUpper = true;
    1669 
    1670     u32OutLen = (uint32_t)RTStrNLen(pszDeviceProps, RTSTR_MAX) / 2 + 1;
    1671 
    1672     pThis->pbDeviceProps = (uint8_t *)PDMDevHlpMMHeapAlloc(pThis->pDevIns, u32OutLen);
     1663/**
     1664 * Converts a hex string into a binary data blob located at
     1665 * pThis->pbDeviceProps, size returned as pThis->cbDeviceProps.
     1666 *
     1667 * @returns VERR_NO_MEMORY or VINF_SUCCESS.
     1668 * @param   pThis           The EFI instance data.
     1669 * @param   pszDeviceProps  The device property hex string to decode.
     1670 */
     1671static int efiParseDeviceString(PDEVEFI pThis, const char *pszDeviceProps)
     1672{
     1673    uint32_t const cbOut = (uint32_t)RTStrNLen(pszDeviceProps, RTSTR_MAX) / 2 + 1;
     1674    pThis->pbDeviceProps = (uint8_t *)PDMDevHlpMMHeapAlloc(pThis->pDevIns, cbOut);
    16731675    if (!pThis->pbDeviceProps)
    16741676        return VERR_NO_MEMORY;
    16751677
    1676     for (iStr=0, iHex = 0; pszDeviceProps[iStr]; iStr++)
     1678    uint32_t    iHex    = 0;
     1679    bool        fUpper  = true;
     1680    uint8_t     u8Value = 0;                    /* (shut up gcc) */
     1681    for (uint32_t iStr = 0; pszDeviceProps[iStr]; iStr++)
    16771682    {
    16781683        uint8_t u8Hb = efiGetHalfByte(pszDeviceProps[iStr]);
     
    16851690            pThis->pbDeviceProps[iHex++] = u8Hb | u8Value;
    16861691
    1687         Assert(iHex < u32OutLen);
     1692        Assert(iHex < cbOut);
    16881693        fUpper = !fUpper;
    16891694    }
     
    16921697    pThis->cbDeviceProps = iHex;
    16931698
    1694     return rc;
     1699    return VINF_SUCCESS;
    16951700}
    16961701
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