Changeset 90005 in vbox for trunk/src/VBox/Devices/Audio
- Timestamp:
- Jul 2, 2021 7:07:42 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Audio/AudioTest.cpp
r90004 r90005 1672 1672 if (RT_SUCCESS(rc)) 1673 1673 { 1674 /** @todo r=bird: see comment in audioTestObjOpen about how reckless it is to 1675 * leave most of the phObj structure uninitialized. */ 1676 1674 1677 if (RTStrPrintf2(phObj->szSec, sizeof(phObj->szSec), "obj_%s", szUuid) <= 0) 1675 AssertFailedReturn(VERR_BUFFER_OVERFLOW); 1678 AssertFailedReturn(VERR_BUFFER_OVERFLOW); /** @todo r=bird: AssertReturn(RTStrPrintf2() > 0); results in better code. */ 1676 1679 1677 1680 /** @todo Check test section existence. */ … … 1736 1739 * 1737 1740 * @returns VBox status code. 1738 * @param pSet Audio test set the object contains.1739 1741 * @param phObj Object handle to open. 1740 1742 * @param ppObj Where to return the pointer of the allocated and registered audio test object. … … 1742 1744 static int audioTestObjOpen(PAUDIOTESTOBJINT phObj, PAUDIOTESTOBJINT *ppObj) 1743 1745 { 1746 /** @todo r=bird: phObj and ppObj: why the 'h' in the first and not the 1747 * latter? They are of the same type, which is suffixed 'INT', so the 'h' 1748 * is probably out of place. 1749 * 1750 * An immediate question just looking at this function, would why this isn't a 1751 * 'duplicate' instead of a 'open' operation. However, looking at how little 1752 * audioTestObjGetChild actually does to the phObj we're getting from 1753 * audioTestVerifyTestToneData, it looks more like phObj is just a convenient 1754 * way of passing a PAUDIOTESTSET and a section name (szSec) around without 1755 * actually initializing anything else in the structure. 1756 * 1757 * This is reckless (7+ uninitialized members) and 'ing confusing code! */ 1744 1758 PAUDIOTESTOBJINT pObj = (PAUDIOTESTOBJINT)RTMemAlloc(sizeof(AUDIOTESTOBJINT)); 1745 1759 AssertPtrReturn(pObj, VERR_NO_MEMORY);
Note:
See TracChangeset
for help on using the changeset viewer.