VirtualBox

Ignore:
Timestamp:
Apr 7, 2018 10:40:33 PM (7 years ago)
Author:
vboxsync
Message:

DevSB16: mixer_write_datab & mixer_write_indexb are works for I/O port callbacks and doesn't need the elaborate parameter list and declaration.

File:
1 edited

Legend:

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

    r71744 r71745  
    15461546}
    15471547
    1548 static IO_WRITE_PROTO(mixer_write_indexb)
    1549 {
    1550     RT_NOREF(pDevIns, cb);
    1551     PSB16STATE pThis = (PSB16STATE)opaque;
    1552     (void) nport;
     1548static int mixer_write_indexb(PSB16STATE pThis, uint32_t val)
     1549{
    15531550    pThis->mixer_nreg = val;
    1554 
    15551551    return VINF_SUCCESS;
    15561552}
     
    15941590}
    15951591
    1596 static IO_WRITE_PROTO(mixer_write_datab)
    1597 {
    1598     RT_NOREF(pDevIns, cb);
    1599     PSB16STATE  pThis = (PSB16STATE)opaque;
     1592
     1593static int mixer_write_datab(PSB16STATE pThis, uint8_t val)
     1594{
    16001595    bool        fUpdateMaster = false;
    16011596    bool        fUpdateStream = false;
    16021597
    1603     (void) nport;
    16041598    LogFlowFunc(("mixer_write [%#x] <- %#x\n", pThis->mixer_nreg, val));
    16051599
     
    17281722static IO_WRITE_PROTO(mixer_write)
    17291723{
     1724    RT_NOREF(pDevIns);
    17301725    PSB16STATE pThis = (PSB16STATE)opaque;
    17311726    int iport = nport - pThis->port;
     
    17361731            {
    17371732                case 4:
    1738                     mixer_write_indexb (pDevIns, opaque, nport, val, 1);
     1733                    mixer_write_indexb(pThis, val);
    17391734                    break;
    17401735                case 5:
    1741                     mixer_write_datab (pDevIns, opaque, nport, val, 1);
     1736                    mixer_write_datab(pThis, val);
    17421737                    break;
    17431738            }
    17441739            break;
    17451740        case 2:
    1746             mixer_write_indexb (pDevIns, opaque, nport, val & 0xff, 1);
    1747             mixer_write_datab (pDevIns, opaque, nport, (val >> 8) & 0xff, 1);
     1741            mixer_write_indexb(pThis, val & 0xff);
     1742            mixer_write_datab(pThis, (val >> 8) & 0xff);
    17481743            break;
    17491744        default:
     
    25822577        AssertMsgFailedReturn(("Error creating IRQ timer, rc=%Rrc\n", rc), rc);
    25832578
    2584     rc = PDMDevHlpIOPortRegister(pDevIns, pThis->port + 0x04,  2, pThis,
    2585                                  mixer_write, mixer_read, NULL, NULL, "SB16");
     2579    rc = PDMDevHlpIOPortRegister(pDevIns, pThis->port + 0x04,  2, pThis, mixer_write, mixer_read, NULL, NULL, "SB16");
    25862580    if (RT_FAILURE(rc))
    25872581        return rc;
    2588     rc = PDMDevHlpIOPortRegister(pDevIns, pThis->port + 0x06, 10, pThis,
    2589                                  dsp_write, dsp_read, NULL, NULL, "SB16");
     2582    rc = PDMDevHlpIOPortRegister(pDevIns, pThis->port + 0x06, 10, pThis, dsp_write,   dsp_read,   NULL, NULL, "SB16");
    25902583    if (RT_FAILURE(rc))
    25912584        return rc;
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