Changeset 72973 in vbox
- Timestamp:
- Jul 8, 2018 1:23:58 PM (7 years ago)
- svn:sync-xref-src-repo-rev:
- 123525
- Location:
- trunk
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/com/array.h
r70385 r72973 236 236 237 237 /** Initializes memory for aElem. */ 238 static void Init(T &aElem) { aElem = 0; }238 static void Init(T &aElem) { aElem = (T)0; } 239 239 240 240 /** Initializes memory occupied by aElem. */ -
trunk/src/VBox/Main/idl/comimpl.xsl
r60977 r72973 303 303 <xsl:choose> 304 304 <xsl:when test="@safearray='yes'"> 305 <xsl:variable name="elemtype"> 306 <xsl:call-template name="typeIdl2Back"> 307 <xsl:with-param name="type" select="@type" /> 308 <xsl:with-param name="safearray" select="''" /> 309 <xsl:with-param name="dir" select="'in'" /> 310 </xsl:call-template> 311 </xsl:variable> 312 <xsl:value-of select=" '#ifdef RT_OS_WINDOWS '"/> 313 <xsl:value-of select="concat(' SAFEARRAY *aPtr_', @name, ' = va_arg(args, SAFEARRAY *); ')"/> 314 <xsl:value-of select="concat(' com::SafeArray<', $elemtype,'> aArr_', @name, '(aPtr_', @name, '); ')"/> 315 <xsl:value-of select=" '#else '"/> 316 <xsl:value-of select="concat(' PRUint32 aArrSize_', @name, ' = va_arg(args, PRUint32); ')"/> 317 <xsl:value-of select="concat(' void* aPtr_', @name, ' = va_arg(args, void*); ')"/> 318 <xsl:value-of select="concat(' com::SafeArray<', $elemtype,'> aArr_', @name, '(aArrSize_', @name, ', (', $elemtype,'*)aPtr_', @name, '); ')"/> 319 <xsl:value-of select=" '#endif '"/> 320 <xsl:value-of select="concat(' ',$obj, '->set_', @name, '(ComSafeArrayAsInParam(aArr_', @name, ')); ')"/> 305 <xsl:variable name="elemtype"> 306 <xsl:call-template name="typeIdl2Back"> 307 <xsl:with-param name="type" select="@type" /> 308 <xsl:with-param name="safearray" select="''" /> 309 <xsl:with-param name="dir" select="'in'" /> 310 </xsl:call-template> 311 </xsl:variable> 312 <xsl:value-of select=" '#ifdef RT_OS_WINDOWS '"/> 313 <xsl:value-of select="concat(' SAFEARRAY *aPtr_', @name, ' = va_arg(args, SAFEARRAY *); ')"/> 314 <xsl:value-of select="concat(' com::SafeArray<', $elemtype,'> aArr_', @name, '(aPtr_', @name, '); ')"/> 315 <xsl:value-of select=" '#else '"/> 316 <xsl:value-of select="concat(' PRUint32 aArrSize_', @name, ' = va_arg(args, PRUint32); ')"/> 317 <xsl:value-of select="concat(' void* aPtr_', @name, ' = va_arg(args, void*); ')"/> 318 <xsl:value-of select="concat(' com::SafeArray<', $elemtype,'> aArr_', @name, '(aArrSize_', @name, ', (', $elemtype,'*)aPtr_', @name, '); ')"/> 319 <xsl:value-of select=" '#endif '"/> 320 <xsl:value-of select="concat(' ',$obj, '->set_', @name, '(ComSafeArrayAsInParam(aArr_', @name, ')); ')"/> 321 </xsl:when> 322 <xsl:when test="substring($aType, string-length($aType) - 1) = '_T'"> <!-- To avoid pedantic gcc warnings/errors. --> 323 <xsl:value-of select=" '#ifdef VBOX_WITH_XPCOM_CPP_ENUM_HACK '"/> 324 <xsl:value-of select="concat(' ',$aTypeName, ' = (',$aType,')va_arg(args, int); ')"/> 325 <xsl:value-of select=" '#else '"/> 326 <xsl:value-of select="concat(' ',$aTypeName, ' = va_arg(args, ',$aType,'); ')"/> 327 <xsl:value-of select=" '#endif '"/> 328 <xsl:value-of select="concat(' ',$obj, '->set_', @name, '(',$aName, '); ')"/> 321 329 </xsl:when> 322 330 <xsl:otherwise> -
trunk/src/VBox/Main/idl/xpidl.xsl
r69379 r72973 23 23 24 24 <xsl:include href="typemap-shared.inc.xsl"/> 25 26 27 <!-- - - - - - - - - - - - - - - - - - - - - - - 28 XSLT parameters 29 - - - - - - - - - - - - - - - - - - - - - - --> 30 31 <!-- xpidl doesn't support enums. This parameter performs certain hacks that helps 32 us bridge the gap and get similar behaviour as msidl. 33 34 The https://bugzilla.mozilla.org/show_bug.cgi?id=8781 bug discusses why xpidl 35 doesn't do enums. It boils down to the gcc short-enum option and similar 36 portability concerns. 37 --> 38 <xsl:param name="g_fHackEnumsOntoCppEnums" select="'no'"/> 39 25 40 26 41 <!-- … … 701 716 </xsl:for-each> 702 717 <xsl:text>};

</xsl:text> 703 <!-- --> 704 <xsl:value-of select="concat('/* cross-platform type name for ', @name, ' */
')"/> 705 <xsl:text>%{C++
</xsl:text> 706 <xsl:value-of select="concat('#define ', @name, '_T', ' ', 707 'PRUint32
')"/> 708 <xsl:text>%}

</xsl:text> 709 <!-- --> 710 <xsl:value-of select="concat('/* cross-platform constants for ', @name, ' */
')"/> 711 <xsl:text>%{C++
</xsl:text> 712 <xsl:for-each select="const"> 713 <xsl:value-of select="concat('#define ', ../@name, '_', @name, ' ', 714 ../@name, '::', @name, '
')"/> 715 </xsl:for-each> 716 <xsl:text>%}

</xsl:text> 718 <xsl:choose> 719 <xsl:when test="$g_fHackEnumsOntoCppEnums = 'yes'"> 720 <xsl:text> 721 /* IDL typedef for enum ', @name, ' */ 722 typedef PRUint32 </xsl:text><xsl:value-of select="concat(@name, '_EnumT')" /><xsl:text>; 723 724 /* C++ enum type name for ', @name, ' */ 725 %{C++ 726 typedef enum </xsl:text> 727 <xsl:value-of select="concat(@name, '_T')" /> 728 <xsl:text> { 729 </xsl:text> 730 <xsl:for-each select="const"> 731 <xsl:value-of select="concat(' ', ../@name, '_', @name, ' = ', ../@name, '::', @name, ',
')"/> 732 </xsl:for-each> 733 <xsl:value-of select="concat(' ', @name, '_32BitHack = 0x7fffffff', '
')"/> 734 <xsl:text>} </xsl:text><xsl:value-of select="concat(@name, '_T')"/><xsl:text>; 735 #ifdef AssertCompileSize 736 AssertCompileSize(</xsl:text><xsl:value-of select="concat(@name, '_T')"/><xsl:text>, sizeof(PRUint32)); 737 #endif 738 /* Use the preprocessor to replace the IDL enum typedef with our C++ enum so it will 739 behave just like we had real enum support in xpidl or if were using msidl. */ 740 #define </xsl:text><xsl:value-of select="concat(@name, '_EnumT ', @name, '_T')" /><xsl:text> 741 #ifndef VBOX_WITH_XPCOM_CPP_ENUM_HACK 742 # define VBOX_WITH_XPCOM_CPP_ENUM_HACK 1 743 #endif 744 %} 745 746 </xsl:text> 747 </xsl:when> 748 749 <xsl:otherwise> 750 <!-- --> 751 <xsl:value-of select="concat('/* cross-platform type name for ', @name, ' */
')"/> 752 <xsl:text>%{C++
</xsl:text> 753 <xsl:value-of select="concat('#define ', @name, '_T', ' ', 754 'PRUint32
')"/> 755 <xsl:text>%}

</xsl:text> 756 <!-- --> 757 <xsl:value-of select="concat('/* cross-platform constants for ', @name, ' */
')"/> 758 <xsl:text>%{C++
</xsl:text> 759 <xsl:for-each select="const"> 760 <xsl:value-of select="concat('#define ', ../@name, '_', @name, ' ', 761 ../@name, '::', @name, '
')"/> 762 </xsl:for-each> 763 <xsl:text>%}

</xsl:text> 764 </xsl:otherwise> 765 </xsl:choose> 717 766 </xsl:template> 718 767 … … 902 951 (ancestor::library/application/if[@target=$self_target]/enum[@name=current()]) 903 952 "> 904 <xsl:text>PRUint32</xsl:text> 953 <xsl:choose> 954 <xsl:when test="$g_fHackEnumsOntoCppEnums = 'yes'"> 955 <xsl:value-of select="concat(., '_EnumT')" /> 956 </xsl:when> 957 <xsl:otherwise> 958 <xsl:text>PRUint32</xsl:text> 959 </xsl:otherwise> 960 </xsl:choose> 905 961 </xsl:when> 906 962 <!-- custom interface types --> -
trunk/src/VBox/Main/src-client/ConsoleImpl2.cpp
r72919 r72973 2579 2579 case NetworkAdapterType_Virtio: 2580 2580 break; 2581 case NetworkAdapterType_Null: AssertFailedBreak(); /* Shut up MSC */ 2581 case NetworkAdapterType_Null: AssertFailedBreak(); /* (compiler warnings) */ 2582 #ifdef VBOX_WITH_XPCOM_CPP_ENUM_HACK 2583 case NetworkAdapterType_32BitHack: AssertFailedBreak(); /* (compiler warnings) */ 2584 #endif 2582 2585 } 2583 2586 … … 2867 2870 InsertConfigString (pCfg, "DebugPathOut", strDebugPathOut); 2868 2871 } 2872 default: AssertFailedBreak(); 2869 2873 } 2870 2874 -
trunk/src/VBox/Main/src-client/GuestProcessImpl.cpp
r71825 r72973 1332 1332 * flags untouched. */ 1333 1333 break; 1334 #ifdef VBOX_WITH_XPCOM_CPP_ENUM_HACK 1335 case ProcessStatus_32BitHack: AssertFailedBreak(); /* (compiler warnings) */ 1336 #endif 1334 1337 } 1335 1338 -
trunk/src/VBox/Main/src-server/ApplianceImpl.cpp
r72902 r72973 323 323 case NetworkAttachmentType_NATNetwork: strType = "NATNetwork"; break; 324 324 case NetworkAttachmentType_Null: strType = "Null"; break; 325 #ifdef VBOX_WITH_XPCOM_CPP_ENUM_HACK 326 case NetworkAttachmentType_32BitHack: AssertFailedBreak(); /* (compiler warnings) */ 327 #endif 325 328 } 326 329 return strType; … … 1485 1488 case VirtualSystemDescriptionValueType_Auto: aValues[i] = vsde->strVBoxCurrent; break; 1486 1489 case VirtualSystemDescriptionValueType_ExtraConfig: aValues[i] = vsde->strExtraConfigCurrent; break; 1490 #ifdef VBOX_WITH_XPCOM_CPP_ENUM_HACK 1491 case VirtualSystemDescriptionValueType_32BitHack: AssertFailedBreak(); /* (compiler warnings) */ 1492 #endif 1487 1493 } 1488 1494 } -
trunk/src/VBox/Main/src-server/HostNetworkInterfaceImpl.cpp
r69500 r72973 175 175 m.realIPV6PrefixLength = m.IPV6NetworkMaskPrefixLength = iPrefixIPv6; 176 176 m.hardwareAddress = Bstr(Utf8StrFmt("%RTmac", &info.MACAddress)); 177 #ifdef RT_OS_WINDOWS 178 m.mediumType = (HostNetworkInterfaceMediumType)info.enmMediumType; 179 m.status = (HostNetworkInterfaceStatus)info.enmStatus; 180 #else /* !RT_OS_WINDOWS */ 181 m.mediumType = info.enmMediumType; 182 m.status = info.enmStatus; 183 #endif /* !RT_OS_WINDOWS */ 177 AssertCompile((unsigned)NETIF_T_UNKNOWN == (unsigned)HostNetworkInterfaceMediumType_Unknown); 178 m.mediumType = (HostNetworkInterfaceMediumType_T)info.enmMediumType; 179 AssertCompile((unsigned)NETIF_S_UNKNOWN == (unsigned)HostNetworkInterfaceStatus_Unknown); 180 m.status = (HostNetworkInterfaceStatus_T)info.enmStatus; 184 181 m.speedMbits = info.uSpeedMbits; 185 182 m.wireless = info.fWireless; … … 239 236 m.dhcpEnabled = pIf->fDhcpEnabled; 240 237 m.hardwareAddress = Bstr(Utf8StrFmt("%RTmac", &pIf->MACAddress)); 241 #ifdef RT_OS_WINDOWS 242 m.mediumType = (HostNetworkInterfaceMediumType)pIf->enmMediumType; 243 m.status = (HostNetworkInterfaceStatus)pIf->enmStatus; 244 #else /* !RT_OS_WINDOWS */ 245 m.mediumType = pIf->enmMediumType; 246 m.status = pIf->enmStatus; 247 #endif /* !RT_OS_WINDOWS */ 238 AssertCompile((unsigned)NETIF_T_UNKNOWN == (unsigned)HostNetworkInterfaceMediumType_Unknown); 239 m.mediumType = (HostNetworkInterfaceMediumType_T)pIf->enmMediumType; 240 AssertCompile((unsigned)NETIF_S_UNKNOWN == (unsigned)HostNetworkInterfaceStatus_Unknown); 241 m.status = (HostNetworkInterfaceStatus_T)pIf->enmStatus; 248 242 m.speedMbits = pIf->uSpeedMbits; 249 243 m.wireless = pIf->fWireless; -
trunk/src/VBox/Main/src-server/MachineImplCloneVM.cpp
r72883 r72973 934 934 switch (d->mode) 935 935 { 936 case CloneMode_MachineState: d->queryMediasForMachineState(machineList, fAttachLinked, 937 uCount, uTotalWeight); 938 break; 939 case CloneMode_MachineAndChildStates: d->queryMediasForMachineAndChildStates(machineList, fAttachLinked, 940 uCount, uTotalWeight); 941 break; 942 case CloneMode_AllStates: d->queryMediasForAllStates(machineList, fAttachLinked, uCount, 943 uTotalWeight); 944 break; 936 case CloneMode_MachineState: 937 d->queryMediasForMachineState(machineList, fAttachLinked, uCount, uTotalWeight); 938 break; 939 case CloneMode_MachineAndChildStates: 940 d->queryMediasForMachineAndChildStates(machineList, fAttachLinked, uCount, uTotalWeight); 941 break; 942 case CloneMode_AllStates: 943 d->queryMediasForAllStates(machineList, fAttachLinked, uCount, uTotalWeight); 944 break; 945 #ifdef VBOX_WITH_XPCOM_CPP_ENUM_HACK 946 case CloneMode_32BitHack: /* (compiler warnings) */ 947 AssertFailedBreak(); 948 #endif 945 949 } 946 950 -
trunk/src/VBox/Main/src-server/SerialPortImpl.cpp
r70766 r72973 289 289 case PortMode_Disconnected: 290 290 break; 291 #ifdef VBOX_WITH_XPCOM_CPP_ENUM_HACK 292 case PortMode_32BitHack: /* (compiler warnings) */ 293 AssertFailedBreak(); 294 #endif 291 295 } 292 296 -
trunk/src/VBox/Main/src-server/StorageControllerImpl.cpp
r66126 r72973 165 165 break; 166 166 case StorageBus_Null: break; /* Shut up MSC. */ 167 #ifdef VBOX_WITH_XPCOM_CPP_ENUM_HACK 168 case StorageBus_32BitHack: break; /* Shut up GCC. */ 169 #endif 167 170 } 168 171 -
trunk/src/VBox/Main/xml/Settings.cpp
r72332 r72973 6833 6833 switch (machineUserData.enmFaultToleranceState) 6834 6834 { 6835 case FaultToleranceState_Inactive: 6836 pelmFaultTolerance->setAttribute("state", "inactive"); 6837 break; 6838 case FaultToleranceState_Master: 6839 pelmFaultTolerance->setAttribute("state", "master"); 6840 break; 6841 case FaultToleranceState_Standby: 6842 pelmFaultTolerance->setAttribute("state", "standby"); 6843 break; 6835 case FaultToleranceState_Inactive: 6836 pelmFaultTolerance->setAttribute("state", "inactive"); 6837 break; 6838 case FaultToleranceState_Master: 6839 pelmFaultTolerance->setAttribute("state", "master"); 6840 break; 6841 case FaultToleranceState_Standby: 6842 pelmFaultTolerance->setAttribute("state", "standby"); 6843 break; 6844 #ifdef VBOX_WITH_XPCOM_CPP_ENUM_HACK 6845 case FaultToleranceState_32BitHack: /* (compiler warnings) */ 6846 AssertFailedBreak(); 6847 #endif 6844 6848 } 6845 6849 … … 6921 6925 /* On Linux, we need to check at runtime what's actually supported. */ 6922 6926 static RTCLockMtx s_mtx; 6923 static AudioDriverType_T s_ linuxDriver = -1;6927 static AudioDriverType_T s_enmLinuxDriver = AudioDriverType_Null; 6924 6928 RTCLock lock(s_mtx); 6925 if (s_ linuxDriver == (AudioDriverType_T)-1)6929 if (s_enmLinuxDriver == AudioDriverType_Null) 6926 6930 { 6927 6931 # ifdef VBOX_WITH_AUDIO_PULSE … … 6929 6933 if (RTProcIsRunningByName("pulseaudio") && 6930 6934 RTLdrIsLoadable("libpulse.so.0")) 6931 s_ linuxDriver = AudioDriverType_Pulse;6935 s_enmLinuxDriver = AudioDriverType_Pulse; 6932 6936 else 6933 6937 # endif /* VBOX_WITH_AUDIO_PULSE */ … … 6935 6939 /* Check if we can load the ALSA library */ 6936 6940 if (RTLdrIsLoadable("libasound.so.2")) 6937 s_ linuxDriver = AudioDriverType_ALSA;6941 s_enmLinuxDriver = AudioDriverType_ALSA; 6938 6942 else 6939 6943 # endif /* VBOX_WITH_AUDIO_ALSA */ 6940 s_ linuxDriver = AudioDriverType_OSS;6941 } 6942 return s_ linuxDriver;6944 s_enmLinuxDriver = AudioDriverType_OSS; 6945 } 6946 return s_enmLinuxDriver; 6943 6947 6944 6948 #elif defined(RT_OS_DARWIN)
Note:
See TracChangeset
for help on using the changeset viewer.