Bug 987290 - Tweak AudioChannel enum conversions to please typed enums - r=ehsan
☠☠ backed out by c67a79064fd4 ☠ ☠
authorBenoit Jacob <bjacob@mozilla.com>
Fri, 25 Apr 2014 22:34:04 -0400
changeset 180719 4ad1f662f521eba6514463d13aee536dd17c45ca
parent 180718 080ff1f864652fed62dddc70ed1d5e02ef9e6809
child 180720 8d424037ce207b3c6a8d379de7c05ed134fd10f5
push id272
push userpvanderbeken@mozilla.com
push dateMon, 05 May 2014 16:31:18 +0000
reviewersehsan
bugs987290
milestone31.0a1
Bug 987290 - Tweak AudioChannel enum conversions to please typed enums - r=ehsan
dom/audiochannel/AudioChannelAgent.cpp
--- a/dom/audiochannel/AudioChannelAgent.cpp
+++ b/dom/audiochannel/AudioChannelAgent.cpp
@@ -80,30 +80,23 @@ AudioChannelAgent::InitInternal(nsIDOMWi
                                 nsIAudioChannelAgentCallback *aCallback,
                                 bool aUseWeakRef, bool aWithVideo)
 {
   // We need the window only for IPC.
   MOZ_ASSERT(aWindow || XRE_GetProcessType() == GeckoProcessType_Default);
 
   // We syncd the enum of channel type between nsIAudioChannelAgent.idl and
   // AudioChannelBinding.h the same.
-  MOZ_ASSERT(static_cast<AudioChannel>(AUDIO_AGENT_CHANNEL_NORMAL) ==
-             AudioChannel::Normal &&
-             static_cast<AudioChannel>(AUDIO_AGENT_CHANNEL_CONTENT) ==
-             AudioChannel::Content &&
-             static_cast<AudioChannel>(AUDIO_AGENT_CHANNEL_NOTIFICATION) ==
-             AudioChannel::Notification &&
-             static_cast<AudioChannel>(AUDIO_AGENT_CHANNEL_ALARM) ==
-             AudioChannel::Alarm &&
-             static_cast<AudioChannel>(AUDIO_AGENT_CHANNEL_TELEPHONY) ==
-             AudioChannel::Telephony &&
-             static_cast<AudioChannel>(AUDIO_AGENT_CHANNEL_RINGER) ==
-             AudioChannel::Ringer &&
-             static_cast<AudioChannel>(AUDIO_AGENT_CHANNEL_PUBLICNOTIFICATION) ==
-             AudioChannel::Publicnotification,
+  MOZ_ASSERT(int(AUDIO_AGENT_CHANNEL_NORMAL) == int(AudioChannel::Normal) &&
+             int(AUDIO_AGENT_CHANNEL_CONTENT) == int(AudioChannel::Content) &&
+             int(AUDIO_AGENT_CHANNEL_NOTIFICATION) == int(AudioChannel::Notification) &&
+             int(AUDIO_AGENT_CHANNEL_ALARM) == int(AudioChannel::Alarm) &&
+             int(AUDIO_AGENT_CHANNEL_TELEPHONY) == int(AudioChannel::Telephony) &&
+             int(AUDIO_AGENT_CHANNEL_RINGER) == int(AudioChannel::Ringer) &&
+             int(AUDIO_AGENT_CHANNEL_PUBLICNOTIFICATION) == int(AudioChannel::Publicnotification),
              "Enum of channel on nsIAudioChannelAgent.idl should be the same with AudioChannelBinding.h");
 
   if (mAudioChannelType != AUDIO_AGENT_CHANNEL_ERROR ||
       aChannelType > AUDIO_AGENT_CHANNEL_PUBLICNOTIFICATION ||
       aChannelType < AUDIO_AGENT_CHANNEL_NORMAL) {
     return NS_ERROR_FAILURE;
   }