VirtualBox

Changeset 53512 in vbox


Ignore:
Timestamp:
Dec 11, 2014 4:18:12 PM (10 years ago)
Author:
vboxsync
Message:

Audio/DevIchAc97: no need to use an unaligned byte buffer here

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Audio/DevIchAc97.cpp

    r53501 r53512  
    353353{
    354354    PPDMDEVINS pDevIns = ICHAC97STATE_2_DEVINS(pThis);
    355     uint8_t b[8];
    356 
    357     PDMDevHlpPhysRead(pDevIns, pReg->bdbar + pReg->civ * 8, b, sizeof(b));
     355    uint32_t u32[2];
     356
     357    PDMDevHlpPhysRead(pDevIns, pReg->bdbar + pReg->civ * 8, &u32[0], sizeof(u32));
    358358    pReg->bd_valid   = 1;
    359359#if !defined(RT_ARCH_X86) && !defined(RT_ARCH_AMD64)
    360360# error Please adapt the code (audio buffers are little endian)!
    361361#else
    362     pReg->bd.addr    = (*(uint32_t *) &b[0]) & ~3;
    363     pReg->bd.ctl_len = (*(uint32_t *) &b[4]);
     362    pReg->bd.addr    = RT_H2LE_U32(u32[0] & ~3);
     363    pReg->bd.ctl_len = RT_H2LE_U32(u32[1]);
    364364#endif
    365365    pReg->picb       = pReg->bd.ctl_len & 0xffff;
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