VirtualBox

Changeset 71765 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Apr 9, 2018 10:56:03 AM (7 years ago)
Author:
vboxsync
Message:

DevSB16: Don't use RTStrPrintf to name streams 'Output'; eliminated incorrect+unnecessary use of RTStrPrintf in sb16CreateDrvStream.

File:
1 edited

Legend:

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

    r71763 r71765  
    363363        pCfg->Props.cShift    = PDMAUDIOPCMPROPS_MAKE_SHIFT_PARMS(pCfg->Props.cBits, pCfg->Props.cChannels);
    364364
    365         RTStrPrintf(pCfg->szName, sizeof(pCfg->szName), "Output");
     365        strcpy(pCfg->szName, "Output");
    366366
    367367        sb16CloseOut(pThis);
     
    509509        pCfg->Props.cShift    = PDMAUDIOPCMPROPS_MAKE_SHIFT_PARMS(pCfg->Props.cBits, pCfg->Props.cChannels);
    510510
    511         RTStrPrintf(pCfg->szName, sizeof(pCfg->szName), "Output");
     511        strcpy(pCfg->szName, "Output");
    512512
    513513        sb16CloseOut(pThis);
     
    10611061}
    10621062
    1063 static void sb16ResetLegacy(PSB16STATE pThis)
     1063static void sb16CmdResetLegacy(PSB16STATE pThis)
    10641064{
    10651065    LogFlowFuncEnter();
     
    10851085    pCfg->Props.cShift    = PDMAUDIOPCMPROPS_MAKE_SHIFT_PARMS(pCfg->Props.cBits, pCfg->Props.cChannels);
    10861086
    1087     RTStrPrintf(pCfg->szName, sizeof(pCfg->szName), "Output");
     1087    AssertCompile(sizeof(pCfg->szName) > sizeof("Output"));
     1088    strcpy(pCfg->szName, "Output");
    10881089
    10891090    sb16CloseOut(pThis);
    10901091}
    10911092
    1092 static void sb16Reset(PSB16STATE pThis)
     1093static void sb16CmdReset(PSB16STATE pThis)
    10931094{
    10941095    PDMDevHlpISASetIrq(pThis->pDevInsR3, pThis->irq, 0);
     
    11151116
    11161117    sb16Control(pThis, 0);
    1117     sb16ResetLegacy(pThis);
     1118    sb16CmdResetLegacy(pThis);
    11181119}
    11191120
     
    11441145                        }
    11451146                        else
    1146                             sb16Reset(pThis);
     1147                            sb16CmdReset(pThis);
    11471148                    }
    11481149                    pThis->v2x6 = 0;
     
    11601161
    11611162                case 0xb8:              /* Panic */
    1162                     sb16Reset(pThis);
     1163                    sb16CmdReset(pThis);
    11631164                    break;
    11641165
    11651166                case 0x39:
    11661167                    dsp_out_data(pThis, 0x38);
    1167                     sb16Reset(pThis);
     1168                    sb16CmdReset(pThis);
    11681169                    pThis->v2x6 = 0x39;
    11691170                    break;
     
    17561757}
    17571758
     1759/**
     1760 * @callback_method_impl{FNTMTIMERDEV}
     1761 */
    17581762static DECLCALLBACK(void) sb16TimerIO(PPDMDEVINS pDevIns, PTMTIMER pTimer, void *pvUser)
    17591763{
     
    20372041            pCfg->Props.cShift    = PDMAUDIOPCMPROPS_MAKE_SHIFT_PARMS(pCfg->Props.cBits, pCfg->Props.cChannels);
    20382042
    2039             RTStrPrintf(pCfg->szName, sizeof(pCfg->szName), "Output");
     2043            strcpy(pCfg->szName, "Output");
    20402044
    20412045            sb16CloseOut(pThis);
     
    21212125        return VERR_NO_MEMORY;
    21222126
    2123     if (!RTStrPrintf(pCfgHost->szName, sizeof(pCfgHost->szName), "%s", pCfg->szName))
    2124     {
    2125         RTMemFree(pCfgHost);
    2126         return VERR_BUFFER_OVERFLOW;
    2127     }
    2128 
    21292127    LogFunc(("[LUN#%RU8] %s\n", pDrv->uLUN, pCfgHost->szName));
    21302128
     
    24712469    sb16SpeakerControl(pThis, 0);
    24722470    sb16Control(pThis, 0);
    2473     sb16ResetLegacy(pThis);
     2471    sb16CmdResetLegacy(pThis);
    24742472}
    24752473
     
    26532651    LogFunc(("cLUNs=%RU8, rc=%Rrc\n", uLUN, rc));
    26542652
    2655     sb16ResetLegacy(pThis);
     2653    sb16CmdResetLegacy(pThis);
    26562654
    26572655#ifdef VBOX_WITH_AUDIO_SB16_ONETIME_INIT
     
    26792677            LogRel(("SB16: Falling back to NULL backend (no sound audible)\n"));
    26802678
    2681             sb16ResetLegacy(pThis);
     2679            sb16CmdResetLegacy(pThis);
    26822680            sb16Reattach(pThis, pDrv, pDrv->uLUN, "NullAudio");
    26832681
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