Changeset 98082 in vbox
- Timestamp:
- Jan 15, 2023 1:59:48 AM (2 years ago)
- svn:sync-xref-src-repo-rev:
- 155214
- Location:
- trunk/src/VBox/Main
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/idl/VirtualBox.xidl
r98044 r98082 1325 1325 <const name="Graphics3D" value="7"> 1326 1326 <desc>Graphics device 3D activity.</desc> 1327 </const> 1328 <const name="End" value="8"> 1329 <desc>End of valid device types (exclusive). Used for invalid validation and such.</desc> 1327 1330 </const> 1328 1331 </enum> -
trunk/src/VBox/Main/src-client/ConsoleImpl.cpp
r97815 r98082 2832 2832 */ 2833 2833 2834 std::vector<bool> aWanted;2835 std::vector<PDMLEDCORE> aLED;2836 DeviceType_T maxWanted = (DeviceType_T) 0;2837 DeviceType_T enmType;2838 2839 2834 /* Make a roadmap of which DeviceType_T LED types are wanted */ 2835 DeviceType_T maxWanted = (DeviceType_T)0; 2836 bool aWanted[DeviceType_End] = { 0 }; 2837 Assert(aWanted[1] == false && aWanted[DeviceType_End - 1] == false); 2838 2840 2839 for (size_t iType = 0; iType < aType.size(); ++iType) 2841 2840 { 2842 enmType = aType[iType]; 2841 DeviceType_T const enmType = aType[iType]; 2842 AssertReturn(enmType > DeviceType_Null && enmType < DeviceType_End, 2843 setError(E_INVALIDARG, tr("Invalid DeviceType for getDeviceActivity in entry #%u: %d"), iType, enmType)); 2844 aWanted[enmType] = true; 2843 2845 if (enmType > maxWanted) 2844 {2845 2846 maxWanted = enmType; 2846 aWanted.resize(maxWanted + 1); 2847 } 2848 aWanted[enmType] = true; 2849 } 2850 aLED.resize(maxWanted + 1); 2847 } 2848 2849 /* Resize the result vector before making changes (may throw, paranoia). */ 2850 aActivity.resize(aType.size()); 2851 2851 2852 2852 /* Collect all the LEDs in a single sweep through all drivers' sets */ 2853 PDMLEDCORE aLEDs[DeviceType_End] = { {0} }; 2854 Assert(aLEDs[1].u32 == 0 && aLEDs[DeviceType_End / 2].u32 == 0 && aLEDs[DeviceType_End - 1].u32 == 0); /* paranoia */ 2853 2855 for (uint32_t idxSet = 0; idxSet < mcLedSets; ++idxSet) 2854 2856 { … … 2861 2863 for (uint32_t inSet = 0; inSet < pLS->cLeds; ++inSet) 2862 2864 { 2863 enmType = pLS->paSubTypes[inSet];2865 DeviceType_T const enmType = pLS->paSubTypes[inSet]; 2864 2866 if (enmType < maxWanted && aWanted[enmType]) 2865 aLED [enmType].u32 |= readAndClearLed(pLS->papLeds[inSet]);2867 aLEDs[enmType].u32 |= readAndClearLed(pLS->papLeds[inSet]); 2866 2868 } 2867 2869 } … … 2869 2871 else 2870 2872 { 2871 enmType = pLS->enmType;2873 DeviceType_T const enmType = pLS->enmType; 2872 2874 if (enmType < maxWanted && aWanted[enmType]) 2873 2875 for (uint32_t inSet = 0; inSet < pLS->cLeds; ++inSet) 2874 aLED [enmType].u32 |= readAndClearLed(pLS->papLeds[inSet]);2875 } 2876 } 2877 2878 aActivity.resize(aType.size());2876 aLEDs[enmType].u32 |= readAndClearLed(pLS->papLeds[inSet]); 2877 } 2878 } 2879 2880 /* Compose the result vector: */ 2879 2881 for (size_t iType = 0; iType < aActivity.size(); ++iType) 2880 2882 { 2881 /* Compose the result */ 2882 switch (aLED[aType[iType]].u32 & (PDMLED_READING | PDMLED_WRITING)) 2883 switch (aLEDs[aType[iType]].u32 & (PDMLED_READING | PDMLED_WRITING)) 2883 2884 { 2884 2885 case 0: -
trunk/src/VBox/Main/src-client/ConsoleImpl2.cpp
r97716 r98082 671 671 Assert(cLeds > 0); 672 672 Assert(cLeds < 1024); /* Adjust if any driver supports >=1024 units! */ 673 Assert(enmType > DeviceType_Null && enmType < DeviceType_End); 673 674 674 675 /* Grab a LED set entry before we start allocating anything so the destructor can do the cleanups. */
Note:
See TracChangeset
for help on using the changeset viewer.